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.

RS232 interfacing with PC

Status
Not open for further replies.

Sathiesh Kumar

New Member
Hi,
i am interfacing 16f877 microcontroller with PC... the compiler which i use was MikroC... Clock frequency is 20 MHz... Programming language is C....
I can able to send the data from microcontroller to PC... the message is perfectly received in PC...But when i send some data from PC to microcontroller some characters gets displayed with additional terms... few characters didnt get displayed in LCD...
Eg: i am sending a data "z" from PC to Microcontroller and display it in LCD...in addition to z some others symbols also displayed in LCD...

What might be the problem...

Help me...

Sathiesh Kumar.V
 
A modular approach would have been better.Check your LCD program first.Secondly debug by resending the character sent from the PC to the uc back to the PC(create a loop) to see whether the microcontroller is receiving data properly or alternately you could use some LED's to display the sent data.
 
You haven't given us any information about how you're actually interfacing the microcontroller to the RS232 port, are you using a MAX232 IC or something similar? We can't guess if you don't provide schematics of how you actually have things hooked up.
 
heh are you checking for end? Can you post the code... for displaying the char on LCD..

Is it a 2x16 type LCD ? (character)

It sounds like you are getting the data ok but when telling the PIC to send it to the LCD you are sending more then you have or just having a overrun issue...

Just post your code for receiving the byte then writing to lcd and i should be able to figure it out
 
Last edited:
Thanks to all...
i got the output for interfacing RS232 with microcontroller... but i cant able to see the information in LCD.... i have no problem with PC communication with microcontroller ....
 
Make sure you initialise LCD properly. When the LCD has power applied to it, its memory contains garbage. When you use a write command to write something to the LCD, you maybe writing some of this garbage along with your intended transmission. Clear the LCD memory (the part you will write to and display) so that it is = 0. Then you can write on a clean screen. You may want to just clear the part of memory that would display one full screen on the LCD instead of clearing the entire LCD memory as this would save time for the microcontroller and reduce lag. this would mostly come into effect on a graphics LCD which has a big memory.

hope this helps
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top