Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Having a programmer permanently installed in a device and not drawing battery power

Status
Not open for further replies.

London

Member
I have a device that has an Atmega64 processor and I use a USBasp programmer to program it. I have to do this so often, that I'd like to permanently install the programmer in the device so that I just basically can hook my device straight up to the PC without having to open up the case every time.

That's all fine and dandy but what my limited electronics knowledge can't wrap my head around is how to do it such that the programmer isn't constantly draining battery power when its not in use. Without using a switch, is there any way that I can ensure the programmer is only "active" when plugged into the USB and not drawing any power when the device is just doing its thing (but the programmer is still permanently connected to the device)?

Here's a link to the USBasp page: fischl.de - USBasp - USB programmer for Atmel AVR controllers

I'm thinking either there's some device like a check valve (I know plumbing better than electronics :)) to prevent the "flow" from coming back into the programmer... or I need to simply disconnect the "Supply Target" jumper and make sure the device always has batteries when programming.

Suggestions?

Thanks.
 
Do I just need to place a rectifying diode in place of JP1? If so, anyway of know what characteristics I should look for? Digikey has a bunch of options for: Voltage - Forward (Vf) (Max) @ If; Voltage - DC Reverse (Vr) (Max); Current - Average Rectified (Io); Current - Reverse Leakage @ Vr; Reverse Recovery Time (trr); and Capacitance @ Vr, F
 
Maybe, but I don't think so.

OK, remove the term "Atmega" (and related) from my post and it really just becomes what should be a basic "general electronics" question. How to prevent reverse flow. But I'll post there too. Thanks.


Edit: (actually, I won't bother. That forum is pretty dead)
 
Last edited:
If you can draw a schematic for what you're thinking, then it'll probably help others to see what is in your head and how it should be changed to achieve the results you're looking for. In general though, you'll just want two voltage rails. One for your device, and the other for your programmer. The programmer would get it's power from the USB connection. You'd also need to verify that there isn't any current on the programming pins flowing into the programmer when not plugged into USB.
 
The schematic is in the link... but no worries, I'll just go the dual-rail way. The only issue there is that then the target needs to be powered during programming.

What I was trying to achieve (and if I could draw a schematic of it then I'd have solved the problem ;)) is to have the USB power the programmer AND target during programming but when the target has its own power, for that to not be wasted by powering the programmer when its not in use.

Its not the end of the world to ensure the target has power though. And that's a lot simpler. So moving on...

Thanks!
 
You're not using an ISP connection...why? That would be the way to go; not embedding the entire programmer in place...
 
Yeah, I understand exactly what you want cause that's what I am trying to do as well. I used a dipswitch that I toggle for programming mode. It includes all 6 ISP pin connections. So far, that's the only way I can think of. But I want to know if we disconnect the Vcc to the programmer circuit but keep the ground and all other ISP pins connected, the programmer board wont be powered right? Cause it wont be a complete circuit. And say my programmer circuit is permanently connected to my target board. If my programmer is not powered but the target board sends HIGH through the MOSI and MISO pins, will it damage my programmer? Thanks.
 
Maybe I'm mising something, but the programmer is powered from USB. It wouldn't drain the battery, as long as you keep battery + wire seperate from the programmer. Just connect a common ground.
 
What you're missing is that (in the reference of the question) the target should also get its power from the USB. But the programmer should not get its power from the battery.
 
Why does the target need to get it's power from USB? If you left it on battery power during programming, your problem is solved. Otherwise, you might try a miniture relay that only energizes during programming, which connects the positive wire between the programmer and target. Energize the relay with USB power. If you use a diode in the relay's coil circuit that prevents the battery from keeping it when unplugged from USB, then you should disconnect the programmer when USB is disconnected. Just remember, the diode will have about a .7V drop, and so the relay should work from VCC - .7V. If VCC is 3.3V, then the relay needs to work down to about 2.5V. Now, whether or not you can find one in the range is another story.
 
Why does the target need to get it's power from USB?
I never understand why people ask why so much :)

If your solutions/suggestion is to leave the battery connected, then...
Its not the end of the world to ensure the target has power though. And that's a lot simpler. So moving on...
Which I did. However...
Otherwise, you might try a miniture relay that only energizes during programming, which connects the positive wire between the programmer and target. Energize the relay with USB power. If you use a diode in the relay's coil circuit that prevents the battery from keeping it when unplugged from USB, then you should disconnect the programmer when USB is disconnected. Just remember, the diode will have about a .7V drop, and so the relay should work from VCC - .7V. If VCC is 3.3V, then the relay needs to work down to about 2.5V. Now, whether or not you can find one in the range is another story.
Sounds very interesting. Thank you!
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top