Interfacing PIC16F84 to HD44780, nibble mode data transfer
Last update: 10.06.2001


The following example, show a possible connection between HD44780 compatible display and PIC16F84 using 7wire mode, 4 data bits and 3command lines. Usual the LCD-RW pin is tied to GND ( only writing to LCD is allowed) but here I was testing a new version of the hd44780.lib by polling the LCD busy flag rather than usual delay based library. R2 it's a contrast reglage for positive VLC display driver. If other LCD display type is available and negative voltage is required, pin3 of R2 potentiometer must be tied to pin6 of IC2.
Just supply schematics with +5V and GND with a a blank PIC and check if you see the patterns of the first row ( for more than 1 row LCD display ) or the first 8 characters from the first row ( for some one row LCD display ). Changing position of R2 cursor will allow to see different contrast patterns for VLC between 0 and +2.5V. If can't see anything, you must apply negative VLC to the LCD by disconnecting pin3 of R2 potentiometer from GND and tied to pin6 of IC2.

Learning more about LCD's display and interfacing by following next link's:
http://www.myke.com/code/2wirepic.asm
http://www.epemag.wimborne.co.uk/resources.htm
http://www.netstra.com.au/~elek

ICSP connector allows in circuit programmer feature and also supplying with +5V ( SV2 pin1) and GND (SV2 pin5). D1 it's a protective diode for reverse or greater than 5V supply voltage. S1 it's the reset switch.

Serial connection is solved using IC2, a MAX3232 3V logic to 232 line converter with positive and negative charge pump, +8V and -5.5V are available also for user ( less than 3 mA ) at pin2 respectively pin6 of IC2. Decoupling capacitors near the IC1 chip (C3) and lcd chip (C8) are required. Both 25 and 9 pin PC conector interface are shown
( x1 and x2 connectors are wired for direct plugging into PC )
The user have access to the following PIC pins:
- RB0...RB5 by disable communication with LCD ( RB7 tied to high )
- RB6, note that using RB6 , RB7 as outputs must be done through a high impedance to keep functional the ICSP feature
- RA2...RA4 not used in the example

The power supply is not shown here, however designing a +5V three terminal power supply using 7805 is not difficult, if the minimum ( +9V ,base of the ripple voltage) rectified and filtered, requested voltage has been obtained.

The extra JAL distribution, mini-software set for checking the hardware above is:
f84lcd.jal - first testing program
f84lcd1.jal - secondary testing program
jseriala.jal - serial routine, 19200bps,8,n,1
max232p.jal - pin connection for serial interface and LCD display
hd44780m.jal - modified version for more than one line and different lcd types, replace hd44780.jal from jal distribution with this one if you've play with 4 lines LCDs.

Test serial communication ,using terminal emulator under win95, win98 or any other terminal program under dos, using none or hardware flow control.

back to pic page


page address: http://www.oocities.org/vsurducan/electro/pic/f84lcd.html
mail address: vasile@l30.itim-cj.ro
last update: 10.06.2001