All Projects → har-in-air → ESP32-LCD-I2S

har-in-air / ESP32-LCD-I2S

Licence: other
Espressif ESP32 driving a controller-less monochrome lcd with parallel I2S bus

Programming Languages

c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to ESP32-LCD-I2S

esp32-xbee
ESP32 XBee UART Interface
Stars: ✭ 48 (-11.11%)
Mutual labels:  esp32, esp-idf
esp32-freqcount
ESP32 Frequency Counter using Pulse Counter and Remote Control modules
Stars: ✭ 48 (-11.11%)
Mutual labels:  esp32, esp-idf
Homekit
Homekit for ESP32 with Arduino framework
Stars: ✭ 80 (+48.15%)
Mutual labels:  esp32, esp-idf
micropython-i2s-examples
Examples for I2S support on microcontrollers that run MicroPython
Stars: ✭ 40 (-25.93%)
Mutual labels:  esp32, i2s
esp32-i2s-mems
Using an I2S MEMS microphone on an ESP32
Stars: ✭ 103 (+90.74%)
Mutual labels:  esp32, i2s
Arduino Esp32
Arduino core for the ESP32
Stars: ✭ 7,741 (+14235.19%)
Mutual labels:  esp32, esp-idf
MQTT VPN
IP over MQTT for ESP controllers and Linux
Stars: ✭ 95 (+75.93%)
Mutual labels:  esp32, esp-idf
lis3dh-esp-idf
LIS3DH driver for ESP-IDF (ESP32)
Stars: ✭ 27 (-50%)
Mutual labels:  esp32, esp-idf
esp32-epaper-display
Server and software to use an ESP32 as a connected display
Stars: ✭ 73 (+35.19%)
Mutual labels:  esp32, esp-idf
esp-idf-parallel-tft
8bit parallel TFT & 4-line resistance touch screen Driver for esp-idf using i2s paralell mode
Stars: ✭ 45 (-16.67%)
Mutual labels:  esp32, esp-idf
esp-idf-w25q64
SPI Flash Memory W25Q64 Access Library for esp-idf
Stars: ✭ 12 (-77.78%)
Mutual labels:  esp32, esp-idf
esp32-e-paper-weatherdisplay
An ESP32 and 4.2" ePaper Display reads Dark Sky weather API and displays the weather using ESP-IDF
Stars: ✭ 110 (+103.7%)
Mutual labels:  esp32, esp-idf
esp-idf-json
Example of JSON Serialize and Deserialize in ESP-IDF
Stars: ✭ 29 (-46.3%)
Mutual labels:  esp32, esp-idf
esp32-ota
ESP32 OTA based on ThingsBoard Open-source IoT Platform
Stars: ✭ 45 (-16.67%)
Mutual labels:  esp32, esp-idf
esp-idf-hal
embedded-hal implementation for Rust on ESP32 and ESP-IDF
Stars: ✭ 42 (-22.22%)
Mutual labels:  esp32, esp-idf
opcua-esp32
Embedded OPC UA Server on ESP32 based on open62541 stack
Stars: ✭ 82 (+51.85%)
Mutual labels:  esp32, esp-idf
esp32-ds18b20
ESP32-compatible C library for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.
Stars: ✭ 61 (+12.96%)
Mutual labels:  esp32, esp-idf
esp-idf-vscode-boilerplate
Boilerplate for developing ESP-IDF applications using VS Code
Stars: ✭ 26 (-51.85%)
Mutual labels:  esp32, esp-idf
ESP32-USB-Soft-Host
An Arduino wrapper to @sdima1357's usb_soft_host esp-idf example
Stars: ✭ 119 (+120.37%)
Mutual labels:  esp32, esp-idf
gfx demo
GFX Demo for Arduino and the ESP-IDF
Stars: ✭ 63 (+16.67%)
Mutual labels:  esp32, esp-idf

ESP32-LCD-I2S

This is an esp-idf project that demonstrates use of the Espressif ESP32 I2S peripheral to drive a controller-less 240 x 160 monochrome lcd with 4bit data, clock, hsync and vsync, without using cpu cycles.

Built on Ubuntu 16.04LTS amdx64 platform with esp-idf commit 84788230392d0918d3add78d9ccf8c2bb7de3152, 2018 March 21.

Notes

The LCD has internal memory only for one line of pixels. It requires 4 1-bit horizontal pixels per clock, a horizontal sync pulse (HS) to latch a line of pixels, a one line wide vertical sync pulse (VS) per frame, and a frame toggle signal (FR) that alternates level every frame.

To determine the required signalling on the bus interface, a logic analyzer was used to capture the bus signals with the LCD being driven by a PIC24FJ256DA206 microcontroller with built-in graphics controller (i.e. known working interface). Some screen captures of the bus signals are in the /docs directory.

We use the I2S peripheral in parallel LCD mode with 8-bit bus width. The physical data bus is actually 6bits wide, and encodes 4bits of monochrome pixels plus the HS and VS signals. The I2S peripheral also generates the pixel clock.

External hardware generates the FR signal from the VS signal. We use an edge-triggered D latch (74LVC1G80) with feedback from the Q' output to the D input. The VS signal is connected to the clock pulse input of the latch, and the FR signal is taken from the Q' output.

The software driver has a double-buffered frame option ((#define DOUBLE_BUFFERED in config.h). If enabled we double-buffer a frame of pixels in ESP32 RAM (display and draw frame buffers). The I2S peripheral continuously reads out the display frame buffer without CPU intervention. The application software updates the draw frame buffer, and can swap this with the display buffer at any time. On receiving the buffer swap signal, the driver will continue readout from the display buffer until the end of frame and then swap the display and draw buffers. This avoids visible artifacts from slow drawing. There are two demo videos in the /docs directory - one using single buffer (draw and display from one buffer), and one with double-buffering. You will see the benefit of double-buffering with the 3D graphics animation - it does not have any flickering or ghosting artifacts.

The ESP32 I2S peripheral has a 32bit internal bus. Unfortunately, in 8bit mode, bytes have to be sent to the peripheral in the order 2,3,0,1 so that they appear at the external I2S bus interface in the order 0,1,2,3. So this has to be taken into account when drawing into the frame buffer and encoding the HS and VS signals.

Another issue is that (as seen in the logic analyzer screen captures of the known working interface) the LCD expects a short (< 1/2 clock period) +ve HS pulse along with the last 4bit packet for the line, and latches the line on the HS pulse falling edge. But the I2S parallel bus encoded HS pulse is 1 clock wide, synchronous to the clock edge. The LCD ignores the data in all packets with HS = 1 through the full clock period, and latches the previous buffered data packets when HS returns to 0. So the workaround is to generate 4 additional dummy packets with HS encoded as 1, after transmitting a full row of pixels with HS=0. The reason for sending not just one, but four additional I2S packets = 4 bytes = 32bits is because we need to be in I2S peripheral byte order sync for the next row.

Credits

3D graphics code from https://github.com/cnlohr/channel3 modified for our purpose.

Sample I2S parallel code and specific information on the 8bit mode from postings by Espressif contributor ESP_Sprite in these threads on the ESP32 forum :

https://www.esp32.com/viewtopic.php?f=17&t=3188

https://www.esp32.com/viewtopic.php?f=13&t=3256.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].