BlankHave you written to the LCD by itself, without getting data from the RS232 line? I had similar problems (wrong characters showing up) and they were caused by faulty wiring between the PIC and the LCD, so when I thought it was getting data it really was not on one line. If you are already seeing things the PIC writes to the LCD on its own, then I guess the hardware is fine. Andy ----- Original Message ----- From: To: PICLIST@MITVMA.MIT.EDU Sent: Sunday, October 28, 2001 5:04 AM Subject: [PIC:] Need help with USART on PIC16F628 Hi, I need to implement communication from a terminal window, to the PIC using it's USART function, and then writing the values out on a LCD, via a MAX232 IC. I can communicate with moderate stability, the problem however is: when I enter j on the terminal, it display's U on the LCD, the only character that display's correctly is f, some of the others even displays characters that doesn't exist in the ASCII table. I have replaced the MAX232 IC with other makes, still the same problem, I have also checked all the hardware, no problem there.... Here is a piece of my code, please help As you will see, I need to txmit aswell, but I've taken that out for now... Adriaan usetp bcf 03,06 bsf 03,05 ;bank1 movlw d'25' ;set SPBRG to 9600 movwf 19h bsf 18,02 ;BRGH = High Speed bsf 18,05 ;TXEN bcf 18,04 ;Async mode bcf 18,06 ;8 bits bcf 03,05 ;bank0 bsf 18,07 ;enable serial port bsf 03,05 ;bank1 bsf 18,07 ;Internal clock bcf 03,05 ;bank0 bcf 18,06 ;8 bits bsf 18,04 ;enable RX return ;---Receive Routine------------------------------------------------------- rxdat movf 1A,0 movwf readtmp return ;---Transmit Routine------------------------------------------------------ ;txdat ; movwf 19h ; return ;---Initial main Routine (setup of LCD for USART characters)-------------- main call usetp bcf lcdprt,lcdcmd movlw b'00000111' ;increment movwf 06 ;display shift on movwf lcdr call pulse swapf lcdr,0 movwf 06 call pulse movlw b'00011000' ;display shift on movwf lcdr ;left shift movwf 06 call pulse swapf lcdr,0 movwf 06 call pulse movlw b'11001111' ;display address movwf lcdr movwf 06 call pulse swapf lcdr,0 movwf 06 call pulse bsf lcdprt,lcdcmd ;---Secondary main Routine (RX and writing on LCD of USART values)-------- main2 btfss 0C,05 goto main2 call rxdat movf readtmp,0 movwf lcdr movwf 06 call pulse swapf lcdr,0 ;swap nibbles movwf 06 call pulse ;write second nibble bcf 0C,05 ;clear RX flag ; movf readtmp,0 ;---Tertiary main Routine (Continued from above, and TX)------------------ ;main3 ; btfss 0C,04 ; goto main3 ; call txdat goto main2 end _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu