Skip to content

Commit

Permalink
comments with calculation of integration time
Browse files Browse the repository at this point in the history
  • Loading branch information
oploc committed Feb 22, 2023
1 parent f23a7e0 commit 3b48f07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fw/LABDOS/LABDOS.ino
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b48f07

Please sign in to comment.