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.

LM4F120 SSI1 Configuration Help

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.

  • ugur bolat said:
    I will not use driverlib for my project so I have to configure the register with "lm4f120h5qr.h"

    And too - many here will not assist you as your (unexplained) decision significantly increases the time/effort to assist!

    Have you studied the history of this vendor's acquisition of past, ARM MCU founding firm?  Do you not believe that the development of a large, well conceived, and intensely (user tested/approved) driver library was of great value?

    Your Direct Register attempt (or others) never can enjoy the usage and confidence inherent in, "driver lib."  And - every critical detail of each/every direct register call must be carefully plotted - and considered - that adds "blood/sweat/tears" to your effort - and more importantly to all (would be) helpers - here.

    Failure to (in any way) justify the extra time/effort you force upon your helpers does not make your post especially appealing...

  • I have just tried to keep my description short and clear, tried not to distract when you want to read.

    Purpose of my project is to involve in registers and learn how to create driver library with using direct register. Also, this is my obligation not to use existing driver library. Of course I believed that it is much more safer to use existing driver lib unless you are professional. I have some experience which I have written project with existing driver library. Now, I want to improve skills with accessing register directly. Before I created this topic, I was making research and trying to find some similar topics whole last week. However, it is very challenging way as you mentioned. Only place I can take some help is here...
  • ugur bolat said:
    Only place I can take some help is here...

    Often schools assign such, "Use Direct Register" coding methods - many students "pass" those assignments to those here...   (yet we helpers receive no school credits...)

    If your goal is to become more skilled in Direct Register (although you've still not described Why this is your goal) does it not make sense to choose an MCU Peripheral - and load the appropriate Driver Lib code - and then compile & run?  In so doing you enhance your knowledge of that Peripheral - and  it's set-up/configuration & operations.

    And - during that process - you may "open & examine" the "Full Source Code" - which is (so nicely) provided by this vendor.  (by predecessor vendor, primarily)  That source code clearly lists which Registers are employed - their order of usage - and how each is manipulated.  (the "why" of such is left for you)

    As small, tech biz owner - I can report that myself/others would not allow such "Direct Register tech explorations/investigations" on our time!  As past stated - Driver Lib is Free, Available, Broad based and has passed "test of time."   Your (and others) Direct Register efforts/incarnations - not so much!   Risk-Reward argues against your (still unexplained) desire...  (i.e. Rapidly developed - incompletely test/verified - new user MCU codings may not prove (especially) compelling to those interested in, "Keeping their biz doors Open!")

  • I appreciate your time and recommendations.