|
|
View previous topic :: View next topic |
Author |
Message |
roo
Joined: 17 Oct 2005 Posts: 1
|
Please help: pic18f458 can't talk to LCD (Matrix Orbital) |
Posted: Mon Oct 17, 2005 3:55 pm |
|
|
Hi guys,
I am a newbie, so please bear with me.
I am trying to connect PIC18F458 to the Matrix Orbital LCD2041 (rev.1.5).
I used the code below and it didn't work: the LCD keeps displaying a bunch of meaningless characters.
Then I found out since I only have the bare PIC, I can't directly use
RS232. I read in LCD 2041 manual that the LCD can be talked to in TTL
directly by "closing" 3 gaps above the "TTL" mark above the
RS232 connection.
So, i soldered those 3 gaps and tried the same code again.
Still the same meaningless characters!
So, please advise how to talk in TTL to the LCD.
Also, it'd be greatly appreciated if you guys could tell me how to
use I2C or convert TTL to RS232 to talk to the LCD.
Thanks a lot
(I used a piece of wire to connect pin C6 to the LCD's SDA or pin 3
of the LCD's RS232 port)
Code:
#include <18F458.h>
#fuses EC,NOWDT,NOPROTECT, PUT, BROWNOUT, NOLVP
#use delay (clock=1000000)
#use rs232(baud=2400, xmit=PIN_C6, rcv = PIN_C7)
void main() {
while(TRUE){
printf("Hello");
}
} |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Mon Oct 17, 2005 4:30 pm |
|
|
On the other site they told you the defaults baud rate is 19200 so I would recommend the defaults for everything while you are trying to get it working.
In addition to use the Hardware UART you will ned some type of inversion in the serial ouput to the LCD like the MAX232 or, if you are using a TTL connection a 7404 hex inverter chip should work.
Your other option is to use the software UART and the INVERT keyword in the USE RS232 definition. If you wish to use the software UART simply the FORCE_SW keyword like so:
#use rs232(baud=19200, xmit=PIN_C6, rcv = PIN_C7, FORCE_SW, INVERT) |
|
|
roo
Joined: 17 Oct 2005 Posts: 1
|
|
Posted: Tue Oct 18, 2005 12:25 am |
|
|
You're right, it's finally working at 4Mhz, 19200 using UART !!!
Thanks a lot!!!
dyeatman wrote: | On the other site they told you the defaults baud rate is 19200 so I would recommend the defaults for everything while you are trying to get it working.
In addition to use the Hardware UART you will ned some type of inversion in the serial ouput to the LCD like the MAX232 or, if you are using a TTL connection a 7404 hex inverter chip should work.
Your other option is to use the software UART and the INVERT keyword in the USE RS232 definition. If you wish to use the software UART simply the FORCE_SW keyword like so:
#use rs232(baud=19200, xmit=PIN_C6, rcv = PIN_C7, FORCE_SW, INVERT) |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|