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.

Timer interrupt -TI-RTOS

Other Parts Discussed in Thread: SYSBIOS, EK-TM4C123GXL

Hi,

I am beginner for sysbios/TI-RTOS.

 

I would like to blink the LED on EK-TM4C123GXL launchPad.

I am thinking to use the watchdog timer for LED blinking.  Watchdog sample code is prepared in TI-RTOS.

But I don't know how to use the driver of watchdog. In user guide of TI-RTOS,  it is written Watchdog_setReload() funciton is prepared. I would like to change the period of LED blinking by this function. 

But I don't know how to use this "Watchdog_setReload()" function. Is there some sample code? Or should I use

other timer for LED blinking?

Please advise me.

Best regards,

Michi

  • Hi Michi,

    I'd recommend creating a Clock object instead. SYS/BIOS, by default, uses a timer that fires at every millisecond. When you create a Clock object, you specify your function to call, the period at which to call it and when to start calling it. For example, you can have your toggleLED() function every 500 Clock ticks.

    You could create a Timer object instead, but then you add another interrupt to the system. A timer is recommended though if you have a faster period.

    Todd

  • Dear Todd-san,

    I created Clock project from TI Resource Explorer. But it is not included blink LED.

    I would like to make blink LED code by using Timer on Sysbios. Is there some sample code?

    Best regards,

    Michi

     

  • Michi,

    Which example did you create? I don't think there a TI-RTOS example that creates a blinking LED via the Clock Module.

    You can add the Clock module to any example though. Just include Clock into your configuration. Then statically create a Clock Object via the graphical tool. You'll need to set the period (1000ms) and the function (e.g. toggleLED()). Then write toggleLED() in your source file.

    You can put a breakpoint in your clockFxn (e.g. toggleLED). CCS should halt at the breakpoint. You can also halt the target and look at the state of the Clock module and your Clock object in ROV (Tools->RTOS Object View). For example, confirm the Clock module is incrementing the tick and that your object is created and started.

    Todd