Frequency counter using LPC1768 hardware counter, tested up-to 11MHz forked from https://developer.mbed.org/users/mio/code/5MHzOSC/
Fork of 5MHzOSC by
Diff: main.cpp
- Revision:
- 4:e7d16ef216d4
- Parent:
- 3:603f4efe3985
- Child:
- 5:2f69b934feb0
--- a/main.cpp Tue Jun 18 14:15:38 2013 +0000 +++ b/main.cpp Tue Jun 18 14:18:04 2013 +0000 @@ -2,9 +2,10 @@ // CLOCK OUT to PWM1[6] Sample with Freq Counter using Cap2.0 // For LPC1768-mbed // -// Reference: 1MHz Clock Out Code and Comment - http://mbed.org/forum/mbed/topic/733/ +// Reference: 5MHz Clock Out Code and Comment - http://mbed.org/forum/mbed/topic/733/ // // !! To Self Measurement Output Clock, Connect p21 <-> p30 with jumper wire. +// 2013.6.18 : Wrong comment about MR6 and Duty fix. // #include "mbed.h" @@ -51,7 +52,8 @@ } int main() { - PWM6_SETCLK(96*5) ; // Outout mbed's "PWM6" pin to 96MHZ/19 = 5.052MHz (Approx) + PWM6_SETCLK(19) ; // Outout mbed's "PWM6" pin to 96MHZ/19 = 5.052MHz (Approx) + // PWM6_SETCLK(96) ; // Outout mbed's "PWM6" pin to 96MHZ/96 = 1.000MHz (Approx) P30_INIT_CTR(); while(1){ P30_RESET_CTR();