Frequency counter using GPS 1PPS signal and temperature controlled 50MHz Base clock. Ported from F411 Frequency Counter.

Dependencies:   QEI DRV8830 PID ADT7410 TextLCD Frq_cuntr_Nucleo-F746ZG RingBuffer

Fork of Frequency_Counter_w_GPS_1PPS by Kenji Arai

Please refer following.
/users/kenjiArai/notebook/frequency-counters/

Revision:
3:603f4efe3985
Parent:
2:bff82681a822
Child:
4:e7d16ef216d4
--- a/main.cpp	Sun May 26 05:42:36 2013 +0000
+++ b/main.cpp	Tue Jun 18 14:15:38 2013 +0000
@@ -2,7 +2,7 @@
 //  CLOCK OUT to PWM1[6] Sample with Freq Counter using Cap2.0 
 //  For LPC1768-mbed
 //
-//  Reference: 5MHz Clock Out Code and Comment - http://mbed.org/forum/mbed/topic/733/
+//  Reference: 1MHz Clock Out Code and Comment - http://mbed.org/forum/mbed/topic/733/
 //
 //  !! To Self Measurement Output Clock, Connect p21 <-> p30 with jumper wire.
 //
@@ -45,13 +45,13 @@
     LPC_SC->PCLKSEL0 &= ~(0x3 << 12);  
     LPC_SC->PCLKSEL0 |= (1 << 12);          // 2)Set peripheral clock divider to /1, i.e. system clock
     LPC_PWM1->MR0 = div - 1;                // 3)Match Register 0 is shared period counter for all PWM1
-    LPC_PWM1->MR6 = 9;                      // 3)Pin 21 is PWM1[6], so Match Register 6
+    LPC_PWM1->MR6 = (div + 1)>> 1;          // 
     LPC_PWM1->LER |= 1;                     // 4)Start updating at next period start
     LPC_PWM1->TCR = (1 << 0) || (1 << 3);   // 5)Enable counter and PWM    
 }
 
 int main() {        
-    PWM6_SETCLK(96) ; // Outout mbed's "PWM6" pin to 96MHZ/19 = 5.052MHz (Approx)
+    PWM6_SETCLK(96*5) ; // Outout mbed's "PWM6" pin to 96MHZ/19 = 5.052MHz (Approx)
     P30_INIT_CTR();
     while(1){
         P30_RESET_CTR();