]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
latest state of pt100
authorJan Michel <j.michel@gsi.de>
Wed, 5 Aug 2015 09:52:10 +0000 (11:52 +0200)
committerJan Michel <j.michel@gsi.de>
Wed, 5 Aug 2015 09:52:10 +0000 (11:52 +0200)
pt100/main.c
pt100/main.h
pt100/uart.c

index c9d4cf71aff0f5d00d8314f23e18733e1d2ff3ba..29b2b923d58654f9d69e5934e7cc9cc5ea3364f7 100644 (file)
@@ -33,6 +33,7 @@ void read_calib() {
     calib_settings.offset_res[i] = eeprom_read(i);
     }
   calib_settings.gain_res = eeprom_read(8);  
+  calib_settings.current  = eeprom_read(9);
   }
 
 /******************
@@ -51,7 +52,10 @@ void lcd_design(void) {
   lcd_putstr_xy_P(PSTR("PT100 Reader"),0,0);
   
   }
-  
+
+/******************
+ * All my measurements...
+ *****************/  
 void lcd_update(void) {
   }
   
@@ -111,7 +115,11 @@ void init(void) {
  * 500 Hz ticks
  *********************/ 
 ISR(TIMER0_COMPA_vect) {
-  time++;
+  if(++time == 500) {
+    time = 0;
+    send_information();
+    measurement_active = 1;    
+    }
   next_step = 1;
   }
 
@@ -120,8 +128,7 @@ ISR(TIMER0_COMPA_vect) {
  * Second ticks
  *********************/ 
 ISR(TIMER1_COMPA_vect) {
-  send_information();
-  measurement_active = 1;
+
 }
 
 
index db9cd288886569e2a20db3f5eb32eda9661a8349..88506c265a22dc35ebc78773b2720f5209edcd44 100644 (file)
@@ -54,4 +54,5 @@ extern volatile uint8_t  measurement_active;
 struct calib_t {
   uint16_t    offset_res[8];
   uint16_t    gain_res;
+  uint16_t    current;
   };
index fbe91886010b91e40b2a8211a2d7892e6853d0eb..0df6c0b18acade163b7730045fa52c367f84a3a0 100644 (file)
@@ -6,10 +6,10 @@
 //c: Channel
 
 //11 words send for each measurement:
-//ATbcXXXXXX    -- Measured temperature. value is temperature in mK
+//ATbcCXXXXX    -- Measured temperature. value is temperature in mK, C set if not connected otherwise 0
 //ATb800XXXX    -- Temperature given by ADC
 //AIb0FFFFCC    -- Firmware version & connected channels (bitmask) in last byte
-//AVb000XXXX    -- Vcc from ADC channel 3, in mV
+//AVb000XXXX    -- AVCC from ADC channel 3, in mV
 
 //Commands sent by user
 //WEb0AAXXXX     -- write int16 to eeprom at address AA*2