diff options
| author | Selene ToyKeeper | 2015-10-18 17:09:10 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2015-10-18 17:09:10 -0600 |
| commit | 8ae82aa0bf6280674216deff2370561e9ba996e9 (patch) | |
| tree | 0b4eb48d1dcda163b55b7991e2b4aeec71f98869 /tk-voltage.h | |
| parent | merged TK refactoring effort and bistro project from sandbox: (diff) | |
| parent | Removed the need to specify header file paths. (diff) | |
| download | anduril-8ae82aa0bf6280674216deff2370561e9ba996e9.tar.gz anduril-8ae82aa0bf6280674216deff2370561e9ba996e9.tar.bz2 anduril-8ae82aa0bf6280674216deff2370561e9ba996e9.zip | |
Merged many updates from tiny25/bistro branch.
Developed most of "bistro" firmware, based on blf-a6 but greatly improved.
Made a simple program to blink out temperature measurements on tiny25.
Added pseudo-random generator and strobe.
Re-organized some battcheck and otc measurement data.
Removed the need to specify paths to tk-*.h headers.
Diffstat (limited to 'tk-voltage.h')
| -rw-r--r-- | tk-voltage.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tk-voltage.h b/tk-voltage.h index 5eaf0d4..8421ef3 100644 --- a/tk-voltage.h +++ b/tk-voltage.h @@ -23,6 +23,20 @@ #include "tk-attiny.h" #include "tk-calibration.h" +#ifdef TEMPERATURE_MON +inline void ADC_on_temperature() { + // TODO: (?) enable ADC Noise Reduction Mode, Section 17.7 on page 128 + // (apparently can only read while the CPU is in idle mode though) + // select ADC4 by writing 0b00001111 to ADMUX + // 1.1v reference, left-adjust, ADC4 + ADMUX = (1 << V_REF) | (1 << ADLAR) | TEMP_CHANNEL; + // disable digital input on ADC pin to reduce power consumption + //DIDR0 |= (1 << TEMP_DIDR); + // enable, start, prescale + ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL; +} +#endif // TEMPERATURE_MON + #ifdef VOLTAGE_MON inline void ADC_on() { // disable digital input on ADC pin to reduce power consumption |
