Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5157

General • Re: Counting internal clock pulses

$
0
0
Well, you've got to route it somewhere so you can use it, and there's a limited number of choices (see datasheet 2.15):

CLK_GPOUTn - Output pins. This is almost your 'route it out to pins and back again', but you don't need the 'back again' you can do it on one pin. Route ROSC to a pin and then you can treat it as an input to PWM, PIO or even poll it in the CPU.

CLK_ADC, CLK_USB - doesn't seem promising. No easy way to get a count out of these, and stops you using the ADC/USB

CLK_RTC - The RTC will count pulses for you, but requires the clock divider set to give a max of 64kHz. So this won't give you a precise number of clocks.

CLK_PERI - Feeds UART and SPI. Some scope for counting there, but doesn't seem promising.

CLK_SYS - Gives you all sorts of options for counting, (including PWM) but requires you to run the CPU at that speed.

CLK_REF - Setting dividers appropriately should allow you to get a direct count in the Timer. Stops you using the Timer for actual timing of course, with all the SDK's timer facilities based around that.

Statistics: Posted by arg001 — Wed May 08, 2024 3:11 pm



Viewing all articles
Browse latest Browse all 5157

Trending Articles