Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hello,
I am currently working with the SK-AM64x board and attempting to measure the pulse width of an external signal using the timer capture functions in Code Composer Studio (CCS). Specifically, I am using the TimerP_getCount(TIMER_BASE_ADDR)
function to obtain the timer count. However, I am encountering an issue: for a signal with a pulse width of 8 ms (as confirmed using a logic analyzer), the function returns a large count value close to 4294967290
. This is unexpected, as I anticipated a much smaller value given the pulse duration.
Here is my current timer configuration:
TimerP_Params timerParams;
gTimerBaseAddr[TIMER] = (uint32_t)AddrTranslateP_getLocalAddr(TIMER_BASE_ADDR);
TimerP_Params_init(&timerParams);
timerParams.inputPreScaler = TIMER_INPUT_PRE_SCALER;
timerParams.inputClkHz = TIMER_INPUT_CLK_HZ;
timerParams.periodInNsec = TIMER_NSEC_PER_TICK;
timerParams.periodInUsec = 0U;
timerParams.oneshotMode = 0;
timerParams.enableOverflowInt = 0;
timerParams.enableDmaTrigger = 0;
TimerP_setup(gTimerBaseAddr[TIMER], &timerParams);
TimerP_start(gTimerBaseAddr[TIMER]);
What could be causing the TimerP_getCount
function to return such a high count value (4294967290
) for an 8 ms pulse width?
How can I correctly configure and use the Timer to measure the time period of an external signal accurately?
Best regards,
Shiny K George