i2s parallel interface to monochrome lcd with 4bit data bus
Posted: Sun Oct 08, 2017 5:14 am
Thought I would post as a separate topic rather than reply to the i2s parallel led panel thread as it's a bit of a digression.
I have a few monochrome 240x160 lcds lying around that I have used with a Microchip PIC24 microcontroller with a built-in lcd controller peripheral.
The lcd interface signals are a 4bit data bus (4 horizontal 1-bit pixels are transmitted for every clock), uninterrupted clock , hsync (this is just a pulse to latch a line of pixels), a FR signal that toggles every frame, and a one line wide vsync pulse per frame. Have attached a grab of the signals ( chan0=VS, chan1=HS, chan2=FR, chan3=CLK ) I would like to try interfacing these panels with ESP32. Looking at the led panel showcase code comments, my understanding is that I should simply treat the HS, FR and VS signals encoded into the data as additional bits, so that gives me a 7bit parallel i2s interface.
If this is OK, then I would have two complete frames of pixel data, with one byte dedicated for every 4 horizontal pixels. One frame being drawn to by the application, the other frame being transmitted to the lcd panel, in ping-pong mode to avoid artifacts. Each frame would be (240/4)x160 = 9600bytes.
If all of the above is technically OK, my question is : what is the minimum parallel width supported by the ESP32 i2s lcd mode?
Can I dma a byte buffer encoded with 4bits of data plus the HS, FR, VS bits ? Just want to make sure this is possible before I tear my hair out trying to figure out the dma + i2s fifo interaction .
Padding extra bytes for each 4bit data packet would be a huge waste.
Would appreciate any tips - I will post the code on github if I can get it working as outlined above. Thanks!
I have a few monochrome 240x160 lcds lying around that I have used with a Microchip PIC24 microcontroller with a built-in lcd controller peripheral.
The lcd interface signals are a 4bit data bus (4 horizontal 1-bit pixels are transmitted for every clock), uninterrupted clock , hsync (this is just a pulse to latch a line of pixels), a FR signal that toggles every frame, and a one line wide vsync pulse per frame. Have attached a grab of the signals ( chan0=VS, chan1=HS, chan2=FR, chan3=CLK ) I would like to try interfacing these panels with ESP32. Looking at the led panel showcase code comments, my understanding is that I should simply treat the HS, FR and VS signals encoded into the data as additional bits, so that gives me a 7bit parallel i2s interface.
If this is OK, then I would have two complete frames of pixel data, with one byte dedicated for every 4 horizontal pixels. One frame being drawn to by the application, the other frame being transmitted to the lcd panel, in ping-pong mode to avoid artifacts. Each frame would be (240/4)x160 = 9600bytes.
If all of the above is technically OK, my question is : what is the minimum parallel width supported by the ESP32 i2s lcd mode?
Can I dma a byte buffer encoded with 4bits of data plus the HS, FR, VS bits ? Just want to make sure this is possible before I tear my hair out trying to figure out the dma + i2s fifo interaction .
Padding extra bytes for each 4bit data packet would be a huge waste.
Would appreciate any tips - I will post the code on github if I can get it working as outlined above. Thanks!