Hello
I need to use the Clock Tick in AM243x to generate a 1ms tick, now I have configure it in "example.syscfg". I also write a clock callback and clockParams to put in clockObj as following code


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.
Hello
I need to use the Clock Tick in AM243x to generate a 1ms tick, now I have configure it in "example.syscfg". I also write a clock callback and clockParams to put in clockObj as following code


Hi Matt,
For your use case, it is better to use TimerP instead of the ClockP. The ClockP is providing the system clock (heartbeat using Timer8). There are 7 more timers can be used by users. Here is the code section for TimerP setup (empty.c):
int myTimerCallbackCount = 0;
void myTimerCallback(void)
{
myTimerCallbackCount++;
}
void empty_main(void *args)
{
TimerP_Params timerParams;
/* Open drivers to open the UART driver for console */
Drivers_open();
Board_driversOpen();
DebugP_log("All tests have passed!!\r\n");
TimerP_Params_init(&timerParams);
timerParams.inputPreScaler = CONFIG_TIMER0_INPUT_PRE_SCALER;
timerParams.inputClkHz = CONFIG_TIMER0_INPUT_CLK_HZ;
timerParams.periodInUsec = CONFIG_TIMER0_USEC_PER_TICK;
timerParams.oneshotMode = 0;
timerParams.enableOverflowInt = 1;
TimerP_setup(gTimerBaseAddr[CONFIG_TIMER0], &timerParams);
TimerP_start(gTimerBaseAddr[CONFIG_TIMER0]);
while (1)
{
}
Board_driversClose();
Drivers_close();
}
Here is the example.syscfg screen capture:

I have tested it on AM243x LP. It works fine.
Best regards,
Ming