I'm quite new at MCU programming (mechanical engineering background), but managed programming an Attiny85 to source an LED and switching modes (blinking/solid) by using a switch. I would now like to run this from 2x CR2032 (max ~6.2v) that exceed the max voltage (5.5v)rating for the Attiny. Power consumption is very important here so I would like to reduce unnecessary losses to an absolute minimum.
After reading this thread (Sink or source from AVR) I tried to switch my program to current sink. That is now working on 5v by setting the pin as an open-drain by using:
PORTB &= ~(1 << PINB1); DDRB |= (1 << DDB1); // LED ON (DDRB set as OUTPUT) --> sink DDRB &= ~(1 << DDB1); // LED OFF (DDRB set as INPUT) --> float
I was thinking of using a diode to drop the voltage under the specified 5.5v for the Attiny Vcc (as the current here is now almost 0 there should be no significant power loss). However the datasheet of the Attiny is mentioning:
In the previous hyperlinked thread it was stated that a 5v MCU could even drive 9v LEDs, but am I correct that this is not allowed for the Attiny85? How dangerous would this be? Also when floating the Vcc is not identical to the voltage on the pin. Is this a problem?