Hi,
Just a quick question.
If i wish to send 16 bits of data can i extract 1 bit like this?
datapin = temp[loop]
where temp is the word to send, and loop is a for next loop from 0 to 15
and receive in a similar way
temp[loop] = datapin
Printable View
Hi,
Just a quick question.
If i wish to send 16 bits of data can i extract 1 bit like this?
datapin = temp[loop]
where temp is the word to send, and loop is a for next loop from 0 to 15
and receive in a similar way
temp[loop] = datapin
Bits, Bytes Words and Arrays (melanie)
http://www.picbasic.co.uk/forum/showthread.php?t=544
<br>
Thanks for the info Darrel, some very interesting stuff there. Still cant get it to work but I'll keep on trying.
You may also want to look at the SHIFTIN and SHIFTOUT commands.
<br>
Oops, I see in your other thread you've already tried SHIFTIN/OUT.
Something like this might be a start...This way is "Driven" on both ends. Be sure to have a resistor (1K is good) in the Data line between the 2 PICs.Code:; -- Master Transmit --
For loop = 0 to 15
datapin = temp.0[loop]
clkpin = 1
PauseUS 100
clkpin = 0
Next loop
; -- Master Receive --
For loop = 0 to 15
clkpin = 1
PauseUS 100
datapin = temp.0[loop]
clkpin = 0
Next loop
;________________________
; -- Slave Transmit --
For loop = 0 to 15
while clkpin = 0 : wend
datapin = temp.0[loop]
while clkpin = 1 : wend
Next loop
; -- Slave Receive --
For loop = 0 to 15
while clkpin = 0 : wend
temp.0[loop] = datapin
while clkpin = 1 : wend
Next loop
<br>