Having trouble initializing CFAH1602W-RTI-JP LCD

racerj2237

New member
I have my lcd screen connected to a motorola M68MOD912C32 microcontroller (plenty of I/O pins... 11 ports connected from microcontroller to LCD pins).

I power on the system and i can see the LCD backlight come on. I then run through the initialization sequence and dont see any sort of cursor or anything on the screen, just the backlight.

Is there something I'm forgetting here? I wrote a program in C that sets all the pins to the appropriate values and then delays an appropriate amount. What exactly does the Chip Enable signal do? Do I need to synchronize some sort of clock to get this to work?

Any input would be appreciated. I'm a complete noob at interfacing with LCD screens
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
What exactly does the Chip Enable signal do? Do I need to synchronize some sort of clock to get this to work?
Absolutely. The Enable signal is the key to controlling the display. It is the write strobe (and read strobe), and must be taken high, then low, for each data byte sent to the LCD. Look at the timing diagram on page 16 of the data sheet http://www.crystalfontz.com/products/1602w/CFAH1602WRTIJP.pdf

You could also post your init command sequence, to see if it looks OK.
 

racerj2237

New member
Absolutely. The Enable signal is the key to controlling the display. It is the write strobe (and read strobe), and must be taken high, then low, for each data byte sent to the LCD. Look at the timing diagram on page 16 of the data sheet http://www.crystalfontz.com/products/1602w/CFAH1602WRTIJP.pdf

You could also post your init command sequence, to see if it looks OK.
Yeah i was looking at that timing diagram when writing the sequence. The data sheet isnt a whole lot of help for someone who hasnt done this before =P

So essentially I need to turn the enable signal on, change the data registers, then turn the enable signal off for that data to be transmitted (holding all of this data for the appropriate time)?

My init command sequence is on a lab computer so unfortunately I'll have to run back up to the lab to post it.
 
Last edited:
... I need to turn the enable signal on, change the data registers, then turn the enable signal off for that data to be transmitted (holding all of this data for the appropriate time)?
You got it. The data that is on the inputs is 'clocked' into the LCD controller on the falling edge of E.

Also, notice that the "Enable cycle time" is 1.2 uS, so don't write data any more often than that.
 
Last edited:

racerj2237

New member
You got it. The data that is on the inputs is 'clocked' into the LCD controller on the falling edge of E.

Also, notice that the "Enable cycle time" is 1.2 uS, so don't write data any more often than that.
ok, that makes sense. So then do i need to generate some sort of specific clock signal going to E? Or can i just let E sit idle until I want to change register data?

also... one more question:
it says that the maximum range for the supply voltage to the LCD is Vdd-V0... where min: Vdd-13.5 and max: 0v. So by this assumption the values of V0 need to fall between 13.5 and 5. Does this mean that my supply voltage to the LCD needs to be negative?

The reason this is confusing me is that because in the Electrical Characteristics section, the supply voltage is typically between 4.5V and 5.5V
 
Last edited:
E can just sit idle (low) when you're not writing anything.

While we're on the topic of noticing things in the data sheet, take a look at page 15 to see that each type of command/data write takes a certain amount of time to execute. In order not to write to the LCD while it is busy, you need to either 1) delay after each command/data, for the length in the table, or 2) test the busy flag to see when the controller is ready for the next write. Have you taken this requirement into account?

The exception is during the initialization sequence, before the mode is set, the busy flag cannot be tested, so the delays shown in the charts on pg 19 & 20 must be used. Are you using 8 bit or 4 bit mode?

Testing the busy flag is the most efficient way to control write timing. If you don't know how that is done, I can give you some pseudocode.

As for the LCD voltage, yes, it could be negative, but notice that Vdd-13.5 is the absolute min. It is referenced to the Vdd, so that would be -8.5v. But in most cases, Vo can be around +1v to 0v.
 
Last edited:

racerj2237

New member
E can just sit idle (low) when you're not writing anything.

While we're on the topic of noticing things in the data sheet, take a look at page 15 to see that each type of command/data write takes a certain amount of time to execute. In order not to write to the LCD while it is busy, you need to either 1) delay after each command/data, for the length in the table, or 2) test the busy flag to see when the controller is ready for the next write. Have you taken this requirement into account?

The exception is during the initialization sequence, before the mode is set, the busy flag cannot be tested, so the delays shown in the charts on pg 19 & 20 must be used. Are you using 8 bit or 4 bit mode?

