-
Bouncy, bouncy
06/10/2022 at 20:49 • 0 commentsThanks to some code suggestions from Espressif, I’ve got a bouncing square. A glitch occurred whenever the LCD peripheral and the processor would both access PSRAM. The new code (as best I understand) ties up the processor while doing the LCD refresh. Seems like there would be a better way of avoiding collisions, but at least it works.
-
Screen shifting
06/10/2022 at 20:48 • 0 comments- I manually merged in some of the recent updates to the ESP-IDF for the ESP32-S3 LCD peripheral by @suda-morris and that seems to have banished the screen offsets. Here is a link to the issue requesting a back port of these fixes to ESP-IDF version 4.4
However the screen goes wonky whenever CircuitPython is doing some processing and the screen is updated. I think this may be the effect known as “tearing” but I’m. It sure the root cause yet. It seems that the screen sync is getting delayed so the display is temporarily drawn in the wrong locations while CircuitPython is doing some computing work. After the work slows down the screen draws back to where it should be. I think there should be some coordination where the screen is not redrawn while CircuitPython is doing some processing work. Or somehow prevent CircuitPython from delaying the syncs. or it’s possible that CircuitPython is accessing PSRAM and delaying DMA reads from the LCD peripheral.
I need to better understand if there are coordination mechanisms available for the LCD display. Also I am unsure how to debug timing issues like this, that’s a new area for me to explore.
- I manually merged in some of the recent updates to the ESP-IDF for the ESP32-S3 LCD peripheral by @suda-morris and that seems to have banished the screen offsets. Here is a link to the issue requesting a back port of these fixes to ESP-IDF version 4.4
-
Blinka!
06/10/2022 at 20:48 • 0 commentsI’ve now demonstrated CircuitPython talking to the display. Here’s a bitmap showing on the Crestron display. Thanks to some great pointers from the core development team I’m using the FrameBuffer approach. There is existing code to write display data to a memory framebuffer, along with the structure of some of the wrapper functions for setting up the display. In order to make it work now, I had to hack the ESP-IDF code for setting up the display. Perhaps some slight changes to the ESP-IDF could be accepted by the Espressif team, this will be a long term objective.
Here is the REPL with the Blinka logo:
There is some oddity with the display position. Whenever I type into the REPL the screen shifts. I suspect anytime CircuitPython is doing so,e processing that the RGB peripheral timing shifts. I’ll have to dig in to figure out what is going on with this.
Also, when code.py exits, the display goes weird and stops updating. Also, when rebooting with a ctrl-D and trying to reset the display causes a crash. Lots still to figure out, but I’m definitely glad to see some pixels drawn! It’s a real testament to the value of the existing framebuffer code, that I can add a new display type in such short order. Special thanks to @jepler who wrote the bulk of the FrameBuffer code.
-
Talking to the screen!
06/10/2022 at 20:47 • 0 comments -
Backlight test
06/10/2022 at 20:47 • 0 commentsThe backlight controller works. Unfortunately I toasted the backlight controller on the first board. I have a 3 Ohm sense resistor on the board, perhaps that was too low and maybe I cranked up the current too fast. On the second board I removed the 3 Ohm and put 20 Ohms for the sense resistor and it works. Also I got confused for a bit because the backlight would start to work and then turn off. Realized that without a microcontroller board attached, that the backlight’s standby pin would float and shut it off. I connected the backlight standby pin to VDD and all is well.
I did a test fit of the display. The touch controller needs to be nudged a bit north by a couple millimeters. It has enough slack for now.
Yay! Next step is to connect the microcontroller board. Hope everything is wired properly. It works!
-
Coding with the ESP-IDF
06/10/2022 at 20:46 • 0 commentsSince my ultimate goal is to get this ESP32-S3 RGB display driving capability into CircuitPython, I’m tracking my progress in this CircuitPython issue on GitHub. I’ve made progress in understanding the ESP-IDF and now have some reasonable drawing speeds.
I’m working to better understand and document the capabilities of the ESP-IDF for drawing bitmaps to the screen. To achieve this I had to hack the `draw_bitmap` function provided by the IDF to eliminate some unnecessary steps that significantly limit the frame rate. Primarily, I observe that the `lcd_ll_start` command needs only to be run in initialization. Subsequent updates to the display framebuffer can then proceed without additional calls to `lcd_ll_start`. More documentation to come in the issue referenced above.
-
PCB Planning
06/10/2022 at 20:45 • 0 comments- I’m starting to plan for a development board for this touchscreen display, since there is a giant mess of wires on my current breadboard. I want this board to mount to the back of the display and provide the FPC connections to the Display and Touchcscreen and provide the current limit control for the white LED backlight. Optional features include a battery charging circuit I think that won’t make it on the first revision
Here is a list of items I want to include:
- ESP32-S3 demo board (2 x 22 0.1” header pins)
- Solderable header pin breakout connections
- Adafruit Feather header connections (Optional)
- 40 pin 0.5mm FPC connect for LCD display
- Breakout for all 40 display pins (Optional)
- 6 pin 1.0 mm FPC connector for touch panel
- Breakout for 6 touch panel pins (Required)
- Backlight driver circuit with PWM control
- Backlight connector - I think this is Molex Picoblade, 2 pin
- Backlight connector - solderable header pads
- Battery charger circuit (optional)
- Battery connector (optional)
- LiPo battery (optional)
- Header connections for unused pins (combine with above)
- Stemma QT connector for I2C (optional)
- Mounting holes
Details, details
03/06/2022 at 00:40 • 0 commentsI suspect the old adage of “measure twice, cut once” is applicable for PCB design so I’m going through step by step with the pin outs for the ESP32-S3 DevKit and the LCD panel.
I verified the touch panel on the TSS-752 matches that of the other mode I tore down, with
- GND
- 3.3v
- SDA (GPIO42)
- SCL (GPIO41)
- Interrupt (GPIO40)
- Wake
I connected as shown to the GPIO pins listed above and it works with the CircuitPython FocalTouch library from Adafruit.
Also, I’d like to include the backlight control circuit on this board, so I tested Adafruit’s TFT friend. In testing I didn’t realize it had breakout pins for the backlight and in the process almost burned up the board. Lucky the display driver has overtemperature protection! Anyway, I verified the circuit is working for my backlight. Yet I still need to finalize the desired maximum current and also want to try out the PWM control for brightness. Unfortunately that specific chip used on the TFT Friend is unavailable. However, this chip from OnSemi looks similar: CAT4139TD-GT3. Need to verify the recommended inductor and diode footprints though.
Still a lot of details to sort out but it’s coming together. One more concept I’m exploring is some pluggable Stemma QT ports for sensors. But unfortunately there are no PCB mountable sockets that can plug into the sensor boards. Maybe I can hack it together by using a cable and a 3D printed case and epoxy.
Making life easier (maybe) with a Circuit Board
03/09/2022 at 22:31 • 0 commentsThis display looks well-hackable as long as you have a dot-clock controller. Now with the ESP32-S3 DevKit board that can use the internal LCD peripheral to drive dot-clock displays, I need a good way of connecting one to my board for testing and for further evaluating if CircuitPython can be cajoled into running this touchscreen display.
To first test the ESP32-S3 DevKit board, I ran the lcd_rgb demo code along with a giant mess of wires using Adafruit's 40-pin FPC-to-header connector and a 40-pin (2x20) header breakout. I tried my best to use these header pin connectors, but whenever I attach the display, I tend to pull out a few wires.
So, with all this risky display wiring, it's now time to bite the bullet and learn how to make a PCB. This will reduce a lot of frustration of removing wires and add the frustration of learning KiCad and how to order SMT PCBs for service and how to bogde any layout errors.
Here are the goals for my design:
- Make it easy to attach the display firmly to the ESP32-S3.
- Try out a couple of circuits: backlight controller and battery charger
To test out the current required for the backlight, I first used a bench power supply and my DMM. Somewhere around 100mA looks about right, and that occurs around 10V. I then procured the TFT friend from Adafruit and tested it out. In the process of testing, I didn't realize that the backlight Anode and Cathode were actually broken out to a pin, I assumed they were solely connected to the 40-pin breakout. In the process, I ended up maxing out the backlight driver up to maybe 1 Amp and the inductor gets HOT HOT! I suspect the driver chip has a overtemperature sensor, since it rhythmically cut in and out until I realized what was happening. Anyway, I rewired properly and verified that 100mA was adequate for the display. Also, I verified PWM operation of the backlight controller brightness. Works great. I was amazed that the ESP32-S3 PWMio worked fine, even at this early stage of CircuitPython development.
Key parts for my circuit:
- ESP32-S3 DevKit connected by headers
- Additional solderable via holes in case I need to:
- rewire the microcontroller pinouts
- adjust backlight current
- modify the battery charging current
- change polarity of the battery or backlight connections
- 40-pin FPC connector (0.5mm pitch) for RBG display
- 6-pin FPC connector (1.0mm pitch) for touch panel controller - Note metal is on opposite sides on the two FPC connectors
- Mounting holes to display backside
- Backlight driver (100mA)
- Battery charger (stretch goal)
- STEMMA QT connectors (2) - 3.3V compliant only
- Battery power switch
I made my first design in KiCad and will make an order. Fingers crossed.
- I’m starting to plan for a development board for this touchscreen display, since there is a giant mess of wires on my current breadboard. I want this board to mount to the back of the display and provide the FPC connections to the Display and Touchcscreen and provide the current limit control for the white LED backlight. Optional features include a battery charging circuit I think that won’t make it on the first revision
-
The screen works!
06/10/2022 at 20:44 • 0 commentsOk, the display works. The backlight current is between 75 and 125 mA at around 9 volts, depending upon how bright you like it. I corrected the left/right flip by setting the L/R pin to high, and now the graphics are oriented properly. Also I resized the LVGL code so that the graph fills the whole screen.
Next I need to to explore the ESP-IDF demo to understand the LCG functions that are provided and practice by drawing things in the screen, lines, rectangles, etc.
Also I am realizing that this is a giant rats nest of wires and prone to pulling wires loose from the breadboard. I should design a PCB to house the ESP32-S3 demo board, the display connectors and a backlight driver so that I can bolt them directly to the back of the display for development.
Also I verified the touch panel I2C pinout and confirmed that the touch panel registers touches for the arrow key regions and the X touch button.
Other next steps are to stat the journey of adding the ESP32-S3 LCD RBG peripheral into CircuitPython. Here is the issue on GitHub if you want to follow along or contribute.