ADC logging for temperature calibration

Dependencies:   mbed MODSERIAL FastPWM ADS8568_ADC

Files at this revision

API Documentation at this revision

Comitter:
justinbuckland
Date:
Mon Nov 11 08:30:40 2019 +0000
Parent:
27:5dcd526d7598
Commit message:
update board 2 UID

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5dcd526d7598 -r 13f78b4a23c3 main.cpp
--- a/main.cpp	Fri Oct 11 14:06:30 2019 +0000
+++ b/main.cpp	Mon Nov 11 08:30:40 2019 +0000
@@ -3,11 +3,12 @@
 #include "FastPWM.h"
 #include "MODSERIAL.h"
 
-#define MEAS_DELAY       60  // measurement delay after turning on FET (us)
-#define LOG_INTERVAL   1000  // log file interval (ms)
-#define START_DELAY    1000  // pause for startup (ms)
-#define N_STEPS         100
-#define BUFFER_SIZE    4096
+#define MEAS_DELAY         60  // measurement delay after turning on FET (us)
+#define LOG_INTERVAL     1000  // log file interval (ms)
+#define START_DELAY      1000  // pause for startup (ms)
+#define N_STEPS           100
+#define BUFFER_SIZE      4096
+#define PWM_PERIOD_TICKS 1000 
 
 //UID lookup address and pointer
 #define UID_ADDR 0x1FFF7A10
@@ -24,7 +25,7 @@
 
 unsigned long drive_board_uid[UID_TABLE_LENGTH][3] =
  {{0x005B0060, 0x32375101, 0x32363531},
-  {0x0051003D, 0x32375114, 0x30333732},
+  {0x00530028, 0x32375116, 0x30333732}, // updated board 2 UID was  {0x0051003D, 0x32375114, 0x30333732},
   {0x00520060, 0x32375101, 0x32363531},
   {0x00570060, 0x32375101, 0x32363531}};
 
@@ -70,19 +71,19 @@
     
     // Initialsation - all heaters off
     drive_1.prescaler(1);
-    drive_1.period_ticks(1000);
+    drive_1.period_ticks(PWM_PERIOD_TICKS);
     drive_1.pulsewidth_ticks(0);
 
     guard_1.prescaler(1);
-    guard_1.period_ticks(1000);
+    guard_1.period_ticks(PWM_PERIOD_TICKS);
     guard_1.pulsewidth_ticks(0);
 
     drive_2.prescaler(1);
-    drive_2.period_ticks(1000);
+    drive_2.period_ticks(PWM_PERIOD_TICKS);
     drive_2.pulsewidth_ticks(0);
 
     guard_2.prescaler(1);
-    guard_2.period_ticks(1000);
+    guard_2.period_ticks(PWM_PERIOD_TICKS);
     guard_2.pulsewidth_ticks(0);
    
     pc.printf("\r\nUnique ID: %08X %08X %08X \r\n", uid[0], uid[1], uid[2]);   
@@ -115,9 +116,9 @@
         for (int iHeater=0; iHeater <2; iHeater++) {
             // measure heater
             if (iHeater==0) 
-                drive_1.pulsewidth_ticks(1000);
+                drive_1.pulsewidth_ticks(PWM_PERIOD_TICKS);
             else
-                drive_2.pulsewidth_ticks(1000);
+                drive_2.pulsewidth_ticks(PWM_PERIOD_TICKS);
             wait_us(MEAS_DELAY);
         
             //Start ADC conversion