I am trying to use the QSSI in slave mode to receive some data that is being transferred from one EK-TM4C1294XL that is in Master mode to another one that is in slave mode. The master appears to be properly transmitting the quad-SSI data but I haven't been able to read the data on the slave side.
The two boards are stacked on top of each other. One of the boards has its power jumper set to get power from the booster pack a.k.a. the other board.
My code is pretty basic where I initialize the slave just as I did with the master only I put it into SSI_ADV_MODE_QUAD_READ mode and slave mode instead of SSI_ADV_MODE_QUAD_WRITE and master mode.
I then use the following code in a while(1) loop to poll the SSI data:
SSIDataGet(twe_QSSI_COMM_BASE, &dataBuffer[0]);
Any idea why I am not receiving the data? Is there something else I'm missing in the initialization?
Here is the initialization function:
void twe_initQSSI(uint32_t SysClkFreq, bool RXmode) { // Enable Peripherals MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_PERIPH); MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_CLK_FSS_GPIO_PERIPH); MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_XDAT01_GPIO_PERIPH); MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_XDAT23_GPIO_PERIPH); // Set the pin muxing MAP_GPIOPinConfigure(twe_QSSI_COMM_CLK_PIN_CONFIG); MAP_GPIOPinConfigure(twe_QSSI_COMM_FSS_PIN_CONFIG); MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT0_PIN_CONFIG); MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT1_PIN_CONFIG); MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT2_PIN_CONFIG); MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT3_PIN_CONFIG); MAP_GPIOPinTypeSSI(twe_QSSI_COMM_CLK_FSS_GPIO_BASE, twe_QSSI_COMM_CLK_PIN | twe_QSSI_COMM_FSS_PIN); MAP_GPIOPinTypeSSI(twe_QSSI_COMM_XDAT01_GPIO_BASE, twe_QSSI_COMM_DAT0_PIN | twe_QSSI_COMM_DAT1_PIN); MAP_GPIOPinTypeSSI(twe_QSSI_COMM_XDAT23_GPIO_BASE, twe_QSSI_COMM_DAT2_PIN | twe_QSSI_COMM_DAT3_PIN); // Must be in SPI Mode0 for QSSI (Advanced) mode if(RXmode) { MAP_SSIConfigSetExpClk(twe_QSSI_COMM_BASE, SysClkFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_SLAVE, twe_QSSI_COMM_BAUD, 8); SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_READ); } else { SSIConfigSetExpClk(twe_QSSI_COMM_BASE, SysClkFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, twe_QSSI_COMM_BAUD, 8); SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_WRITE); } // Enable SSI MAP_SSIEnable(twe_QSSI_COMM_BASE); //SSIDMAEnable(ADC_SSI_BASE, SSI_DMA_RX); // Enable SSI uDMA }
Here is the main code where it is called and the RX FIFO is polled:
int main(void) { /* System initialization */ #ifdef PART_TM4C123GH6PM // Set system clock to 80 MHz (400MHz main PLL (divided by 5 - uses DIV400 bit) [16MHz external xtal drives PLL] SysClkFreq = MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); #endif #ifdef PART_TM4C1294NCPDT // Set system clock to 120 MHz SysClkFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); #endif IntMasterEnable(); //twe_initUDMAcontroller(); //MAP_uDMAControlBaseSet(uDMAcontrolTable); // QSSI Communication twe_initQSSI(SysClkFreq, true); //twe_initQSSIuDMArx(); // UART Communication twe_initUART(SysClkFreq, 4608000); while(1) { SSIDataGet(twe_QSSI_COMM_BASE, &dataBuffer[0]); UARTCharPut(TWE_UART_COMM_BASE,(unsigned char)dataBuffer[0]); } }
My code is attached.
GTBE_communicationDevicePolling.c is the receiving launchpad
GTBE_communicationDeviceTXtest.c is the transmitting launchpad
tw_extension.c and tw_extension.h contains the initialization code.
I appreciate any help or guidance that is provided!
Regards,
Curtis