But when I run it the USART is working as I get the char returned fine but the LCD just fills up with gibberish.
Have I done something very silly or is there something on the easyPIC I should have set up?
Code: Select all
program Serial_LCD
dim i as byte
main:
Usart_init(9600) ' initalize USART (9600 baud rate, 1 stop bit, ...
Lcd_Init(PORTB) ' initialize LCD connected to portb
lcd_cmd(LCD_CLEAR) ' send command to LCD "clear display"
lcd_cmd(LCD_CURSOR_OFF) ' send command cursor off
while true
if USART_data_ready <> 0 then ' if data is received
i = USART_read() ' read the received data
Lcd_Out_CP(i) ' print on LCD
Usart_write(i) ' send data via USART
end if
wend
end.