Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial ParallelBus support for ESP32-S2 #4047

Merged
merged 5 commits into from
Jan 26, 2021

Conversation

kmatch98
Copy link
Collaborator

@kmatch98 kmatch98 commented Jan 22, 2021

I updated and commited a new revision that gives more pin options. See note below.... This is ready for review.

Special Note:

Due to what I think is a limitations of the ESP32-S2 that prevents writing a single byte (8-bits) to the output register (32-bits, I had to modify the code to write a full 32-bit chunk to the register. I would like feedback if there are faster methods for writing out the data (see lines 214-236).

(Note: If using the same register for the data lines and the write line, so I can clear the write line at the same time as writing the data. I verified that I could eliminate the "clear_write" line with no negative impact on the operation, but with approximately 13% total time reduction.)

Verified on the following hardware:

Benchmark results

200x writes of purple.bmp using a forced refresh display.refresh() for each write:

  • PyPortal: 34.9 seconds (running 6.0.0-alpha.3-33-gd600759bc-dirty on 2020-09-10; Adafruit PyPortal with samd51j20)
  • Saola ESP32-S2: 23.3 seconds (running 6.1.0-rc.1-15-g6a76b6002-dirty on 2021-01-22; Saola 1 w/Wrover with ESP32S2

@kmatch98
Copy link
Collaborator Author

I evaluated the impact of bit manipulation to convert the 8-bit data into the 32-bit register. For everything I tried, I saw no significant impact on the performance. If you have any recommendations on speeding it up, I'll be glad to try them.

@kmatch98
Copy link
Collaborator Author

I added capability for data and write pins >= pin #32. Also, the data and write pins can be in different registers (0-31, or 32+).

This is now ready for review. Best is to compare against the SAMD or NRF ports.


I verified on the following hardware:

  • ESP32-S2 Saola Wrover demo board (ESP32-S2 Saola 1R Dev Kit featuring ESP32-S2 WROVER, Adafruit product ID: 4693)
  • 320x240 LCD display using ILI9341 display driver (2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341, Adafruit product ID: 1770)
  • CircuitPython version 6.1.0: 6.1.0-rc.1-15-g6a76b6002-dirty on 2021-01-22; Saola 1 w/Wrover with ESP32S2

Tests:

I verified the use of data0 pins in the lower register (pins #8-15), with either write pin #3 or write pin #33.
Still unverified:
I don't have hardware that breaks out pin 32, so I could not verify operation with data0 pins in the higher register (32+).

@tannewt tannewt self-requested a review January 25, 2021 22:35
@tannewt tannewt added displayio enhancement espressif applies to multiple Espressif chips labels Jan 25, 2021
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question and a request. Looks good overall. Thanks for taking this on!

ports/esp32s2/common-hal/displayio/ParallelBus.c Outdated Show resolved Hide resolved
ports/esp32s2/common-hal/displayio/ParallelBus.c Outdated Show resolved Hide resolved
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
displayio enhancement espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants