Help with LCD code
I'm new to this forum, but I would like to receive some help on a project I'm working on right now. Basically, it involves a microcontroller and an LCD (8 bit interface). The LCD is connected to Port A of the controller (PA0-PA7).
Basically I would like to know how to output to Port A in order to initialize the LCD and have it display characters. I understand that there are lots of resources on this already, but I would like to learn the whole programming aspect of it, as well the controller I'm using is not the typical pic16 or pic18 microcontroller.
I would like to thank you for any help ahead of time.
The commands depend on the LCD. Basically what you are going to want to do is set up the command register first and then load the data register. For example if PortA was at 0x392 then you could do this
This is assuming that 91H sets all the command register for say 2x20 line lcd screen, set's the curser to blink and set it at the beginning of the first line.
mov dx, 392H
mov ax, 91H
out dx, ax
Then say your data register was at 393H. You could send data out the same way. So put that in an _ASM directive and use an unsigned char to hold the ascii text [You said 8-bit interface] to transfer the data.
Other than that could you give the model number of the lcd?
Well you could start by saying which "microcontroller" and which "lcd" module you have.
We're not psychics you know!
Welcome to the forum Dara,
Do you have a compiler for this particular microcontroller?
There is no standard C++ way to write to an I/O port. The C++ compiler for that chip will have its own custom I/0 library. In the unlikely event that you have a compiler for the "system", then cout will write characters to the display. But even then, you'll probably want to more control than just writing characters on the display.
You'll have to consult the LCD's data sheet to learn how to talk to it.
The hardware & software tasks are similar. You have to learn how each part works, then figure-out how to make them work together. Of course, this sometimes involves adding some additional custom hardware, or writing a custom software library.
The LCD controller is a ST70066U, but the spec sheet says that the pin function is compatible with the HD44780, KS0066 and SED1278 controllers.
The microcontroller that I am using is the atmel at43usb355 chip.
The compiler for this microcontroller is the WinAVR or IAR embedded workbench. I have both of these downloaded as of right now, but the IAR is on a trial period of about 27 more days.
Thank you all for your help.