AnsweredAssumed Answered

K22 PE based SPI Slave TX FIFO Question

Question asked by Richard Chelminski on Nov 18, 2015
Latest reply on Dec 2, 2015 by Richard Chelminski

Hey Community,

 

So I wrote a fairly straight forward Transparent spi layer between a host (master) and a ADC (slave), utilizing processor expert and the latest SDK. The board I'm using is the FRDM-K22F. From the perspective of receiving a message from the host, sending it to the adc, and then receiving from the adc, I've had no issue.

 

The problem comes in when I'm attempting to send that information back to the host. The host is expecting 2 bytes, and I use the command DSPI_DRV_SlaveTransfer, with the correct instance, a non empty TX Buffer, a non null RX Buffer, a length of 2, and a timeout period that is more than generous. Through debugging I've validated this information.

Yet, every single time I only send 0x00 and then the first byte I have in the TX Buffer.

 

An example would be

 

- Host sends 0x0C 0x00

- K22 receives this, and then sends 0x0C 0x00 to the ADC

- ADC sends back 0x7F 0xEA

- K22 receives this, and then sends 0x00 0x7F to the Host

 

Any help would be very welcomed.

 

Regards,

Richard

Outcomes