Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

SPI EK-LM4F120

$
0
0

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));

}


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>