• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Transfering DATA between two pics via SPI OSHONSOFT

camerart

Active Member
Thread starter #81
Hi J,
Working :):)
There are some patient people here, but a big thanks to JJW.
Camerart

____________________________________________________________________________________
SLAVE:
Dim azi As Word

get_count:

Toggle rled

azi.LB = CAP2BUFL
azi.HB = CAP2BUFH
While SSPBUF = 0
Wend
If SSPBUF = 1 Then
SSPBUF = azi.LB
Else
If SSPBUF = 2 Then
SSPBUF = azi.HB
Endif
Endif
WaitMs 100

Hserout "AZILB=", #azi.LB, " ", "AZIHB=", #azi.HB, CrLf

Goto get_count
_________________________________________________________________________________________
MASTER:
Dim azi As Word

main: '\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
rled = 1
WaitMs 100
rled = 0
WaitMs 100

'READ DATA from AZIMUTH (4431)

WaitMs 1000
SPISend 1
WaitMs 100
SPIReceive azi.LB
WaitMs 100
SPISend 2
WaitMs 100
SPIReceive azi.HB

Hserout "AZI.LB=", #azi.LB, " ", "AZI.HB=", #azi.HB, CrLf

Goto main
 
Last edited:

Latest threads

EE World Online Articles

Loading

 
Top