AnsweredAssumed Answered

MM9Z1_638 SPI communication as slave

Question asked by da_jsi on Feb 26, 2015
Latest reply on Mar 3, 2015 by Martin35804

Hello,

 

I have started to work with the MM9Z1_638 reference design board. I want to communicate with the board over SPI. The board should be the slave.

 

My Problem is, that I cannot set the SPI Data Register to send values from the slave to the master.

 

For example, when I execute the code:

// SPIDR before execution: 0x0000

while (!SPISR_SPTEF) DO_NOTHING;           //Wait for empty data register

SPIDR = 0x1111;                             //transmit a 16-bit word 

 

// SPIDR register hasn't changed it is still 0x0000

 

while (!SPISR_SPIF) DO_NOTHING;           //Wait for receiving data

return SPIDR;

 

The master receives 0x0000 from the board. When the master is sending for example 0x0011, the SPIDR is changing from 0x0000 to 0x0011 and return gives me 0x0011 back. But the board is still not able to change SPIDR.

 

I'm using the RD9Z1-638-4LI_APPSP example software. Can somebody help me?

Outcomes