|
Electronic Load
1.0
Programmable Constant Current Sink
|
The Main Program and miscellaneous Routines. More...

Functions | |
| void | DelayMs (uint8_t ms) |
| Delays for n Milliseconds. More... | |
| static void | DoCflags (void) |
| Checks for Communication Flags. More... | |
| void | DoFlags () |
| Process Communication-, Time- and Key-Flags. More... | |
| static void | DoTflags (void) |
| Checks for Time Flags. More... | |
| void | GetMCUSR (void) |
| Get a copy of the MCUSR and reset it to 0. More... | |
| void | Init (void) |
| Initializes the System. More... | |
| ISR (TIMER0_COMPA_vect) | |
| Timer0 compare interrupt (800Hz) More... | |
| void | LightShow (void) |
| Performs a Light Show (visible LED test) More... | |
| int | main (void) |
| The Main Program. More... | |
| void | Ticks2HMS (uint32_t ticks, char *str, size_t n) |
Variables | |
| uint32_t | ahCnt |
| Number of average values added to ahRaw;. More... | |
| uint64_t | ahRaw |
| The sum of current values. More... | |
| uint32_t | ahTickCnt |
| The number of 100Hz interrupts since ahRaw is counting. More... | |
| uint8_t | boCnt |
| Counts the number of Brown Out Resets. More... | |
| const char * | build = __DATE__ |
| The Build Date as to be displayed in the Boot Screen. More... | |
| static volatile delay_t | delaycnt |
| Counter for delay() More... | |
| volatile uint8_t | dFlags |
| Flags Controlling Debug Output. More... | |
| volatile uint8_t | eflags |
| Error Flags. More... | |
| FUSES | |
| Fuse settings for the Production ELF file. More... | |
| volatile uint8_t | hrCnt |
| Hours of the RTC. More... | |
| LED_DATA_t | ledData |
| This is the pattern the eight leds should blink. Every '1'-bit means the LED is on. Cycled in 200ms intervals from low to high. More... | |
| LED_FLASH_t | ledRedData |
| This is the pattern the debug led should blink. More... | |
| LOCKBITS = (LB_MODE_1) | |
| The Lock Bits for the production File. More... | |
| uint8_t | mcusrMirror |
| Copy of the MCUSR taken shortly after reset. More... | |
| volatile uint8_t | minCnt |
| Minutes of the RTC. More... | |
| const char eflag1 [] | PROGMEM ="NTC 1 (case temp) malfunction\n" |
| The structure of the main menu. More... | |
| volatile uint8_t | secCnt |
| Seconds of the RTC. More... | |
| volatile uint8_t | tFlags |
| Flags set by Timer Interrupt to signal Main Loop. More... | |
| volatile uint8_t | tickCnt |
| Counter for timer0 interrupts. More... | |
| const char * | version ="1.0" |
| uint8_t | wdrCnt |
| Counts the number of Watchdog Resets. More... | |
The Main Program and miscellaneous Routines.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
| void Ticks2HMS | ( | uint32_t | ticks, |
| char * | str, | ||
| size_t | n | ||
| ) |
| ISR | ( | TIMER0_COMPA_vect | ) |
Timer0 compare interrupt (800Hz)
The 800Hz-interrupt is not only used to create a RTC (Real Time Clock) but also for other tasks that rely on a constant timing, e.g. debouncing of the keyboard.
If you change the frequency, be sure of all of the consequences!

| void DelayMs | ( | uint8_t | ms | ) |
Delays for n Milliseconds.
| ms | The desired delay in Milliseconds |

|
static |
Checks for Communication Flags.


|
static |
Checks for Time Flags.


| void DoFlags | ( | ) |
Process Communication-, Time- and Key-Flags.

| void GetMCUSR | ( | void | ) |
Get a copy of the MCUSR and reset it to 0.
This has to be done as soon as possible after a reset and so the function has been put into section .init3. Also, the watchdog timer is disabled since it may be running. See datasheet for details.
| void Init | ( | void | ) |
Initializes the System.


| void LightShow | ( | void | ) |
Performs a Light Show (visible LED test)

| int main | ( | void | ) |
The Main Program.

| const char* version ="1.0" |
| FUSES |
Fuse settings for the Production ELF file.
| LOCKBITS = (LB_MODE_1) |
The Lock Bits for the production File.
| const char* build = __DATE__ |
The Build Date as to be displayed in the Boot Screen.
| volatile uint8_t dFlags |
Flags Controlling Debug Output.
| volatile uint8_t tickCnt |
Counter for timer0 interrupts.
| volatile uint8_t secCnt |
Seconds of the RTC.
| volatile uint8_t minCnt |
Minutes of the RTC.
| volatile uint8_t hrCnt |
Hours of the RTC.
|
static |
Counter for delay()
| LED_FLASH_t ledRedData |
This is the pattern the debug led should blink.
| LED_DATA_t ledData |
This is the pattern the eight leds should blink. Every '1'-bit means the LED is on. Cycled in 200ms intervals from low to high.
| uint64_t ahRaw |
The sum of current values.
| uint32_t ahCnt |
Number of average values added to ahRaw;.
| uint32_t ahTickCnt |
The number of 100Hz interrupts since ahRaw is counting.
| const menu_t menuStructMain PROGMEM ="NTC 1 (case temp) malfunction\n" |
The structure of the main menu.
| uint8_t wdrCnt |
Counts the number of Watchdog Resets.
| uint8_t boCnt |
Counts the number of Brown Out Resets.
| uint8_t mcusrMirror |
Copy of the MCUSR taken shortly after reset.
1.8.15