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.

Quad SSI in Slave Mode

Other Parts Discussed in Thread: EK-TM4C1294XL

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.

8686.QSSI_Slave_Problem.zip

I appreciate any help or guidance that is provided!

Regards,

Curtis

  • Hello Curtis

    When implementing the Slave you have to make sure that the Advanced Mode is committed to the FIFO as mentioned in specification. In other words the following changes need to be made

    SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_READ);

    to be replaced by

    SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_READ);
    SSIDataPut(twe_QSSI_COMM_BASE, 0x00)

    Similarly when reading a data
    SSIDataPut(twe_QSSI_COMM_BASE, 0x00)
    SSIDataGet(twe_QSSI_COMM_BASE, &twe_SlaveDataBuffer)

    should be used, instead of a simple SSIDataGet

    Regarda

    Amit

  • Hey Amit,

    That did the trick.  Thank you!

    Regards,

    Curtis