This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI porting problem from MSP430 TRXEB code to Ezdsp5535 for CC radio board

Other Parts Discussed in Thread: CC1125

Hello,

I try to use a module CC1125 with my Ezdsp5535 board.
I have the evaluation module of the CC1125 which i plug into the CC connectors of the EZDSP5535 board.

For the moment i try to port the SPI code below found in "hal_spi_rf_trxeb.c"

/* Pull CS_N low and wait for SO to go low before communication starts */
TRXEM_SPI_BEGIN();
while(TRXEM_PORT_IN & TRXEM_SPI_MISO_PIN);
/* send register address byte */
TRXEM_SPI_TX(accessType|addrByte);
TRXEM_SPI_WAIT_DONE();
/* Storing chip status */
readValue = TRXEM_SPI_RX();
trxReadWriteBurstSingle(accessType|addrByte,pData,len);
TRXEM_SPI_END();

Please answer to the two below questions:

1 ) My first question/remark is for the orange highlighted parts:

The port is configured for SPI but here it read the state of the MISO pin as if it was a GPIO.
So is this good to assume that the input pin register state will be updated and read will be correct? Can i do this (read the input MISO pin state even if it is in SPI mode) with the DSP5535?

2) My second problem is that in the code above
the chip select is  asserted and then it wait that the MISO pin state is low in order to know that the CC is ready for operation.
The problem is that in the EZDSP5535 the chip select for CC board is the hardware chip select 2 of SPI module and so we can not drive it low and wait that a pin go to low state before start transfert.
In datasheet it's say that we can add a delay before start transfert but that's all: "The data delay can be specified from zero to three clock cycles".
So if the delay is not sufficient and that the MISO pin state haven't got the time to go low (CC is not ready), it will fail.
It seem that the SPI module can not be put into 3 wire mode (disable hardware chip select and make a soft chip select with GPIO).

So if someone have already used a CC board with EZDSP5535 can you explain how you do it?

Regards.

Max