Simple Frequency Counter
Newest information
Please refer following.
/users/kenjiArai/notebook/frequency-counters/
1) Summary
I made a very simple frequency counter for checking CPU clock and other purpose.
It runs on following boards.
1) mbed LPC1768
[Input] p30,cpu->P0[23]
2) mbed LPC1114FN28
[Input] dp14,cpu->PIO1_5/CT32B0_CAP0
3) ST Nucleo F401RE
[Input] PA_0,cpu->PA0/TIM2_CH1
4) ST NUcleo F411RE
[Input] PA_0,cpu->PA0/TIM2_CH1
The Library and example program access hardware registers directly on the each CPU.
From this reason, you cannot change the pin assignment for "Frequency Input".
In addition, you cannot import the program for other mbed boards without modification.
The sample program runs with LCD but if you comment out "#define USE_TEXT_LCD" and "#define USE_GRAP_LCD", you don't need any additional hardware.
Just connect to PC via USB com line, you can see the frequency measured data in your terminal software.
2) Picture
3) Hardware Circuit
For a simple test, please connect following pins.
1) mbed LPC1768
p30 connects p21
2) mbed LPC1114FN28
dp14 connects dp18
3) ST Nucleo F401RE
PA_0 connects PA_8 or PC_9
4) ST NUcleo F411RE
PA_0 connects PA_8 or PC_9
4) Software
I referred following programs.
1) 5MHzOSC by fuyono sakura
http://developer.mbed.org/users/mio/code/5MHzOSC/
http://developer.mbed.org/users/mio/
2) fc114 by Tetsuya Suzuki
http://developer.mbed.org/users/rutles/code/fc1114/
http://developer.mbed.org/users/rutles/
Thanks Fuyono-san and Suzuki-san.
Import libraryfreq_counter
Frequency Counter Library. Only for mbed LPC1768, mbed LPC1114FN28, Nucleo-F401 and Nucleo-F411. No way to change pin assign.
Import programFrequency_Counter
Only for mbed LPC1768, mbed LPC1114FN28, Nucleo-F401 and Nucleo-F411. No way to change pin assign.
4 comments on Simple Frequency Counter:
Please log in to post comments.
This is great that it works still step 3 Simple Test; I am trying to test run a clock on Nucleo-F401 at 2MHz using the fastPWM code by Eric. I have one board outputting a 2MHz through PB_3. And I try to measure it on the second board with your code freq_counter. However, the board with your code works with the PA_0, but not the PB_3 on another board. I understand these one analog and one digital.
Do you have any advice on how I can check my signal of 2MHz using your code? Thanks.