Page 1 of 1

Is it allowed to change timer PSC after gptStart?

Posted: Sat Oct 05, 2019 1:23 pm
by kjwiik
I need to generate a wide range of frequencies dynamically and therefore adjusting both ARR and PSC on the fly is necessary, something like this:

Code: Select all

gptChangeInterval(gptp, arr);
gptp->tim->PSC  = psc;


RM says PSC can be changed on the fly but is there something in ChibiOS that makes this a bad idea?

Thanks,
Kaj

Re: Is it allowed to change timer PSC after gptStart?

Posted: Sat Oct 05, 2019 1:34 pm
by Giovanni
Hi,

The driver is very close to hardware so you can do that. Of course timings are up to you in that case.

Giovanni

Re: Is it allowed to change timer PSC after gptStart?

Posted: Sat Oct 05, 2019 4:37 pm
by kjwiik
Excellent, many thanks!

Kaj