cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration in spi slave mode

DNewm.1
Associate III

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.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
2 REPLIES 2
Erwan YVIN
ST Employee

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

DNewm.1
Associate III

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