Hi All,
I am currently trying to transmit a 32-bit value to a component that has a SPI port on it. I am using SSI2 on the Tiva C and I set up my write function as below:
void
vco_writeRegister(uint32_t data)
{
uint8_t* dataPtr = (uint8_t*)&data;
uint8_t ctr;
MAP_SSIConfigSetExpClk(VCOSSI_BASE, g_sysClkFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, VCOSPIFREQ, 8);
MAP_GPIOPinWrite(MCU_VCO_SPI2_SS4_CS_GPIO_PORT_BASE, MCU_VCO_SPI2_SS4_CS_GPIO_PIN, 0x00);
for (ctr = 0; ctr < 4; ctr++)
{
MAP_SSIDataPut(VCOSSI_BASE, (uint32_t)*dataPtr++);
while(MAP_SSIBusy(VCOSSI_BASE)){}
}
MAP_GPIOPinWrite(MCU_VCO_SPI2_SS4_CS_GPIO_PORT_BASE, MCU_VCO_SPI2_SS4_CS_GPIO_PIN, 0xFF);
}
Do you see anything wrong with it? It hangs in the while SSIBusy loop, and the register values indicate that SSI2 is busy and that the Tx FIFO is not full.
Thanks,
Bryan