Re: Why my microcontroller hanging?

Aug 08, 2003 3 Replies


Hi,


>
>I bought Atmel 89C51 (PC model) and I used it on my robot but after a
>few second it stoped working.
>What can I do?
>BTW I have four high current (3A) relays on my circuit.
>I added a bypass capacitor and shunt diode across the coiles of my
>relays and and only one regulator for supply of microcontroller.
>Also insert 2 capacitors (2200 uf, 10 uf) on the between GND and VCC. >Please help me?

You might try removing the relays to see if it works without them. If so, it could be voltage sags or spikes associated with the relay operation. Does the 89C51 have a brownout reset enabled?

Does your relay pull more current than the atmel can sink/source?

Hi again, I removed my motors on the contacts of relays and my circuit worked. So I think my problem is the noise of relays and also 89C51 worked well without relays.And as I told,I do lots of work (I found them on usenet!) for filtering the relays but sometimes noise make my 89c51 mad?!!! BTW my motors work with 12VDC. Please help me!!

Well, depending on the kind of motor you are using, this may or may not work. Here goes. I always place a small capacitor (like 0.1 uF) rated at 200 to 300 volts directly across the motor terminals. This absorbs a lot of the transient spikes nicely. I also place an MOV in parallel with it, just in case. Finally, I put ferrite beads on the power wiring to the motor so they can snub any surges in the lines. Now, this will work on a motor, regardless of the polarity of the power applied. I also place snubber diodes across the H-bridges so they will no get nailed by the first transient. Building robots is an education because you learn about the real world fast, or you stop making robots. Electrical noise is one of those invisible, odorless, intangible things that can totally wreck a good idea. Good wiring technique, noise suppression devices, and patience can get you through it.

Cheers!

Chip Shults My robotics, space and CGI web page -

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required