These character LCD modules usually have a standard 14 pin interface, commonly using pins with 0.1 inch between centres. If the module has an LED backlight, there are usually extra pins 15 and 16 to power the LEDs. The pinout is as follows:
1. Ground 2. Vcc +3.3V to +5V 3. Contrast Adjustment 4. Register Select (RS) 0 for a command, 1 for data 5. Read/Write (R/W) 0 for Write, 1 for Read 6. Clock (Enable) Falling edge initiates transfer of data 7. Data Bit 0 (not used in 4-bit mode) 8. Data Bit 1 (not used in 4-bit mode) 9. Data Bit 2 (not used in 4-bit mode) 10. Data Bit 3 (not used in 4-bit mode) 11. Data Bit 4 12. Data Bit 5 13. Data Bit 6 14. Data Bit 7 15. Backlight Anode (+) 16. Backlight Cathode (-)
Some older modules have a double row of 7 pins at one end of the module. You can use a 14 way ribbon cable and 14 pin IDC connector to connect up the module. More usually, there is a 14 or 16 pin single pin row, either above or below (sometimes both!) the display.
The 44780 controller takes time to execute various instructions, or to action interface changes. While it is busy it keeps the BUSY flag high, so polling this will tell you when the command has finished or when the next character can be sent. Alternatively, simply wait at least the time the datasheet quotes for various functions:
Enable cycle time 500ns min Enable pulse width, high 230ns min Enable rise and decay time 20ns max Address setup time 40ns min RS and R/W lines must be valid 40ns before enable pulse arrives Address hold time 10ns min RS and R/W must be valid at least 10 ns after enable goes low Data delay time 160ns max On read data valid within 320ns of enable going high Data hold time, read 5ns min On read data valid at least 20ns after enable goes low Data setup time 195ns min On write data lines must be valid at least 195 ns before enable goes low Data hold time, write 10ns min On write data lines must be valid for at least 10ns after enable goes low
In 8 bit mode each byte on data or command is transferred in one cycle of the enable pin.
In 4 bit mode each byte is sent as 2 by 4 bit nibbles on data pins 4 - 7. The first 4 bit nibble is the high order 4 bits of the byte, and the second 4 bit nibble is the low order 4 bits. While this is obviously slower, it needs less controller pins - useful when the controlling device pin usage is getting tight.
Jim Jackson <jj@franjam.org.uk> Wed Dec 30 20:22 GMT 2015
This document was generated using AFT v5.095