2022-06-11 09:18 PM
Hello.
I'm working with spc560p and I want to enable it's spi slave mode. All connections are OK but the slave is not working. My code is:
for(;;){
spi_lld_start(...);
spi_lld_receive(...,Rxbuf);
spi_lld_stop(...);
if(RXbuf == 0xAA){
pal_togglepad;
}
}
Is there any problem with this code?
Thanks for your attention.
2022-06-17 01:40 AM
Hello ,
I would recommend to use :
spi_lld_exchange(&SPID1, 512, txbuf, rxbuf);
Could you check your assembler code generated by the compiler ?
Other clue is to put a protocol Analyser to check if SPI Frame is well received.
Best regards
Erwan
2022-06-19 01:33 AM
Hello.
In slave mode, I just want to read buffers and no sending. With this command I should send something then receive my buffer!
I checked with logic analyzer and master is OK. But my slave is not working. Is there any other ways to receive just rxbuf, how about receive interrupt?
Thanks