From: Jan Michel Date: Wed, 5 Aug 2015 09:52:10 +0000 (+0200) Subject: latest state of pt100 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2a0097bd78f1567b120bfc3500909d40c6a1b412;p=avr.git latest state of pt100 --- diff --git a/pt100/main.c b/pt100/main.c index c9d4cf7..29b2b92 100644 --- a/pt100/main.c +++ b/pt100/main.c @@ -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; + } diff --git a/pt100/main.h b/pt100/main.h index db9cd28..88506c2 100644 --- a/pt100/main.h +++ b/pt100/main.h @@ -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; }; diff --git a/pt100/uart.c b/pt100/uart.c index fbe9188..0df6c0b 100644 --- a/pt100/uart.c +++ b/pt100/uart.c @@ -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