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.

serial communication in mikro c with pic16f877a

Status
Not open for further replies.

aameer

Full Member level 4
Joined
May 12, 2010
Messages
216
Helped
33
Reputation
64
Reaction score
32
Trophy points
1,308
Location
Bangalore
Activity points
2,503
Hello friends
i am trying to communicate a character from PC to micro controller(Pic16f877a)
But i am able to send from micro controller to PC but able to receive and display on LCD .
Please help me.Its Urgent...
I checked Max 232 and cable .they are absolutely fine.

Code:
void main()
{
unsigned short i;
TRISB = 0; // PORTB is output
Lcd_Init(&PORTB); // Initialize LCD connected to PORTB
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
Lcd_Out(1, 1, "HI"); // Print text to LCD, 2nd row, 1st column
Usart_Init(9600);
Delay_ms(100);
Usart_Write('p');
Delay_ms(100);
do
{
if (Usart_Data_Ready()) // If data is received
{
i = Usart_Read(); // Read the received data
Usart_Write(i); // Send data via USART
Lcd_Chr(2,1,i+48);
}
} while (1);


}



with Regards
Aameer

- - - Updated - - -

Guys suggest me what is the problem.. Its urgent
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top