]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
few more lines of pt100 code
authorJan Michel <j.michel@gsi.de>
Tue, 4 Aug 2015 17:04:14 +0000 (19:04 +0200)
committerJan Michel <j.michel@gsi.de>
Tue, 4 Aug 2015 17:04:14 +0000 (19:04 +0200)
pt100/main.c
pt100/tempmeas.c
pt100/uart.c

index fb426792a3ff342f70053241ef5155d4538e675d..c9d4cf71aff0f5d00d8314f23e18733e1d2ff3ba 100644 (file)
@@ -106,13 +106,6 @@ void init(void) {
 }
 
 
-/**********************
- * ADC finished conversion
- *********************/ 
-ISR(ADC_vect) {
-  
-}
-
 
 /**********************
  * 500 Hz ticks
index 3c9baf5dbd1dd187ad2d495e71be70485a8f4251..c4affefc9dc136a572e40470d24a6e1c5a70d560 100644 (file)
@@ -2,10 +2,11 @@
 
 
 uint8_t connected_sensors = 0x1a;
+uint8_t measurement_step;
 
 //measurement_active gets set once per second
 //do_measurement_step is called once every 2ms by main as long as measurement_active is set.
-//'time' gives the number of the current step
+//'measurement_step' gives the number of the current step
 //when done, set measurement_active to 0
 
 //calibration data is in 'calib_settings'
@@ -20,15 +21,19 @@ uint8_t connected_sensors = 0x1a;
 //2 send information
 //3 sleep
 //... repeat 8 times
-//32 read ADC temperature as 9th channel
-//33 send ADC temperature, finished
+//32 read ADCinput 3 (VCC)
+//33 send ADCinput 3
+//34 read ADC temperature as 9th channel
+//35 send ADC temperature
 
 void do_measurement_step(void) {
-  if(time == 0) {
+  if(measurement_step == 0) {
    LED1_ON();
    }
-  else if(time == 34) {
+  else if(measurement_step == 36) {
     measurement_active = 0;
     LED1_OFF();
+    measurement_step = 0;
     }
   }
index 80e84e00970eadc27f3cb201db9a19b28d2754d1..fbe91886010b91e40b2a8211a2d7892e6853d0eb 100644 (file)
@@ -5,10 +5,11 @@
     //answers: message is started with b=0, increased with every step
 //c: Channel
 
-//10 words send for each measurement:
+//11 words send for each measurement:
 //ATbcXXXXXX    -- Measured temperature. value is temperature in mK
 //ATb800XXXX    -- Temperature given by ADC
 //AIb0FFFFCC    -- Firmware version & connected channels (bitmask) in last byte
+//AVb000XXXX    -- Vcc from ADC channel 3, in mV
 
 //Commands sent by user
 //WEb0AAXXXX     -- write int16 to eeprom at address AA*2