The CPLD is used to perform high-speed serial-parallel conversion between the electronic paper and the ESP32 microcomputer, enabling image data to be transferred to the electronic paper at high speed.
In addition, the ESP32-WROVER-B allows us to store a large amount of image data in memory, so we can perform animations in conjunction with the high-speed transfer of CPLD.
- Watch the video first
- How it works
- Enables ESP32-WROVER-B to store a large number of images in memory
- Power control for electronic paper
- Animation is difficult using e-paper
- Faster rendering than ever before
Watch the video first
How it works
This time, the experimental circuit is
- Electronic Paper ED050SC3
- Microcomputer ESP32-WROVER-B
- CPLD MAX V 5M160
- Power supply for electronic paper TPS65185
It is made up of the above blocks.
Each block is connected as shown in the figure.The microcomputer is connected to each module by SPI and I2C, which makes it possible to control the e-paper with a small number of IO pins.
Serial-parallel conversion by CPLD
Electronic paper requires 8 signal lines for transferring image data and a minimum of 7 signal lines for controlling modules such as horizontal and vertical synchronization.
If these 15 signals are connected directly from the ESP32, the GPIO pins are almost exhausted.In addition, the GPIO of ESP32 is very slow and can only be turned on and off at about 1MHz per pin.
If you use 8 cables for data, the transfer speed will be about 100kB/s.
The amount of data for one screen is 120kB, so it takes more than 1 second to draw one screen.
Furthermore, as a characteristic of e-paper, ink transfer is incomplete with just one image transfer, and the contrast of the displayed image is low. In order to display a clear image, the same image needs to be drawn at least five times.
Therefore, it was necessary to have a mechanism to transfer data from ESP32 to e-paper at high speed.
Therefore, I built a dedicated serial-parallel conversion circuit in the CPLD to convert SPI into control signals for electronic paper and bus signals for image data.
This allows ESP32 to simply send the image data via SPI.
The SPI clock runs at 40MHz, so it can send data at about 4MB/s.It can draw about 40 times faster than the parallel communication using GPIO.
For the CPLD, I’m using the Intel MAX V 5M160.The MAX V evaluation board is based on this one I made earlier.
The LED board that visualizes the state of the IO is on top of this, so the LED is glowing in the movie.
Enables ESP32-WROVER-B to store a large number of images in memory
Reading data from the SD card is very slow, so you need to read and put it in memory once.
Since there is 60kB of black and white image data, it is not possible to store many images in memory with an ordinary ESP32.
So I decided to use the ESP32-WROVER-B.
The ESP32-WROVER-B is a model in which 8MB of pseudo SRAM is added to the ESP32.
In Arduino, only 4MB is available out of 8MB.
By loading the animation image data from the SD card into this memory, it is possible to switch screens at high speed.
However, the pseudo SRAM is not connected to the ESP32 CPU by a bus , but by SPI with an 80MHz clock.
It seems to take longer to access than the ESP32 memory.It feels like it’s about 4 times slower.
Power control for electronic paper
Electronic paper uses a high voltage to attract weakly electrically charged particles to the surface of the screen to display an image.
Therefore, it will not work with a single 3.3V power supply, but requires six types of supply voltages: -22V, +20V, +15V, -15V, VCOM, and 3.3V.Moreover, it has to be turned on and off in a certain order when the power supply is turned on and off.
Therefore, we decided to use a dedicated power supply IC to generate power.
This dedicated IC can be controlled by I2C, so it is very convenient to control with only a few IO pins.
Animation is difficult using e-paper
I’ve been able to use these mechanisms to switch between images on e-paper at high speed.
However, I was limited to switching about three frames per second.
Also, when switching between frames, “black” is momentarily added.
It’s hard to change from black to white
I don’t know if it’s unique to the ED050SC3 model or if it’s something that can be said about e-paper in general, but it’s easy to change from white to black, but it’s hard to change from black to white.
Therefore, you have to overwrite the same image over and over again to make the black color fade to white.
Afterimages tend to linger
For the same reason, it’s easy for the black pattern to remain undiminished.
In order to remove the black pattern, a solid black paint is drawn at the beginning of each frame to make the whole area black, and then the image data is drawn.
As a result, the image is momentarily darkened when the frame is switched.
Faster rendering than ever before
Due to the characteristics of the panel, it is difficult to increase the frame rate of the animation any further, but CPLD has made it possible to render images at high speed.
By the way, let’s take a look at the difference in the display speed so far.
This is the first model.The mbed microcontroller of LPC1114 draws a BMP image in the SD card on an electronic paper.
It is quite slow because it is displayed while reading from the SD card.
Based on this, I commercialized a 6-inch play with electronic paper experiment kit.
It could be used as a location plate.
The microcomputer was changed to ESP8266 and improved to an electronic paper connected to the Internet.
The microcomputer is now faster, so the drawing is a little faster.
The product based on this is a 5-inch weather forecast experiment set with electronic paper and WiFi microcomputer.
The drawing itself has become faster because it has been improved to load images from the SD card into the memory once and then draw them on the e-paper.
However, it takes a lot of time to read from the SD card.
Since the ESP8266 is connected to the Internet, it can now display the weather forecast and can also be used as an NTP clock.
ESP32-WROVER-B + CPLD
This is the current version.Looking at this, it’s quite an improvement.
There is still a lot of work to be done for commercialization, so I will do my best to make it happen as soon as possible.