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.

I need to solve this two parts program

Other Parts Discussed in Thread: EK-TM4C123GXL

Hay, please someone help

I need to write a function to generate a 100 ms delay using a single load value for the SYSTICK timer. blink the red LED at a 100 ms rate when SW1 is held down. blink the green LED at a 200 ms rate when SW2 is held down. blink the blue LED at a 300 ms rate when both switches are held down

 Write a function to generate a 10 us delay using a single load value for the SYSTICK timer. b. Blink the red LED at a 10 us rate when SW1 is held down. c. Blink the green LED at a 100 us rate when SW2 is held down, using 10 calls to the function from part a. d. Blink the blue LED at a 10 ms  rate when both switches are held down, using 1000 calls to the function from part a

is there any one can help with this program on TM4C123GXl

thank  you

  • wisam shaba said:

    is there any one can help with this program on TM4C123GXl

    Hay back... perhaps your instructor/professor?  Or - you may help yourself...  (strange idea - that...)

    (have you made any effort to read MCU manual, numerous SW excamples, or search here?)

  •  i need to know how to control the switchs and the LEDs on the chip by programing

    becuse we had complitly diffrenet program i worked on C++ but this is comlitly diffrenet

    thanks for your help any way

     

  • Hi Wisam,

         You can start by going through the Tivaware Peripheral Driver's Library User Guide, and review the example code snippets in the doc. Then see, the example programs here "TivaWare_C_Series-1.0\examples\boards\ek-tm4c123gxl" for your review.

    -kel

  •  thanks for your help I did well on my frist code but on the second one that I had my code build but that take me to another question how to declare  100ms to blink the LED like every 100ms or 200ms or 300ms ? 

    thank you

  • Hi Wisam,

         Based from the systick example code from the example folder. This line below sets the systick period to 1 second. So, dividing the parameter "SysCtlClockGet()" by 10 would set the systick period to 100ms.

    //
    // Set up the period for the SysTick timer. The SysTick timer period will
    // be equal to the system clock, resulting in a period of 1 second.
    //
    SysTickPeriodSet(SysCtlClockGet());

    -kel