Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! 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

Newbie level 1
Joined
May 25, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
cck
Activity points
1,294
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..:(
 

actually i have the same problem so if somebody knows how to fix it plz help
 
  • Like
Reactions: wasio

    wasio

    Points: 2
    Helpful Answer Positive Rating
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..:(

i think if u write Lcd_chr(1,1,i) instead of Lcd_Out(1,1, i);
and check for 9600 baud rate once;
 
  • Like
Reactions: wasio

    wasio

    Points: 2
    Helpful Answer Positive Rating
It sounds that you are reading from USART and not writing .
try this : while(1) { Usart_write(i) ; }
 

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.

I'm have trouble understanding what you are attempting here?

Are you attempting to control and display text from a PC to a PIC with a LCD attached?

Or are you attempting to control and display text from a PIC to a Serial LCD?

IF the latter what is the actual make and model of your serial LCD?

BigDog
 
I'm have trouble understanding what you are attempting here?

Are you attempting to control and display text from a PC to a PIC with a LCD attached?

Or are you attempting to control and display text from a PIC to a Serial LCD?

IF the latter what is the actual make and model of your serial LCD?

BigDog

solve
thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top