I purchased several kits from Adafruit Industries this past year as I had some time to learn new things when I was stuck in Kuwait. The soldering, general assembly, and the Arduino programming kept me fairly well occupied. Now I'm starting to take projects from Arduino prototyping of the logic to the Tiny AVRs. I have my USBtiny working well for me. I am using Eclipse AVR for my IDE. I have successfully programmed my ATtiny45 to do my bidding and have run into some issues.
I would like my ATtiny45 to be powered off much of the time. I have an external circuit that switches the beasty off. Well it is supposed to. My external circuit terminates in a NPN transistor as a low side switch to the ground of the ATtiny45. The ATtiny45 has an output pin passed through a resistor to the base of another NPN transistor. (Here is where I hope many of you are smiling and shaking your head at the silly mistake I have made and already know what I will describe next.) As there is still Vcc at pin 8, the current finds a new place to go. The path through my output pin, resistor, base NPN pin, NPN emitter is now the ground. As such the transistor is 'ON' and the LED it was switching is now constantly on, though low. If I restore the ground to the ATtiny45 all works fine.
Need I high-side switch the AVR? Am I missing something elementary to the extreme?
I've been RTFMing a fair bit, but I've yet to go cover to cover. I've also wandered around the 'net on this issue a bit, but have yet to find any insight. Inexpensive references most welcomed. Anecdotal solutions as well.
Thank you for your time,