xbee and strange behavior on attiny45 power pin

Hi all

I have one attiny45 connected to a xbee to send some data. I connect pin 3 (PB4) from attiny to xbee Din (pin 3)with a level shifting circuit found here:

http://forum.arduino.cc/index.php?topic=180569.msg1338439#msg1338439

Everything works ok and xbee transmits the data sent by attiny.

I have separated 3,3V and 5V power lines so i want to disconnect attiny power after i sent the message, but i found that if i remove 5V from attiny, i still have about 1,5V on the attiny pin 8. It seems that Xbee Din and level shifting circuit is feeding my attiny, could it be possible?

If i remove level shifter from pin 3, on pin 8 i have 0V when disconnect 5V power.

Depending on the type of level shifter in use, that could very well be happening. Don't do that, it could damage the ATTiny chip - never apply power to a pin when the chip is not powered. Modify your level shifting circuit to ensure that it does not back-power the chip through the level shifted IO pin, or turn on everything at once.

Why not just run the ATTiny at 3.3v (at 8mhz)?
Heck you could just keep it in sleep instead of power down during that time too - in sleep mode, an attiny uses almost no power

DrAzzy:
Why not just run the ATTiny at 3.3v (at 8mhz)?
Heck you could just keep it in sleep instead of power down during that time too - in sleep mode, an attiny uses almost no power

Well, the way i'm doing it is much simple since i have some tasks on the main loop that runs only once. Since i'm powering off the attiny, next time i power it on, it will run once again.

Putting attiny to sleep i have to detect when to wake up (with interrupts or so), meaning more complexity. If there is other way i would like to avoid it.

Even i run attiny @ 3,3V to avoid level shifter will not work, i notice that Xbee Din pin has 3,3V even when sleeping, so attiny will see it on pin 3.

geologic:
Well, the way i'm doing it is much simple since i have some tasks on the main loop that runs only once. Since i'm powering off the attiny, next time i power it on, it will run once again.

Putting attiny to sleep i have to detect when to wake up (with interrupts or so), meaning more complexity. If there is other way i would like to avoid it.

Even i run attiny @ 3,3V to avoid level shifter will not work, i notice that Xbee Din pin has 3,3V even when sleeping, so attiny will see it on pin 3.

Yeah, serial lines are normally held up in idle state.

Yes - you have to either have a way to buffer that and shut it off (there are tons of parts that can do that - you can bully any logic chip, or an opamp, or a comparator to do that, or use level shifter with an output enable pin, etc), or just leave the ATTiny on and in sleep (which is what I was envisioning - So it only has to do stuff once? why not put the stuff it does once in loop instead of setup, sleep at the end of loop, and wake it on a PCINT or external interrupt on change with an empty ISR (just to wake it up), then it'll run loop once and sleep at the end when the interrupt is triggered.

That's what I'd be inclined to do, anyway, not knowing anything else about the project.

Hum... if i power attiny with 3,3V i don't need level shifter and just need to add sleep and pin change interrupt to my code... Sounds good, but i forgot to mention that i only have pin 1 (RESET) available, so i'll have to burn some fuse to use it as interrupt, loosing the programming ability.

I think i'll try the other option, level shifter IC with some enable pin to isolate TX/RX.

Thanks DrAzzy for showing me these options.