Install: apt-get install gccavr avrdude avr-libc Use: make && avr-objdump --disassemble asmdemo.elf | tail -5 avrdude -p t13 -c stk500v2 -P /dev/ttyUSB0 -U asmdemo.hex to flash. .-------. / /RESET ---| U |---o o---- Li-ION +3.6V -------+ | | | PWM1 <---|attiny |-----------------------+-/\/\/\-+ | 13 | / | R=3.9K PWM2 <---| |---o o--+- GND -/\/\/\-' | | | R=1K GND ---| |---|>|--' `-------' green LED + 1K ohm ADC: 1.1V reference, 10bit. -> I need n/4. Can we reuse RESET pin? Probably not. Finalized circuit should be: I used two zener's (10V) for protection, nad lots of condensators were needed. IRF7416 P-MOSFET LiION 3.6V ---------++ +---------+---------------. ------ | | --. | | | O ----- | O / \ LED PWM O /___\ O | O 22uH 3A | (+ shottky) O | | | LiION GND ----------------------+---------------' Shottky _is_ needed, and ceramic capacitors, otherwise current goes backwards very fast. Part list: L-XK2-PW14-U00 125Kc GM http://www.gme.cz/cz/index.php?page=product&detail=511-813 ATTINY13-20PU 35Kc GM RR 10K odpor 0.6W RR 1K odpor 0.6W RR 3K9 odpor 0.6W CK 100N/63V kondenzator CK 10N/63V RM 5mm ZS DPU022A3 tlumivka 22uH 3A 22Kc GM [LN 22uH, LO 34uH, Rcu 0.05Ohm, 99uJ] FHS-LXHL-NX05 reflektor luxeon 120Kc GM IRF7416 <30Kc GES http://www.ges.cz/sheets/i/irf7416.pdf Attiny eats about 700uA when no leds are running (@3xNiMH). 1.8mA @green indicator running. 200uA goes through the FETs when it is all powered down, somehow :-(. That !@#(*!# circuit is willing to run out of my _ohmmeter_! No, it is not cursed, I just had empty bateries :-(. attiny is running at 9.6MHz / 8 by default. We should be able to speed it up to 9.6MHz by selecting fuses. qucs is useful. Hodila by se PFRA.300 ? A 2x 1N4733A zenerku. 7 ohm odpor? pojistku 10A pro erika? 50usec / 50usec - good efficiency? 50usec / 35usec - up to 5A on input, cca 0.7A on output. 70usec / 35usec - up to 4A on input, 0.75A on output. 5usec / 3.5usec - up to 4A on input (?!), 0.28A on output. 5usec / 5usec - 0.5A on input, 120mA on output. 15usec/ 15usec - 2A on input, <0.5A on output. 300mA? 5usec / 20usec - cca 25mA output. 1usec / 6usec - cca 6mA output. 1usec / 1usec -- only 25mA output with 50mA peak ahead?