NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Resetting the chip by stopping power to pin 1?

February 10, 2012
by nallelcm
nallelcm's Avatar

Could this potentially damage the MCU?

(I hope nerd kits doesn't mind me borrowing (and butchering) their diagram.)

As I'm powering from USB, and unplugging the USB cable from the computer changes the COM it's connected to, this seemed like an easier route to take. I just want to make sure there isn't any damage that this could cause.

February 10, 2012
by hevans
(NerdKits Staff)

hevans's Avatar

Hi nallelcm,

Your idea is right, but your circuit won't quite do what you expect. The chip will not reset unless you pull the reset line low to GND. Your circuit is just leaving it floating, which won't necessarily reset your chip. To get this to work you need to work out a circuit that will leave your reset pin normally pulled up to +5V and pulls it to GND with your switch.

Humberto

February 10, 2012
by nallelcm
nallelcm's Avatar

I did this from memory, I may be incorrect, and actually have it grounded (but I don't think so).

It seems to work. If I open the switch to pin 1, and then switch it to programming mode, then close the switch to pin 1. It allows me to flash to chip. A behaviour I've noticed though is if I open the switch, but do not change to programming mode, after a few seconds it then starts running what ever program is already flashed to the chip.

But judging from your reply I'm assuming this is safe to do.

February 10, 2012
by Rick_S
Rick_S's Avatar

If you look at my thread HERE you'll see an example of what you are trying to do. It is perfectly OK to use a switch to reset the micro AS LONG AS you do what Humberto said and use a pullup resistor to prevent creating a direct short to ground when resetting.

Rick

February 10, 2012
by nallelcm
nallelcm's Avatar

Thanks Rick_S,

When I get home I will take a picture of what mine looks like now, and what it looks like after I add the pullup resistor. At this point in my learning, I really don't know what I'm doing, so if someone has some time to take a quick peek at it I'd appreciate it.

February 10, 2012
by nallelcm
nallelcm's Avatar

This is what I was talking about i've since added a resistor on row 11 to the ground rail. is this correct?

February 10, 2012
by Rick_S
Rick_S's Avatar

Normally, the resistor would go from pin 1 of the micro-controller to VCC (5V). Your switch would also connect between pin 1 and ground (when on). This way, when the switch is off, the resistor will keep the reset pin pulled high. When you turn the switch on, it would connect pin 1 directly to ground. The resistor would keep the switch from shorting out the 5v rail and ground.

Your way would work as well except you will be draining more power because when you have your chip in run mode, the resistor is connected to VCC creating unnecessary current draw.

Post a Reply

Please log in to post a reply.

Did you know that LEDs (light emitting diodes) only conduct current in one direction, like normal diodes? Learn more...