I just bought a CFAH2004A-TMI-JP. I want to use it as part of the final project for my microcontroller interfacing class. I don't have much experience with hardware thats more complicated than simple combinatorial/sequential logic chips, but I learn pretty quickly. I have no trouble writing code for my microcontroller (motorola/freescale 9s12c32), and I can easily interface with pushbuttons and LEDs - I don't need any help putting the circuit together, or getting my microcontroller to send data to the LCD module. What I do want is a little help understanding the basics of the LCD instructions and such. I'm pretty sure I could figure it out on my own for the most part, but I want to make sure I don't do anything stupid and break it.
Looking at the data sheet, it seems pretty simple. I turn everything on and follow the initialization sequence, setting N, F, I/D, and S in the process. From the instruction table, those signals do the following:
N=0 - 1 display line; N=1 - 2 display lines
F=0 - 5x8 dots; F=1 - 5x11 dots
I/D - cursor moving direction
SH - shift of display
I understand generally what these are all supposed to do, but I don't understand exactly how theyre implemented. I have the following problems:
- I assume the display can use either 4 or 2 lines, which value of N corresponds to which of those?
- I thought each character was 5x8 dots, with 1 dot in between each character, how does "5x11" work?
- What exactly gets shifted? does this signal toggle between using lines 1,3 and 2,4?
As far as I can tell, a character is written as follows: set DDRAM address to the desired screen position, then write data to RAM, using falling edge of E to trigger the instructions. Both of these operations take a while, so I'll have to make sure to wait an appropriate amount of time between these two operations. Is any of this right, or near the mark at all?
Why exactly is the DDRAM mapped like it is? 0-13, 40-43, 14-27, 54-67. Why does the second line get skipped, and why is there a jump in the memory between 27 and 40?
Finally, I have a couple questions about the LCD and LED. I see that the LCD should probably take 4-4.5V, should I worry about the current as well? How is the contrast controlled? I assume the LED needs a resistor, probably 10K-20K, is that right?
I guess I wrote a lot more than I meant to. Please have patience, its been a while since I've dealt with some of this stuff, and I've never worked with an LCD before. I'm completely new to this, and I am trying to figure out as much as I can on my own from the data sheet, I just want to be sure not to screw it up. Thanks for any help.
Looking at the data sheet, it seems pretty simple. I turn everything on and follow the initialization sequence, setting N, F, I/D, and S in the process. From the instruction table, those signals do the following:
N=0 - 1 display line; N=1 - 2 display lines
F=0 - 5x8 dots; F=1 - 5x11 dots
I/D - cursor moving direction
SH - shift of display
I understand generally what these are all supposed to do, but I don't understand exactly how theyre implemented. I have the following problems:
- I assume the display can use either 4 or 2 lines, which value of N corresponds to which of those?
- I thought each character was 5x8 dots, with 1 dot in between each character, how does "5x11" work?
- What exactly gets shifted? does this signal toggle between using lines 1,3 and 2,4?
As far as I can tell, a character is written as follows: set DDRAM address to the desired screen position, then write data to RAM, using falling edge of E to trigger the instructions. Both of these operations take a while, so I'll have to make sure to wait an appropriate amount of time between these two operations. Is any of this right, or near the mark at all?
Why exactly is the DDRAM mapped like it is? 0-13, 40-43, 14-27, 54-67. Why does the second line get skipped, and why is there a jump in the memory between 27 and 40?
Finally, I have a couple questions about the LCD and LED. I see that the LCD should probably take 4-4.5V, should I worry about the current as well? How is the contrast controlled? I assume the LED needs a resistor, probably 10K-20K, is that right?
I guess I wrote a lot more than I meant to. Please have patience, its been a while since I've dealt with some of this stuff, and I've never worked with an LCD before. I'm completely new to this, and I am trying to figure out as much as I can on my own from the data sheet, I just want to be sure not to screw it up. Thanks for any help.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.