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/

Files at this revision

API Documentation at this revision

Comitter:
kenjiArai
Date:
Sun Dec 22 06:29:39 2019 +0000
Parent:
14:ba6ea409ab05
Commit message:
Update os5 -> 0s5.15.0

Changed in this revision

GPS_rcvr/GPSrcvr.cpp Show annotated file Show diff for this revision Revisions of this file
GPS_rcvr/GPSrcvr.h Show annotated file Show diff for this revision Revisions of this file
User_IF/uif.cpp Show annotated file Show diff for this revision Revisions of this file
User_IF/uif.h Show annotated file Show diff for this revision Revisions of this file
check_revision.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- a/GPS_rcvr/GPSrcvr.cpp	Tue Dec 17 11:41:18 2019 +0000
+++ b/GPS_rcvr/GPSrcvr.cpp	Sun Dec 22 06:29:39 2019 +0000
@@ -8,7 +8,7 @@
  *      updated: July      25th, 2009   for PIC24USB
  *      updated: January   16th, 2010   change to GPS-GM318
  *      updated: April     24th, 2010   for mbed / NXP LPC1768
- *      Revised: Nomeber   20th, 2016
+ *      Revised: Nomeber   22nd, 2016
  */
 
 //  Include --------------------------------------------------------------------
@@ -35,7 +35,7 @@
 
 //  Object ---------------------------------------------------------------------
 DigitalIn   gps_rx(PD_2);       // for checking GPS RX line
-Serial      gps(NC, PD_2);      // GPS Data receive
+Serial      gps(PC_12, PD_2);      // GPS Data receive
 RingBuffer  rxbuf(1024);        // can receive all information every one sec
 
 extern Serial pc;
--- a/GPS_rcvr/GPSrcvr.h	Tue Dec 17 11:41:18 2019 +0000
+++ b/GPS_rcvr/GPSrcvr.h	Sun Dec 22 06:29:39 2019 +0000
@@ -8,7 +8,7 @@
  *      updated: July      25th, 2009   for PIC24USB
  *      updated: January   16th, 2010   change to GPS-GM318
  *      updated: April     24th, 2010   for mbed / NXP LPC1768
- *      Revised: Nomeber   20th, 2016
+ *      Revised: Nomeber   22nd, 2016
  */
 
 //  Definition -----------------------------------------------------------------
--- a/User_IF/uif.cpp	Tue Dec 17 11:41:18 2019 +0000
+++ b/User_IF/uif.cpp	Sun Dec 22 06:29:39 2019 +0000
@@ -5,7 +5,7 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created:    September 28th, 2016
- *      Revised:    December  12th, 2019
+ *      Revised:    December  22nd, 2019
  */
 
 #define     USE_COM         // use Communication with PC(UART)
@@ -37,12 +37,11 @@
 
 //  Object ---------------------------------------------------------------------
 extern Serial       pc;
-extern Ticker       enter_irq;
-extern DigitalOut   in_frq_slct;
-extern DigitalInOut prescaler10or20;
 
 QEI         rotary(PE_9, PF_13, NC, 24, QEI::X4_ENCODING); //Rotary chB,chA
 TextLCD     lcd(PD_3, PC_3, PD_4, PD_5, PD_6, PD_7, TextLCD::LCD20x4);
+DigitalInOut prescaler10or20(PC_5);
+DigitalOut  in_frq_slct(PC_9);
 DigitalOut  led_R_gps1pps(PE_7);
 DigitalOut  led_G_temp_ok(PE_8);
 DigitalOut  led_B_recipro(PG_9);
@@ -51,6 +50,7 @@
 DigitalOut  led_G_rotary(PE_13);
 DigitalOut  led_B_rotary(PF_14);
 DigitalIn   rotary_sw(PE_11);
+Ticker      enter_irq;
 
 //  RAM ------------------------------------------------------------------------
 int8_t      function_num;
--- a/User_IF/uif.h	Tue Dec 17 11:41:18 2019 +0000
+++ b/User_IF/uif.h	Sun Dec 22 06:29:39 2019 +0000
@@ -5,7 +5,7 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created:    September 28th, 2016
- *      Revised:    December  12th, 2019
+ *      Revised:    December  22nd, 2019
  */
 
 //  Definition -----------------------------------------------------------------
@@ -27,7 +27,6 @@
     
 //  Function prototypes --------------------------------------------------------
 void dispay_LCD_and_UART(dispDef *dt);
-
 void display_clear_all(void);
 void disp_first_msg(void);
 void disp_wait_gps(void);
--- a/check_revision.cpp	Tue Dec 17 11:41:18 2019 +0000
+++ b/check_revision.cpp	Sun Dec 22 06:29:39 2019 +0000
@@ -5,17 +5,17 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  https://os.mbed.com/users/kenjiArai/
  *      Created:    July      17th, 2019
