noq23
Newbie level 1
Hi, guys. I have problems regarding sending data to LCD through RS232. But I don't know whether my code is correct. I can't make it work with my code. I'm using a mikroC compiler. When I run it, the lcd did not successfully recevied the data.
My program:
char *i = "NNNNN" ;
void main() {
TRISB = 0x00;
Lcd_Init(&PORTB);
Lcd_Cmd(Lcd_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
// Initialize USART module (8 bit, 2400 baud rate, no parity bit..)
Usart_Init(2400);
while(1) {
if (Usart_Data_Ready()) { // If data is received
i = Usart_Read(); // Read the received data
Usart_Write(i); // Send data via USART
Lcd_Out(1,1, i);
}
}
}//~!
somebody please help me..
My program:
char *i = "NNNNN" ;
void main() {
TRISB = 0x00;
Lcd_Init(&PORTB);
Lcd_Cmd(Lcd_CLEAR);
Lcd_Cmd(Lcd_CURSOR_OFF);
// Initialize USART module (8 bit, 2400 baud rate, no parity bit..)
Usart_Init(2400);
while(1) {
if (Usart_Data_Ready()) { // If data is received
i = Usart_Read(); // Read the received data
Usart_Write(i); // Send data via USART
Lcd_Out(1,1, i);
}
}
}//~!
somebody please help me..