Page 1 of 1

HW TIMER divider outside of [2, 65536] range error

Posted: Tue Mar 05, 2019 3:02 am
by akashdeepsingh
I am trying to create a timer to get value in nano seconds. For this, I am using the "timer_group" example where I set the "TIMER_DIVIDER" to 1 in order to get 12.5 ns per tick. However, I get the following error:

Code: Select all

timer_group: timer_init(214): HW TIMER divider outside of [2, 65536] range error
Does this mean that the max freq. of clock that we can get for our timer group is 40 MHz? or am I doing something wrong?

Re: HW TIMER divider outside of [2, 65536] range error

Posted: Tue Mar 05, 2019 3:33 am
by WiFive
Specifically, when TIMGn_Tx_DIVIDER is either 1 or 2, the clock divisor is 2; when TIMGn_Tx_DIVIDER is 0, the clock divisor is 65536. Any other value will cause the clock to be divided by exactly that value.