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.

SSI0 configuration ambiguity

Dear all,

While going through different articles, datasheets and workshops, I have learned that in TM4C123G, the SSI0 perpheral is preconfigured as SSI through Port A pins 2-5 and requires no preconfiguration.

However, Im doing a project that uses SSI2 and SSI0 both. For SSI2, I have done the following configurations:

SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

GPIOPinConfigure(GPIO_PB4_SSI2CLK);
GPIOPinConfigure(GPIO_PB5_SSI2FSS);
GPIOPinConfigure(GPIO_PB6_SSI2RX);
GPIOPinConfigure(GPIO_PB7_SSI2TX);

GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7|GPIO_PIN_5);

SSIDisable(SSI2_BASE);

SSIClockSourceSet(SSI2_BASE, SSI_CLOCK_SYSTEM);

SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,SSI_MODE_MASTER, 400000, 8);

SSIEnable(SSI2_BASE);

// now sending data thru SSI2

SSIDataPut(SSI2_BASE,0x40); //init command - cmd0
while(SSIBusy(SSI2_BASE));

.

.

.

And this is working fine. Now I want to know that are these set of configurations all necessary to be done for the SSI0 for Port PA2-5 or only a part of the above configs need to be done.

  • Hello Turjasu,

    That is correct for TM4C123. However we discontinued the practice in TM4C129 where it is the software's responsibility to change the Port Settings as what you have done for SSI-2.

    In fact I would suggest doing the configuration even on TM4C123.

    Regards

    Amit

  • Amit Ashara said:

    In fact I would suggest doing the (SSI) configuration even on (pre-configured) TM4C123.

    Bravo #2 - Amit clearly, "on fire" today.  Poster too raises a very keen point.  Detail which follows summarizes our (long) real-world findings - supporting both - and justifying this apparent, "extra effort..."

    Our tech firm so often visits clients (not just employing this vendor's MCUs) who "copy/paste" (what they believe to be correct peripheral set-ups/configs) - and these FAIL!   (as the "pre-configs" have long been forgotten - and such "abbreviated code" will NOT Work on all other (i.e. non pre-config'ed) peripherals.

    Reliance upon "defaults" (aside from signaling laziness) has been well known to come back - bite such users...  Performing such peripheral set-ups/configs in whole - just as poster here has illustrated for SSI2 (and vendor's Amit has endorsed) - is always safest and best enables (successful) future, copy/paste to ALL other "like peripheral" instantiations.

  • Hello cb1

    Thanks for the kind words... I have never accepted pre configured peripheral settings, as they tend to confuse and misguide at times developers. Also the nuances of pre configured peripherals at times hid bugs/issues that may affect end applications.

    Regards

    Amit