The first thing Rob is you're going to have to ask yourself a question... an I going to transfer a single BYTE (as you are implying in your mail), or is it going to be a WORD?

If you are measuring a Pulse with PULSIN, then a BYTE means you can only sample 2.55mS pulses (at 4MHz clock each tick being 10uS). If it's a WORD then 655.35mS, both of which fall short of your 2 second sampling time.

However, let's say your transfer IS a SINGLE BYTE. Nothing could be easier. The sampling (Transmitting) PIC simply puts the answer on a Port.. eg...

PortB=MySample

...and the Receiving PIC just reads in whenever it wants to from it's Port. The only possible problem is that the Receiving PIC just happens to be reading the Port as the Sample is updated by the Transmitting PIC... so a simple handshake cures that potential error like so... (in this case nine lines are required - an extra one for the Handshake)...

Transmitting PIC (assume a 16F628 for arguments sake)...

HandshakePin var PortA.0
DataPort var PortB
SampleData var Byte
. . . .
TRISA.0=1
TRISB=%00000000
CMCON=7 ' turns off comparators
DataPort=0 ' Initially DataPort will be Zero
. . . .
SampleLoop:
Gosub GetSample ' Get a sample
While HandShakePin=0:Wend ' Kill time if updates prohibited
DataPort=SampleData ' Update Data Port
Goto SampleLoop

Here, with the above example, the Transmitting PIC will update the Data Port unless it has been explicitly forbidden to do so by the Receiving PIC.

On the receive Side...

HandshakePin var PortA.0
DataPort var PortB
SampleData var Byte
. . . .
TRISA.0=0
TRISB=%11111111
CMCON=7
HandshakePin=1
. . . .
ReadData:
HandshakePin=0 ' Prohibit Port Updates
PauseUS 100 ' allow for latency
SampleData=DataPort ' Read Port
HandshakePin=1 ' Allow Port Updates

Now what we have here is the Receive PIC prohibiting the Transmit PIC from updating the Port whilst the port read is actually taking place. Now that PauseUS could in theory be removed altogether, but there is an outside chance that the Transmit PIC has just exited it's While/Wend the very moment the Receive PIC sets the HandshakePin to 0. If the PIC's are not in step, or the Receive PIC has a faster clock than the Transmit, you could encounter a scenario that the Receiver is reading the data port, just as the Transmitter is updating it. That small pause will prevent that from happening. By trial and error you could probably reduce the value quite considerably.

Melanie