Some further clarification of the method for positioning characters on a 1 line x 16 character display is in order. The Hitachi data book is a bit cryptic and does not tell you everything you need to know as you may have discovered. For the Hitachi LM020L 1 line x 16 character display, the display data (DD) RAM addresses for the left and right halves of the display are not contiguous.

Character Number    1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
DD RAM Address     00 01 02 03 04 05 06 07 40 41 42 43 44 45 46 47
The DD RAM addresses shown above don’t match the 0x80 to 0x87 and then 0xc0 to 0xc7 address commands used in PIC’n Up The Pace, page 66. HMMmmmm?? An explanation follows.

The Hitachi data book shows the following as the command for setting the DD Ram address:

	Starting Address Command
	RS  R/W    7  6  5  4  3  2  1  1
	--  ---    ----------------------
	0   0      1        ADD
ADD is the low 7 bits of the DD RAM address. If you put in the low 7 bits of the first DD RAM address (00):
		1000 0000 = 0x80
If you put in the low 7 bits of the first DD RAM address for the right half of the display (40):
		1100 0000 = 0xc0
The display controller (HD44780) thinks of these “addresses” (0x80 or 0xc0) as starting address commands. Sending the command tells the display controller that the next byte sent will be data to be placed in DD RAM and where to put it. If more data bytes follow, they will be placed in subsequent DD RAM locations.

You have to start somewhere and increment across as characters are transmitted. I use “increment mode, no display shift”.

This information will be helpful in determining how to position characters in displays of other sizes which are controlled by the HD4780. You will need to refer to the data sheet for the specific display you are using.

 ©Square 1 Electronics 1996-2001

| Home | Back to Updates Page | Contact Us