Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sending Data to Lcd using UART

Status
Not open for further replies.

noq23

New Member
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..:(
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top