Testing the busy flag is the most efficient way to control write timing. If you don't know how that is done, I can give you some pseudocode.
Right now I'm just trying to get things to display. Once I do that, I'll probably write some function that writes data into the registers that checks the busy flag to see whenever its ready to be written to

i'm assuming that 4-bit mode = only using DB7-DB3 and 8-bit mode = using DB7-DB0?
 

racerj2237

New member
Ok, but if you don't obey these timing rules, you won't get anything to display. You are correct about the data bits. I recommend 8 bit mode, to simplify the write routine.
Yeah... I understand the timing rules and all that. I guess my point was that I'll write the timing delays and all that for the registers once I get through the initialization routine.

Back to the Vdd-V0 voltage level... I'm all sorts of confused now. V0 is simply the value of the voltage drop caused by a potentiometer (Vr) between Vdd and V0. Since the typical value of Vdd-V0 is 5 volts, could i just connect V0 straight to ground (with some sort of resistance between Vdd and V0 so that Vdd-V0 = 5v)?

i appreciate all the help :cool:
 
Last edited:
V0 is simply the value of the voltage drop caused by a potentiometer (Vr) between Vdd and V0. Since the typical value of Vdd-V0 is 5 volts, could i just connect V0 straight to ground (with some sort of resistance between Vdd and V0 so that Vdd-V0 = 5v)?
Sort of. The pot goes between 5v and ground, the wiper goes to Vo. You could connect Vo to ground, without resistors; that would give you a Vo of 0v. Trouble is, that's probably not the desired setting. You need the pot for adjustability, as the voltage for best contrast will vary from display to display, and at different temperatures. The best contrast typically occurs with Vo somewhere in the vicinity of +1v (Vdd-Vo = 4v).
I'll write the timing delays and all that for the registers once I get through the initialization routine.
If you don't include the delays within the init routine, then it probably won't initialize successfully.
 

CF Tech

Administrator
. . . my point was that I'll write the timing delays and all that for the registers once I get through the initialization routine . . .
The initialization is touchy. You will not "get through the initialization" without at least the minimum delays.

You can just use long delays everywhere in the initialization (100mS).

For the write routine, you basically want to set all your data lines, RS and R/W, then toggle E high (wait a little bit like cosmic said) then low again.

Is the M68MOD912C32 anything like a 'HC12?

http://www.google.com/search?q=hc12+LCD+routine
 

racerj2237

New member
The initialization is touchy. You will not "get through the initialization" without at least the minimum delays.

You can just use long delays everywhere in the initialization (100mS).

For the write routine, you basically want to set all your data lines, RS and R/W, then toggle E high (wait a little bit like cosmic said) then low again.

Is the M68MOD912C32 anything like a 'HC12?

http://www.google.com/search?q=hc12+LCD+routine
Yeah the point was that I'm just going to hard code some long delays for the initialization, then worry about streamlining the delays once i start coding the rest of my functions that write stuff to the LCD

And yes, i believe the 'C32 is in the same family as the 'HC12. I'll have to take a look at some of those google links once I get past this initialization

Again, I appreciate all of the help you guys have given me. Thanks a bunch... I'm gonna try a few of these things out in a little while to see if I can get through the initialization routine. I'll let ya know the results
 

racerj2237

New member
Yeah the point was that I'm just going to hard code some long delays for the initialization, then worry about streamlining the delays once i start coding the rest of my functions that write stuff to the LCD

And yes, i believe the 'C32 is in the same family as the 'HC12. I'll have to take a look at some of those google links once I get past this initialization

Again, I appreciate all of the help you guys have given me. Thanks a bunch... I'm gonna try a few of these things out in a little while to see if I can get through the initialization routine. I'll let ya know the results
Ok guys... the problem was that I needed to change the Vdd-V0 values. Did that and it's working now :cool: . I've written a bunch of functions to move the cursor around, change the blinking of the cursor, and a bunch of the other IR commands.

Now i'm having trouble deciphering how I actually write characters to the display. The instruction manual again leaves a little bit to be desired. Any clues as to how to go about writing characters to the display? I'm mainly wanting to use characters from the CGROM and not have to create my own custom characters. I know that I have to set the DDRAM address to where on the LCD i want it to display, but how to I actually display a character there?
 
Writing characters is much the same as sending commands, EXCEPT that RS is high for data (low for command). So to write characters at the cursor location, RW=0, RS=1, DB0~7 has character data, then strobe the E pin. Just like it shows at the bottom of page 15 of the data sheet :rolleyes: .
 
Top