- *      Revised:    December  12th, 2019
+ *      Revised:    December  22nd, 2019
  */
 
 #include "mbed.h"
 
-//    RUN ONLY ON mbed-os5.14.2
-//      https://github.com/ARMmbed/mbed-os/releases/tag/mbed-os-5.14.2
+//    RUN ONLY ON mbed-os5.15.0
+//      https://github.com/ARMmbed/mbed-os/releases/tag/mbed-os-5.15.0
 #if (MBED_MAJOR_VERSION == 5) &&\
-    (MBED_MINOR_VERSION == 14) &&\
-    (MBED_PATCH_VERSION == 2)
+    (MBED_MINOR_VERSION == 15) &&\
+    (MBED_PATCH_VERSION == 0)
 #else
-    //#warning "Please use Mbed-os5.14.2"
-    #error "Please use Mbed-os5.14.2"
+    //#warning "Please use Mbed-os5.15.0"
+    #error "Please use Mbed-os5.15.0"
 #endif
\ No newline at end of file
--- a/main.cpp	Tue Dec 17 11:41:18 2019 +0000
+++ b/main.cpp	Sun Dec 22 06:29:39 2019 +0000
@@ -8,7 +8,7 @@
  *      Created:    October   18th, 2014
  *      Revised:    January    2nd, 2015
  *      Re-started: June      25th, 2016    ported from F411 to F746
- *      Revised:    December  12th, 2019
+ *      Revised:    December  22nd, 2019
  *
  * Base program: Frequency_counter_w_GPS_1PPS (only for Nucleo-F411RE board)
  * https://developer.mbed.org/users/kenjiArai/code/Frequency_Counter_w_GPS_1PPS/
@@ -47,7 +47,6 @@
 
 //  Include --------------------------------------------------------------------
 #include    "mbed.h"
-//#include    "rtos.h"
 #include    "GPSrcvr.h"
 #include    "DRV8830.h"
 #include    "ADT7410.h"
@@ -96,27 +95,13 @@
 using namespace Frequency_counter;
 
 //  Object ---------------------------------------------------------------------
-DigitalOut      led_gate(LED1);
-DigitalOut      in_frq_slct(PC_9);
-DigitalInOut    prescaler10or20(PC_5);
-DigitalIn       pa1(PA_1);
-Timer           tmr0;
-Timer           tmr1;
-Timer           tmr2;
-Ticker          enter_irq;
-
+//DigitalOut      led_gate(LED1);
+DigitalIn       pa1(PA_1);      // GPS 1PPS input
 //**** UART
 Serial          pc(USBTX, USBRX);
-
 //**** Req. Counter
 FRQ_CUNTR       fc(CLOCK_BASE); // External clock freq.
 
-//**** Peltier temperature control 
-I2C             i2cBus(PB_9,PB_8);  // SDA, SCL
-DRV8830         heater(i2cBus, (uint8_t)DRV8830ADDR_00); // H brige
-PID             pid(8.0f, 85.0f, 4.0f, 0.7f);            // PID for oven
-ADT7410         t(i2cBus, ADT7410ADDR_NN);               // inside oven temp.
-
 //  RAM ------------------------------------------------------------------------
 // all display data
 dispDef     disp_data;
@@ -161,6 +146,7 @@
 void measure_freq_recipro(void const *args)
 {
     int32_t  run2stop;
+    Timer    tmr0;
 
     while(true) {
         tmr0.reset();
@@ -209,6 +195,13 @@
     static uint32_t error_count = 3600;
     static int32_t  keep_1sec;
 
+    //**** Peltier temperature control 
+    I2C      i2cBus(PB_9,PB_8);  // SDA, SCL
+    DRV8830  heater(i2cBus, (uint8_t)DRV8830ADDR_00); // H brige
+    PID      pid(8.0f, 85.0f, 4.0f, 0.7f);            // PID for oven
+    ADT7410  t(i2cBus, ADT7410ADDR_NN);               // inside oven temp.
+    Timer    tmr2;
+
     t.set_config(OPERATION_MODE_CONT + RESOLUTION_16BIT);
     pid.setInputLimits(0.0f, 5.0f);
     pid.setOutputLimits(0.0f, 5.0f);
@@ -260,6 +253,7 @@
 void display_data(void const *args)
 {
     int32_t tim_remain;
+    Timer   tmr1;
 
     while(true){
         tmr1.reset();
--- a/mbed-os.lib	Tue Dec 17 11:41:18 2019 +0000
+++ b/mbed-os.lib	Sun Dec 22 06:29:39 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#cf4f12a123c05fcae83fc56d76442015cb8a39e9
+https://github.com/ARMmbed/mbed-os/#64853b354fa188bfe8dbd51e78771213c7ed37f7