4 Bit Interface using CFAH2004A-TMI-JP

ese_student

New member
I have been having problems getting my display to initialize. It appears that a cursor does blink in the top left most corner of the screen, but when I change the initialization so that blinking is off, the cursor still appears and is blinking.

When I also try to display characters to the LCD display, I find that I only get square boxes appearing, or character $FF.

I 'am using the HC11 E1 microcontroller, where I use PORTA pins 7 - 4 for my data lines and use PORTD pins 5,4,3 for my control lines E, R/W, RS.

I note that PORTA pin 7 is bidirectional whereas the other data pins are only outputs. Port D pins are bidirectional and have been set for outputs only.

I'am able to control if PORTA pin 7 is either an input or an output.

Though I was told doing this may actually have damaged my LCD display if I have left the other data lines as output??

I have tried both methods of initializing the LCD display through the use of time delays without setting the PORTA bit 7 pin for input keeping it as an output, and by reading the busy flag method by changing the PORTA bit 7 for either input or output.

Does anyone know if changing an individual data pin for input/output while leaving other data pins as output can actually damage the LCD display?

In my software I have checked many times that I have toggled the E, R/W and RS control lines correctly placing delays in many places. I send a high nibble first followed by a short delay and then send the lower nibble by doing bit shifting.

One question regarding the software is how the 8bit interface differs from the 4bit interface in the beginning of initialization. Where in the 8bit you send $30, in the 4bit you send only $3, do I have to send this in nibbles? Currently I only send $3 and have tried both ways with no results.

I have code availible to anyone who wishes to view it.

Thank you.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

polo

New member
Well, seems I have about the same problem with a mdl(s)-D16465 unit. Regarding your other questions:

- At the beginning of lcd intialisation, the four lower bits of $30 are in fact "not cares", so you don't send anything in 4 bit mode (just $3 once). You start sending two nibbles after sending $2 to swich to 4 bits mode.

- Grounding d0-d3 is a good idea (I did it! :eek:) but it's best done through pull-down resistors. Otherwise, as those bits are used to send data during a read (even if you care only about the BUSY flag), you might short one of those lines to ground. If you don't plan on using the BUSY flag you can just ground them.

This being said, I have the same display problem; I have observed the following:
- I can swich off the blinking
- I can't move the cursor (set DDRAM address seems not to work)
- I've sent sequences of data through a loop with the lower 4 bits going from 0 to 15. The same sequence of garbage appears whatever the higher 4 bits of the bytes. The sequence even looks like twice the same 8 char sequence.

It looks to me like only the three lower bits are taken into account, although I can't begin to imagine why.

I think I'll try to see if it's the 8 lower chars of the CGRAM which are displayed, and maybe try a new LCD module.

Any help would be very welcome, I just hate it when things don't work for no reason...
 
Top