Hi,
I'm sending 4 bytes and then receiving 8 bytes. The SSIfss is not used. I'm using a GPIO as CS.
I am able to use SSIDataPut properly and verify with Logic Analyzer.
However, SSIDataGet is not reliable. It receives 4 bytes and then hangs at ssi.c:
//
// Wait until there is data to be read.
//
while(!(HWREG(ui32Base + SSI_O_SR) & SSI_SR_RNE))
{
}
What determines this?
My code:
// // Initialize the data to send. // pui32DataTx2[0] = 0x00; pui32DataTx2[1] = 0x02; pui32DataTx2[2] = 0x2B; pui32DataTx2[3] = 0x0A; // // Display indication that the SSI is transmitting data. // UARTprintf("\nSent2:\n "); //CS low GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0, 0); // // Send 4 bytes of data. // for(ui32Index = 0; ui32Index < 4; ui32Index++) { // // Display the data that SSI is transferring. // UARTprintf("'%i' ", pui32DataTx2[ui32Index]); // // Send the data using the "blocking" put function. This function // will wait until there is room in the send FIFO before returning. // This allows you to assure that all the data you send makes it into // the send FIFO. // SSIDataPut(SSI0_BASE, pui32DataTx2[ui32Index]); } // // Wait until SSI0 is done transferring all the data in the transmit FIFO. // while(SSIBusy(SSI0_BASE)) { } // // Display indication that the SSI is receiving data. // UARTprintf("\nReceived2:\n "); // // Display the 8 bytes of data that were read from RX FIFO. // for(ui32Index = 0; ui32Index < 8; ui32Index++) { // // Receive the data using the "blocking" Get function. This function // will wait until there is data in the receive FIFO before returning. // SSIDataGet(SSI0_BASE, &pui32DataRx2[ui32Index]); // // Since we are using 8-bit data, mask off the MSB. // pui32DataRx2[ui32Index] &= 0x00FF; // // Display the data that SSI0 received. // UARTprintf("'%i' ", pui32DataRx2[ui32Index]); UARTprintf("\nCount:'%i'", ui32Index); } // // Wait until SSI0 is done transferring all the data in the transmit FIFO. // while(SSIBusy(SSI0_BASE)) { } //CS high GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0, GPIO_PIN_0);
Thanks,
Stephen