From 6592574ce2f1f2a3b517187b1901e239b057c687 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 4 Aug 2015 19:04:14 +0200 Subject: [PATCH] few more lines of pt100 code --- pt100/main.c | 7 ------- pt100/tempmeas.c | 15 ++++++++++----- pt100/uart.c | 3 ++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pt100/main.c b/pt100/main.c index fb42679..c9d4cf7 100644 --- a/pt100/main.c +++ b/pt100/main.c @@ -106,13 +106,6 @@ void init(void) { } -/********************** - * ADC finished conversion - *********************/ -ISR(ADC_vect) { - -} - /********************** * 500 Hz ticks diff --git a/pt100/tempmeas.c b/pt100/tempmeas.c index 3c9baf5..c4affef 100644 --- a/pt100/tempmeas.c +++ b/pt100/tempmeas.c @@ -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; } } diff --git a/pt100/uart.c b/pt100/uart.c index 80e84e0..fbe9188 100644 --- a/pt100/uart.c +++ b/pt100/uart.c @@ -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 -- 2.43.0