Hi J, [ TRANSMITTER ]send something from master once.
in the slave read buffer full bit until it is 1
Hi J,What is the hint?
You can't use spisend, spireceive on the hw slave.
The slave is a passive device. It outputs SSPBUF on masters clock.
Try a small pause between SSPsend and SSPreceive on master
Hi J,The slave waits for azilb or azihb. What are they?
Hi J,If SSPBUF = azilb Then <------ what is the value of azilb
SSPBUF = azi.LB
If SSPBUF = azihb Then <------ what is the value azihb
SSPBUF = azi.HB
If the master does not send the value of azilb or azihb the program gets never past this.
The naming of variables like azilb, azihb and then using azi.lb azi.hb is confusing.
Edit: found azilib is 1, azihb is 2
Try to send 1 from master, then 2
Show the whole Slave procram.
Surely the master can send anything.Hi J,
The MASTER can't SEND the values, because it doesn't know them, as they are generated in SLAVE.
I've tried many variations to get this to work, including your suggestions, so far I don't think anything has gone from SLAVE to MASTER along the MISO track, apart from 255.
I used AZI as the ENCODER result, being AZIMUTH (=0-359) which is a WORD, and is split into 2x BYTEs, AZI.LB and AZI.HB
Pleas EDIT the programs, and I'l test them, with whatever VARIABLEs you choose.
Here' are the 2x programs:
Hi J,Remove this from the master:
azilb = 121
SSPBUF = azilb
remove SSPSend azilb