Hi Greg,



thanks for your advices.





> If you use 32.768KHz clock source, then there is a small error in every 
> time conversion since 1/32768 cannot be represented in microseconds. 
> Normally, this will result in small errors as you have noted.  However,
> in a very busy system with man timers, that error builds up and can be 
> quite large... like 50% error!  See the above reference.




I managed to find the (hopefully) right clock value for the GPT timer. If I
use peripheral clock at 16.6 MHz (which is already the set value for iMXRT
MCU) as a clock source, this value can be divided by 1660 prescaler for 100
usec CONFIG_USEC_PER_TICK or by 166 prescaler for 10 usec CONFIG_USEC_PER_
TICK. Both values would mean that the clock frequency of GPT timer is equal
to CONFIG_USEC_PER_TICK (or to its frequency more precisely). I did some 
tests and it seems that those inaccuracies I was having with 32.768 kHz 
clock source are not a problem now. I will do some further tests before 
creating the PR thought.




Best regards,
Michal Lenc

Reply via email to