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.

SPI EK-LM4F120

Help please (LM4F120, timers operation well),

What wrong in initialization of the SSI1(SPI),  no clock, no interrupt, no output data?

---------------------------------------------------------------------------------

void init_SPI1(void)

 {  

ROM_SysCtlPeripheralEnable    ( SYSCTL_PERIPH_GPIOF );  //PortF CLK enable  

ROM_SysCtlPeripheralEnable    ( SYSCTL_PERIPH_SSI1 );    //SSI1 CLK enable  

  // Set the appropriate pins to SPI function:    

 HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;    // Unlock the GPIOCR.    

HWREG(GPIO_PORTF_BASE + GPIO_O_CR) = 0xff;  // Allow the alternate function change to PF0.    

ROM_GPIOPinConfigure(GPIO_PF0_SSI1RX);      //need if pin have alternate function    

ROM_GPIOPinConfigure(GPIO_PF1_SSI1TX);      //    

ROM_GPIOPinConfigure(GPIO_PF2_SSI1CLK);     //        

ROM_GPIOPinTypeSSI (GPIO_PORTF_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0);//

ROM_SSIConfigSetExpClk (SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, SSI_MODE_MASTER, 2000000, 8);                                                  

ROM_SSIEnable(SSI1_BASE);                      

ROM_IntEnable(INT_SSI1);  

ROM_SSIIntEnable(INT_SSI1, (SSI_RXTO | SSI_RXOR | SSI_RXFF));

}

  • Hello Mic,

    I do not find any obvious problem with the SSI initialization. Can you give us more information about the nature of your application and the debug step(s) that you have taken so far? This information will help us to narrow down the problem and help you better.

    In the mean time you can try the SSI communication without using interrupts, if you haven't already. Please refer the examples under "<Install Directory>\examples\peripherals\ssi" directory for configuring the Stellaris SSI channels. Note that these examples are generic to all Stellaris devices and are not board-specific or device-specific. So you might have to modify the board-specific parameters where needed.

    Hope this helps!

    Regards,
    Sainandan Reddy
  • Not happy w/your handling of "Unlock" - do you really seek to Alt Fnt the entire "F" port?  (and - is not the unlocking of PF_0 all that is required?)  I don't believe you've implemented that correctly.

    For simplicity - why "over-challenge" w/ port unlock?  Can not you find a separate SSI port - free from such requirement?   KISS (simplicity) so often works best - not best practice to "add complexity."