mjs513
Senior Member+
Well, the proof may be in the pudding -- since it doesn't want to count above 10mhz.
So I changed the test sketch to not use the interval timer (spin on micros() for a second), and before init'ing GPT2 clock, changed source clock to 150mhz
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // turn off 24mhz mode
and sketch counted properly for PWM running at 15 mhz (which wasn't working in 24mhz mode).
Works @30mhz, and when i PWM @40mhz, it reports 37.5mhz (as expected, max is 150mhz/4) well, maybe, because max PWM rate is also only 37.5 mhz.
modified sketch
……..
@manitou
Thanks for checking - funny that's not the way I was reading the RM but then again I only read it twice
Code:
@10Mhz ==> 10000010
@15Mhz ==> 15000013-15000017
@20Mhz ==> 18750017-18750021
@25Mhz ==> 25000024-25000027
@30Mhz ==> 30000027-30000033
@35Mhz & @40Mhz ==> 37500033-37500041