Hi guys,
I have an Arduino setup as the master transmitting 8 bits of data through SPI (I stepped the voltage down from 5V for safe operating range). I only want to receive data on the 69M board. I've done the following to configure the SPI on my driver kit:
In the hal.c file:
void HAL_setupSpiA(HAL_Handle handle)
{
HAL_Obj *encSpi = (HAL_Obj *)handle;
SPI_reset(encSpi->spiAHandle);
SPI_setClkPolarity(encSpi->spiAHandle,SPI_ClkPolarity_OutputFallingEdge_InputRisingEdge);
SPI_setCharLength(encSpi->spiAHandle,SPI_CharLength_8_Bits);
SPI_setMode(encSpi->spiAHandle,SPI_Mode_Slave);
SPI_setClkPhase(encSpi->spiAHandle,SPI_ClkPhase_Normal);
SPI_disableTx(encSpi->spiAHandle);
SPI_disableInt(encSpi->spiAHandle);
//SPI_setBaudRate(encSpi->spiBHandle,125000);
SPI_disableRxFifoInt(encSpi->spiAHandle);
SPI_clearRxFifoInt(encSpi->spiAHandle);
SPI_enableRxFifo(encSpi->spiAHandle);
SPI_enable(encSpi->spiAHandle);
SPI_setPriority(encSpi->spiAHandle,SPI_Priority_FreeRun);
return;
}
In my main C file, I've added:
uint_least8_t value;
And call this function in the forever loop:
value = SPI_read(spiAHandle);
I've checked the GPIO's and they were already configured.
Both SPIA and SPIB clocks were already enabled.
Here is my watch window:
I'm not getting any activity for SPIA. I have the grounds connected between the 2. The Arduino SIMO pin is connected to the SIMO pin at J5. The Arduino CLK pin is connected to the CLK pin at J8.
Can anyone spot where I might have gone astray?
Cheers,
Jim