From 3b48f075e989082cc202c65e076a929c01224d3c Mon Sep 17 00:00:00 2001 From: kakl Date: Wed, 22 Feb 2023 22:23:46 +0100 Subject: [PATCH] comments with calculation of integration time --- fw/LABDOS/LABDOS.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fw/LABDOS/LABDOS.ino b/fw/LABDOS/LABDOS.ino index dfe6852..acbe1ad 100644 --- a/fw/LABDOS/LABDOS.ino +++ b/fw/LABDOS/LABDOS.ino @@ -1,4 +1,4 @@ -#define VERSION "06" // 16 MHz crystal +#define VERSION "06" #ifndef CHANNELS #define CHANNELS 1024 // number of channels in buffer for histogram, including negative numbers (512 or 1024) #endif @@ -411,8 +411,9 @@ void loop() uint8_t previous_sample = 1; // ignore the first ADC // dosimeter integration - for (uint16_t i=0; i<(65535); i++) // cca 7 s + for (uint16_t i=0; i<(65535); i++) // 7.34 s (6.88 s integration time excluding dead time) { + // 112 us fo 14 cycles of conversion; it includes cca 7 us of death time while (bit_is_clear(ADCSRA, ADIF)); // wait for end of conversion delayMicroseconds(12); // 12 us wait for 1.5 cycle of 125 kHz ADC clock for sample/hold for next conversion uint8_t raising_edge = PINB; // peak of pulse was before S/H? H = raising edge; L = falling edge