Saturday, December 10, 2011

LCD interfacing with 8051



For general Purpose most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. LCD module have 8-bit data interface and control pins. One can send data as 8-bit or in pair of two 4-bit nibbles.
Character LCD type HD44580 Pin Diagram
To display any character on LCD micro controller has to send its ASCII value to the data bus of LCD.For e.g. to display 'AB' microcontroller has to send two hex bytes 41h and 42h respectively.LCD display used here is having 16x2 size. It means 2 lines each with 16 character.

 

Interfacing LCD with 4-bit mode 

 



Character LCD pins with 1 Controller
Pin No.NameDescription
Pin no. 1VSSPower supply (GND)
Pin no. 2VCCPower supply (+5V)
Pin no. 3VEEContrast adjust
Pin no. 4RS0 = Instruction input
1 = Data input
Pin no. 5R/W0 = Write to LCD module
1 = Read from LCD module
Pin no. 6ENEnable signal
Pin no. 7D0Data bus line 0 (LSB)
Pin no. 8D1Data bus line 1
Pin no. 9D2Data bus line 2
Pin no. 10D3Data bus line 3
Pin no. 11D4Data bus line 4
Pin no. 12D5Data bus line 5
Pin no. 13D6Data bus line 6
Pin no. 14D7Data bus line 7 (MSB)

Character LCD pins with 2 Controller
Pin No.NameDescription
Pin no. 1D7Data bus line 7 (MSB)
Pin no. 2D6Data bus line 6
Pin no. 3D5Data bus line 5
Pin no. 4D4Data bus line 4
Pin no. 5D3Data bus line 3
Pin no. 6D2Data bus line 2
Pin no. 7D1Data bus line 1
Pin no. 8D0Data bus line 0 (LSB)
Pin no. 9EN1Enable signal for row 0 and 1 (1stcontroller)
Pin no. 10 R/W0 = Write to LCD module
1 = Read from LCD module
Pin no. 11 RS0 = Instruction input
1 = Data input
Pin no. 12 VEEContrast adjust
Pin no. 13 VSSPower supply (GND)
Pin no. 14 VCCPower supply (+5V)
Pin no. 15 EN2Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NCNot Connected


Addresses of cursor position for 16x2 HD44780 LCD

line1  80H  81H  82H  83H  84H  85H  86H  87H  88H  89H  8AH  8BH  8CH  8DH  8EH  8FH 
line2  C0H  C1H  C2H  C3H  C4H  C5H  C6H  C7H  C8H  C9H  CAH  CBH  CCH  CDH  CEH  CFH 

(still updating)

2 comments: