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.

AM6442: SYSCONFIG : how to use generated files MCU SDK

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG

Hi everybody , 

i m on gpio_led_blink_am64x-evm_m4fss0-0_nortos_ti-arm-clang     example to  learn how to design on this MCUs .

now I configured in Sysconfig    I   configured Timer 0  (   to add a small delay in the LED blynk example ) , now  it is not clear how to call the function in the main  GPIO led   example :coudl you kindly confirm which is the function to call ( the naming ) .

I  succeeded   using TIMER.c   but not sure  how to do it properly .

thank you 

BR
Carlo

  • Given below is sample screenshot to configure TIMER0 with 10us interrupt

    In this case we dont start timer after setup, we have setup in continous mode i.e every 10us a ISR will fire and we have registered a ISR test_timerIsr which will be called every 10us.

    Now we need to implement test_timerIsr  in our code and the start the timer and then wait for a flag from the ISR as shown below

    // ti_dpl_config.h is included by below file, this file has definition and extern for gTimerBaseAddr, CONFIG_TIMER0
    #include "ti_drivers_open_close.h"

    volatile uint32_t gTimerExpired = 0;

    void test_timerIsr(void *args)
    {
       /* we use global variable and polling, when using RTOS, one can post semaphore instead */
       gTimerExpired = 1;
    }

    my_main_loop()
    {
         /* timer and HW interrupt is already setup during System_init,
            so we need to only start the timer and start waiting on interrupts
          */
         gTimerExpired = 0;
         TimerP_start(gTimerBaseAddr[CONFIG_TIMER0]);

         while(1) {
            LED_on(..)

             /* wait for interrupt */
             while(gTimerExpired != 1 )
                 ;
             gTimerExpired = 0;

            LED_off(...)
         }
         /* when all is done stop the timer to stop the interrupts */
         TimerP_stop(gTimerBaseAddr[CONFIG_TIMER0]);
    }

    Note, you can also use ClockP_usleep() to wait for some time, this internally use one timer that is always setup per CPU to tick at 1ms.