; ATtiny13 based low power LED flasher - 4uA quiescent current, can blink for years on 2xAA batteries ; (c) 2016 F. Stefanec ; ; Fuse settings: HFUSE is 0xFF, LFUSE is 0x7B - internal 128kHz clock ; The microcontroller stays in power-down mode for most of the time, thus saving power. ; It would otherwise consume about 200uA all the time. ; Power consumption is around 4uA when no LED is on, around 12mA with the LED on (2V red LED) ; ; /------O-----------------------\ ; 3V | | __________ | ; ------- | 1uF / ° | | ; --- --- -| RST VCC |--- ; | --- -| PB3 PB2 |- ; | | -| PB4 PB1 | LED ; | | ___| GND PB0 |---[82ohm]--|>|--O ; | | | |__________| | ; \------O-----O--------------------------------/ ; .include "tn13def.inc" .def REG = R16 ; universal register .def REG2 = R17 ; universal register (used inside ISR) .def LEDSW = R18 ; LED selector register .equ LED = PB0 .CSEG .ORG 0 RJMP START .ORG WDTaddr ; watchdog interrupt RJMP INTER START: CLI LDI REG, LOW(RAMEND) OUT SPL, REG LDI REG, (1<