PDA

View Full Version : Simple Serial communications



kitcat
- 18th July 2005, 18:19
HI there.
I am working on a project where I need to send very simple serial data to a pic16f872. I am basically sending two bytes of data which has to be latched on two of the pic's ports. I think this is simple enough but I really want to acknowlege the data back to make sure it is correct. I am using a PC with software I am writing in VB. I am wondering if I could waggle/poll the dts/rts lines to control the communication. If so how do I hook them up to the PIC without damaging it?
Has anybody got any samples or hints.
Thanks

BobK
- 18th July 2005, 18:38
Hi Kitcat:

Since you are writing your own VB code for the PC why not have the PIC pause 100 after receiving the 2 bytes then send them right back to the PC and have the VB program acknowledge the data was sent correctly? All that dts & rts lines are for is handshaking back and forth.

BobK

kitcat
- 18th July 2005, 19:02
Yes. Hmmmn. It really is that simple isn't it. I think that was lurking in my head but it seemed too easy.
Thanks for that.

Melanie
- 18th July 2005, 19:42
Check this Thread as an example for PC to PIC and echoing back to PC.

http://www.picbasic.co.uk/forum/showthread.php?t=573