PDA

View Full Version : PIC to PIC communications



droptail
- 8th March 2006, 01:02
I cannot transfer a variable from one PIC to another as:
master: SEROUT B.7,N2400,[w2]
slave: SERIN B.0,N2400,[w2]
It appears that the slave does not wait for any serin (the pic's run in 2 different programs/circuits). How to implement a "wait til receive a serial connection"?

Would it be something like:
SERIN B.0,N2400,100,[w2]
to wait for 100ms?

sougata
- 8th March 2006, 08:13
Hi,

Why not use the serin2 / serout2 with flow control. That should solve your problem. If you are using the Hardware USART then interrupt in another option.

Regards

Sougata

droptail
- 8th March 2006, 16:35
Using (2) PIC16C716's simply w2=100
I was under the impression that the slave would wait (forever in above example) until data (w2) is recieved?
I found this in some thread:
master:
SEROUT2 PortB.7,N2400,100,Main,[Wait "A",w2]
slave:
SERIN2 PortB.0,N2400,100,Main,[Wait "A",w2]

Does this wait 100ms and if no transfer go to Main subr?
Will this transfer var contents of w2? There is something about Wait "A" I've seen. Can you give example?