2012-09-19 04:55 PM
Hi every one
Is anybody know how can i change counter clock i'm using PWM INPUT example this quote got from readme file: The TIMxCLK frequency is set to SystemCoreClock/4 (Hz), the Prescaler is 0 so the counter clock is SystemCoreClock/2 (Hz).i want to know can we change counter clock and how ?2012-09-19 05:36 PM
Use a timer on APB2
2012-09-20 08:05 AM
Thank you
Could you explain more ?2012-09-20 09:30 AM
Timers on APB1 are architecturally limited to 84 MHz, as the bus is slower nominally 36-42 MHz across STM32 families.
The APB2 bus is faster (84 MHz), and should permit a 168 MHz time-base. Refer to the clock tree diagram in the reference manual. Two ways to measure frequency, one is to measure a high frequency count across the period/duty of the slower input. The speed here is limited to the saturation point of the processor to handle the interrupts, and compute the tick delta between one measurement and the next. The other is to count input pulses over a defined period, perhaps slaving off another counter and clocking via the external input, and then extrapolate to cycles per second. You might also want to pick a system frequency other than 168 MHz, as the granularity/quantum is not a nice round number.2012-09-21 09:13 AM
Thank You Clive1
I change my Clock to timer1 and right now i'm in 168Mhz clock but something steel wrong.when i measure pulse with 26.7 us width, the counter count it 4443 and it's doesn't make sense. Is Stm32's PLL have fix clock or it's maybe have variation? In this case seems clock changes to 166.4 Mhz ?Thank you for your useful comments2012-09-22 12:20 PM
Thank You Clive1
I change my Clock to timer1 and right now i'm in 168Mhz clock but something steel wrong.when i measure pulse with 26.7 us width, the counter count it 4443 and it's doesn't make sense. Is Stm32's PLL have fix clock or it's maybe have variation? In this case seems clock changes to 166.4 Mhz ?Thank you for your useful comments2012-09-24 06:23 PM
I believe the PLL uses a VCO, you could measure the signal via the MCO pins. I can't say I've spent much time looking at the signal, but other clocks I've derived from it don't appear to have jitter. The accuracy of the clock will depend on the source it's being compared too. You might want to confirm the VCAPx pins, and that you have suitable capacitance there, and adequate bulk and decoupling capacitors on the supplies.
2012-09-26 09:39 AM