I have a problem about configuration of LM4F120 launchpad for SSI1. I will not use driverlib for my project so I have to configure the register with "lm4f120h5qr.h". However, I couldnt figure out why I cannot receive Clock pulses although I have already configure regarding register. I can see SS1 TX data throught the logic analyzer but I cannot have the SSI1 CLK pulses. I have other function in my project but none of them are related with Port F, so I shouldnt have problem due to sharing resources. When I activate other function in the main function, I cannot receive SSI1 TX data anymore also. Here are the codes that I have tried to write:
void Max7219_Init(void){ volatile uint32_t delay; SYSCTL_RCGCSSI_R |= 0x02; // activate SSI1 delay = SYSCTL_RCGCSSI_R; SYSCTL_RCGCGPIO_R |= 0x20; // activate port F delay = SYSCTL_RCGCGPIO_R; GPIO_PORTF_AFSEL_R |= 0x0E; // enable alt funct on PF1,2,3 GPIO_PORTF_DEN_R |= 0x0E; // enable digital I/O on PF1,2,3 // configure PF1,2,3 as SSI GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFF000F)+0x00002220; GPIO_PORTF_AMSEL_R &= ~0x0E; // disable analog functionality on PF1,2,3 SSI1_CR1_R &= ~SSI_CR1_SSE; // disable SSI SSI1_CR1_R &= ~SSI_CR1_MS; // master mode SSI1_CC_R = (SSI1_CC_R&~SSI_CC_CS_M)+SSI_CC_CS_SYSPLL; // clock divider for 3.33 MHz SSIClk (50 MHz PLL/14) // SysClk/(CPSDVSR*(1+SCR)) // 50/(14*(1+0)) = 3.33 MHz (slower than 4 MHz) SSI1_CPSR_R = (SSI1_CPSR_R&~SSI_CPSR_CPSDVSR_M)+14; SSI1_CR0_R &= ~(SSI_CR0_SCR_M | // SCR = 0 SSI_CR0_SPH | // SPH = 0 SSI_CR0_SPO); // SPO = 0 // FRF = Freescale format SSI1_CR0_R = (SSI1_CR0_R&~SSI_CR0_FRF_M)+SSI_CR0_FRF_MOTO; // DSS = 16-bit data SSI1_CR0_R = (SSI1_CR0_R&~SSI_CR0_DSS_M)+SSI_CR0_DSS_16; SSI1_CR1_R |= SSI_CR1_SSE; // enable SSI } int main(){ PLL_Init(); PortB_Init(); //column port PortE_Init(); //row port PortC_Init(); PortA_Init(); //scrolling speed control pin Timer0A_Init(&UserTask0, 10000); Timer1A_Init(&UserTask1, 3000); EnableInterrupts(); Max7219_Init(); while(1){ //ShiftRightToLeft("UGUR BOLAT "); while((SSI1_SR_R&SSI_SR_TNF)==0){};// wait until room in FIFO SSI1_DR_R = 0xFFFF; } }
First figure, when I disable the ShiftRightToLeft function, Second one is when I enable the function. This is what I get.