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.

LM4F242 unable to use SSI2 and SSI3

Hello there,

I was recently trying to use more than 2 SSI modules with my LM4F232H5QD, yet, it seems it can't go past configuring SSI2 and SSI3. SSI0/1 work perfectly fine. I'm using KEIL, the chip runs at 16 MHz external, as the PLL is not working at all.

Is it yet another hardware problem in the revision A1? Or am I missing something?

The code:

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
GPIOPinConfigure(GPIO_PA4_SSI0RX);
GPIOPinConfigure(GPIO_PA5_SSI0TX);
 GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);
 SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 16);
SSIEnable(SSI0_BASE);


SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
GPIOPinConfigure(GPIO_PD0_SSI1CLK);
GPIOPinConfigure(GPIO_PD1_SSI1FSS);
GPIOPinConfigure(GPIO_PD2_SSI1RX);
GPIOPinConfigure(GPIO_PD3_SSI1TX);
 GPIOPinTypeSSI(GPIO_PORTD_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0); 
 SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 16);
SSIEnable(SSI1_BASE);

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
GPIOPinConfigure(GPIO_PH4_SSI2CLK);
GPIOPinConfigure(GPIO_PH5_SSI2FSS);
GPIOPinConfigure(GPIO_PH6_SSI2RX);
GPIOPinConfigure(GPIO_PH7_SSI2TX);
 GPIOPinTypeSSI(GPIO_PORTH_BASE, GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_5 | GPIO_PIN_4);
 SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 16);
SSIEnable(SSI2_BASE);




 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);
GPIOPinConfigure(GPIO_PK0_SSI3CLK);
GPIOPinConfigure(GPIO_PK1_SSI3FSS);
GPIOPinConfigure(GPIO_PK2_SSI3RX);
GPIOPinConfigure(GPIO_PK3_SSI3TX);
 GPIOPinTypeSSI(GPIO_PORTK_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0);
 SSIConfigSetExpClk(SSI3_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 1000000, 16);
SSIEnable(SSI3_BASE);

  • Hello Radioslaw

    Does it get a fault? or does it configure but there is no output on SSI2/3?

    Regards

    Amit

  • Hi,

    as long as by 'fault' You mean an compiler error - no. The whole code is compiling without error messages. The code also seems to run up till the end of SSI1 (i've checked with simple UART messages). Howewer, as soon as we get to SSI2 - there are no more signals comming from the microcontroller. It is stuck somewhere there - i dont know if it's an infinite loop or if there is just some internal stop.

    I've tried to compile the code with ONLY SSI2 and/or SSI3 configuration - it does not get past it as soon as the microcontroller is programmed (again, it compiles without any errors).

  • Hello Radioslaw,

    I think the somewhere is "FaultISR". Can you check what is the value of the register SYSCTL.PPSSI on the part?

    If the value is 0x3 then you have only SSI0 and SSI1 usable. If the value is 0xF then all should be available in which case you would need to look where the code is looping by connecting the debugger,

    Regards

    Amit

  • Hey there!

    That was an interessting tip, however, as it seems the PPSSI register is 0xF. During debugging, i found that when calling the 

    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);

    command, the MCU "freezes" when executing the function from the sysctl.c file:

    void
    SysCtlPeripheralEnable(unsigned long ulPeripheral)
    {
    //
    // Check the arguments.
    //
    ASSERT(SysCtlPeripheralValid(ulPeripheral));

    //
    // Enable this peripheral.
    //
    HWREG(g_pulRCGCRegs[SYSCTL_PERIPH_INDEX(ulPeripheral)]) |=
    SYSCTL_PERIPH_MASK(ulPeripheral);
    }

    it freezes while executing the HWREG comamnd. To be honest, i don't really understand how does this command work, as it apparently worked two times earlier.

  • Hello Radioslaw,

    Are you using StellarisWare or TIVAWare?  The construct for the SysCtlPeripheralEnable shows that it is a old version of the SW.

    Regards

    Amit

  • Hello again!

    I am using the StellarisWare that was shipped together with my MCU, so yes, You are right.

  • Hello Radioslaw,

    Suggestion

    1. Move to TIVAWare-2.1.0 and this will work

    2. Instead of using SysCtlPeripheralEnable for SSI-2 and SSI-3 set the bits 2 and 3 in the register SYSCTL.RCGCSSI, add a SysCtlDelay and it would work

    HWREG(SYSCTL_RCGCSSI) |= 0xC;

    //

    // To allow for clock to start the CPU should wait for some time

    //

    SysCtlDelay(10);

    Regards

    Amit

  • Hello again.

    I have switched the StellarisWare to TivaWare and i was able to run all 4 SSI modules.

    Thus, hereby I annouce this problem as solved. Even the PLL is running now (so pity that 80MHz is not possible).

    Thank You for Your knowledge and support Amit.