Hi J,
These compile and program ok, but produce zero.
I had to add AZILB AZIHB because as you pointed out, it doesn't accept SPISEND = 1.
I'll try variations tomorrow.
MASTER:
_____________________________________________________________________
Dim azi As Word
Dim azilb As Byte
Dim azihb As Byte
main: '\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
rled = 1
WaitMs 1000
rled = 0
WaitMs 1000
'READ DATA from AZIMUTH (4431)
WaitMs 1000
SPISend azilb
WaitMs 100
SPIReceive azi.LB
WaitMs 100
SPISend azihb
WaitMs 100
SPIReceive azi.HB
Hserout "AZI.LB=", #azi.LB, " ", "AZI.HB=", #azi.HB, CrLf
Goto main '<<<<<<<<<<<<<<<<<<<<REMOVE<<<<<<<<<<<<<<<<<<<<
__________________________________________________________________________________
SLAVE:
Dim azi As Word
Dim azilb As Byte
Dim azihb As Byte
azilb = 1
azihb = 2
get_count:
azi.LB = 0 'azi.LB =...Not sure what goes here
azi.HB = 0 'azi.HB =...
While SSPBUF = 0
Wend
If SSPBUF = azilb Then
SSPBUF = azi.LB
Else
If SSPBUF = azihb Then
SSPBUF = azi.HB
Endif
Endif
WaitMs 100
Hserout "AZILB=", #azi.LB, " ", "AZIHB=", #azi.HB, CrLf
Goto get_count