Searching \ for '[PIC]: Overcurrent draw from PORTB pin' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=port
Search entire site for: 'Overcurrent draw from PORTB pin'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Overcurrent draw from PORTB pin'
2001\07\16@175847 by Drew Vassallo

picon face
I'm using a 16C71 on a project, but as it is a very old project, I have some
instances of poor electrical design :)  One instance of this has RB5
directly driving a normal radio control servo, which consumes much current
(I believe somewhere around 300mA, but I haven't measured it).  It seems to
work fine with the 16C71, but when I switch my code over to a 16C715, the
chip itself becomes VERY sensitive to lower supply voltages, somewhere
around 5.10V and below.  If I move the servo too fast, the chip often
resets, or sometimes just pauses for a moment, then continues with normal
operation.  I think this is because the servo draws more current when it is
in rapid motion.

I guess my question is more of a request for affirmation, but could the high
current draw directly from the pin be causing this intermittancy?  Have I
possibly damaged the PIC in any way permanently?  I will, of course, add a
transistor to drive the servo, but I guess if there are other problems, or
if this isn't the cause of the intermittancy, I'd like to know what they
might be, anyway.

I'm thinking that maybe the "newer" hardware design of the 16C715 has
resulted in a, shall we say, "more economical" construction and is more
sensitive to out-of-spec conditions than the 16C71.

Thanks,

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\16@191136 by Dan Michaels

flavicon
face
Drew Vassallo wrote:
>I'm using a 16C71 on a project, but as it is a very old project, I have some
>instances of poor electrical design :)  One instance of this has RB5
>directly driving a normal radio control servo, which consumes much current
>(I believe somewhere around 300mA, but I haven't measured it).  It seems to
>work fine with the 16C71, but when I switch my code over to a 16C715, the
>chip itself becomes VERY sensitive to lower supply voltages, somewhere
>around 5.10V and below.  If I move the servo too fast, the chip often
>resets, or sometimes just pauses for a moment, then continues with normal
>operation.  I think this is because the servo draws more current when it is
>in rapid motion.
>
>I guess my question is more of a request for affirmation, but could the high
>current draw directly from the pin be causing this intermittancy?  Have I
>possibly damaged the PIC in any way permanently?  I will, of course, add a
>transistor to drive the servo, but I guess if there are other problems, or
>if this isn't the cause of the intermittancy, I'd like to know what they
>might be, anyway.
>


Drew, it sounds like your problem is not excessive current draw from
the PIC, but more likely noise from the motor is resetting the PIC.

Servos usually have 3 pins, gnd, power, and signal. You apply a
pulse train to the signal pin to move the servo, but the actual
high current for the motor comes from the power pin. A PIC pin
could not drive enough current to spin the motor, I would think.

You probably need more filtering on the servo power/gnd pins.
Also, it's possible you need filtering on the signal pin too,
and maybe /Mclr on the PIC.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\16@193034 by Drew Vassallo

picon face
>Drew, it sounds like your problem is not excessive current draw from
>the PIC, but more likely noise from the motor is resetting the PIC.
>Servos usually have 3 pins, gnd, power, and signal. You apply a
>pulse train to the signal pin to move the servo, but the actual
>high current for the motor comes from the power pin. A PIC pin
>could not drive enough current to spin the motor, I would think.
>
>You probably need more filtering on the servo power/gnd pins.
>Also, it's possible you need filtering on the signal pin too,
>and maybe /Mclr on the PIC.

I'll buy that.  You're probably right about the signal pin not being used
for high current draw, but I'm not sure how much that signal pin draws,
either.  Could you surmise why is it more susceptible to resets when the
battery voltage drops from 5.45 down to 5.10?

When you say "more filtering," do you mean "at least some filtering"? :)  I
have none anywhere, really, except for a bypass cap on the power/gnd PIC
pins.  The servo power/gnd pins are shared with the receiver's power supply
pins.  I'm kind of "branching off" of the line from the receiver to the
servo.

Thanks,

-Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\16@224644 by Dan Michaels

flavicon
face
>>You probably need more filtering on the servo power/gnd pins.
>>Also, it's possible you need filtering on the signal pin too,
>>and maybe /Mclr on the PIC.>
>
>I'll buy that.  You're probably right about the signal pin not being used
>for high current draw, but I'm not sure how much that signal pin draws,
>either.  Could you surmise why is it more susceptible to resets when the
>battery voltage drops from 5.45 down to 5.10?


Drew,

AFAIK, it is only a few mA - plenty of boards use uC pins bare to
drive the servo signal pin. Some kind of electronic speed controller
in there.

As far as your batt voltage, are you driving the PIC straight off
the batt, or do you have a v.reg in there? If the latter, you may be
experiencing v.reg dropout at the lower batt voltages.

Also, I think you should be able to get away with powering the servo
at ~6v or so, with only 5v from the uC on the signal pin.
=======


>When you say "more filtering," do you mean "at least some filtering"? :)  I
>have none anywhere, really, except for a bypass cap on the power/gnd PIC
>pins.  The servo power/gnd pins are shared with the receiver's power supply
>pins.  I'm kind of "branching off" of the line from the receiver to the
>servo.


I popped the case on my Futaba S3003 servo a couple of weeks ago,
and it has a little hi-speed dc motor with a multi-gear speed reducer
in there, but the pcb is all smt and hard to tell what/if the filtering
is. The motor draws ~500 mA, and these lo-V, hi-I motors tend to be
very noisy. For my Tamiya motor geartrain - similar motor to the servo
- I found that a series RC snubber across the motor contacts worked
fairly well - R = 15 - 100 ohms, C = 0.047 - 0.1 uf or so.

Fig 7.19 in Mobile Robots by Jones/Flynn shows a servo hacked for
"continuous" ops - they show a small electrolytic across the motor
terminals, with resistors from the terminals to the metal case.

However, with my Tamiya geartrain, I am using an h-bridge with
PWM speed control, and I found that a bare cap actually produced
worse noise than the snubber described above. Difference is
continuous d.c. versus PWM chopping.

- danM
==============

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\17@040849 by Andy Shaw

flavicon
face
Drew/Folks,
I'm very interested in this thread. I often make use of the 16C7X series
with RC servos and have often observed the problems with noise and voltage
drop when using them. I've also seen similar differences in tollerance
between different members of the PIC family! So although I probably can't
actually add any really useful information to the discussion I wouldreally
like to find out what others do to fix the problem!

Myself I've had some success by isolating the supply to the PIC via a diode
and or resistor feeding a cap. But I'm not at all sure this is the best fix.
One of the problems in this environment is that often the power supply is an
RX battery pack which may only supply 4.8V which does not give a lot of room
for manouver. So what do you guys do? I'm more of a software sort of person,
and unfortunately this sort of problem is hard to fix in software (though
most of my code does seem to have rather a lot of stuff to deal with
processor resets! Wonder why...).

Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@053415 by Roman Black

flavicon
face
Hi Drew, i'm a little bit confused, you are using a
standard RC type servo, driven from a PIC, doesn't
the servo have it's own power wire and the PIC just
provide the "control" signal?? Why do you mention
high currents from the PIC? Can you also provide more
info about the power supply to the servo and PIC, are
they the same, etc?
-Roman



Drew Vassallo wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@063217 by Spehro Pefhany

picon face
At 09:11 AM 7/17/01 +0100, you wrote:

>Myself I've had some success by isolating the supply to the PIC via a diode
>and or resistor feeding a cap. But I'm not at all sure this is the best fix.
>One of the problems in this environment is that often the power supply is an
>RX battery pack which may only supply 4.8V which does not give a lot of room
>for manouver. So what do you guys do? I'm more of a software sort of person,
>and unfortunately this sort of problem is hard to fix in software (though
>most of my code does seem to have rather a lot of stuff to deal with
>processor resets! Wonder why...).

Are you using the internal BOR? Maybe an external one with a lower setting
would help (provided you stay within the specifications of the PIC). The
diode/cap idea is not bad. If you use a Schottky diode, the
drop is only a few hundred mV. Using a version guaranteed to operate at 2V
(at 4MHz say) could give you a fair bit of margin. It's certainly possible
to further improve on this- it would help if you have some idea of the
characteristics of the voltage drop- how low and how long.

BTW, like the other fellow, I'm a bit confused by your subject heading.
My guess is that the servo is pulling the supply voltage down and the
micro is resetting. What does this have to do with PORTB?

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@080111 by Drew Vassallo

picon face
>BTW, like the other fellow, I'm a bit confused by your subject heading.
>My guess is that the servo is pulling the supply voltage down and the
>micro is resetting. What does this have to do with PORTB?

As Dan corrected me, it's not the servo signal PIC pin that's drawing the
current, it's the servo power supply lines.  Now that I think of it, I
probably measured the draw overall, not just from the pin.

However, the supply really never goes below, say, 4.8 V, and I have an
external reset circuit set at 4.0 V.  If it were brownout, then I would
imagine that the entire program would just reset and start at the beginning,
but it doesn't.  Often, it just "pauses" for about a second, then continues
at the same point in the code.  Other times, it resets to random code
points, and yet other times, only the IIC comms seem to be affected.  This
really only happens when the voltage drops, as I said, from 5.45 V max
charged to about 5.05 V.  When I pop the 16C71 with the same code into the
socket, it continues to work fine regardless of any further voltage drop.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@100832 by Roman Black

flavicon
face
Drew Vassallo wrote:
>
> >BTW, like the other fellow, I'm a bit confused by your subject heading.
> >My guess is that the servo is pulling the supply voltage down and the
> >micro is resetting. What does this have to do with PORTB?
>
> As Dan corrected me, it's not the servo signal PIC pin that's drawing the
> current, it's the servo power supply lines.  Now that I think of it, I
> probably measured the draw overall, not just from the pin.


Hi Drew, maybe your servo DC motor is making nasty
noise on your power line? Try isolating the two power
lines by putting a large capacitor (470uF ?) across
the power very close to the servo, then a 5 ohm or
larger resistor from the battery to the servo cap.
Another large cap and resistor might help on the
PIC side too, if they run from the same battery.

For a cheap simple solution i've found a decent
size cap and series resistor usually outperforms
other filters. :o)
-Roman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@102933 by Spehro Pefhany

picon face
At 08:01 AM 7/17/01 -0400, you wrote:
>>BTW, like the other fellow, I'm a bit confused by your subject heading.
>>My guess is that the servo is pulling the supply voltage down and the
>>micro is resetting. What does this have to do with PORTB?
>
>As Dan corrected me, it's not the servo signal PIC pin that's drawing the
>current, it's the servo power supply lines.  Now that I think of it, I
>probably measured the draw overall, not just from the pin.
>
>However, the supply really never goes below, say, 4.8 V, and I have an
>external reset circuit set at 4.0 V.

If your battery voltage is only 4.8V and you add a silicon diode
in series (600-700mV) and your external reset circuit is set at 4V, how
much margin do you have? A spike of only a couple hundred mV would be
enough to trigger the reset circuit. If your microcontroller etc. would
work to 3V or 2V and your external reset circuit was set to 2.1V nominal
or  whatever, you'd have MUCH more room to play with.

>If it were brownout, then I would
>imagine that the entire program would just reset and start at the beginning,
>but it doesn't.  Often, it just "pauses" for about a second, then continues
>at the same point in the code.

How do you know it's the same point in the code?

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@151717 by Andy Shaw

flavicon
face
Hi Dan/Drew,
Sorry to pop into this thread (especially to show my ignorance!), but....

> I popped the case on my Futaba S3003 servo a couple of weeks ago,
> and it has a little hi-speed dc motor with a multi-gear speed reducer
> in there, but the pcb is all smt and hard to tell what/if the filtering
> is. The motor draws ~500 mA, and these lo-V, hi-I motors tend to be
> very noisy. For my Tamiya motor geartrain - similar motor to the servo
> - I found that a series RC snubber across the motor contacts worked
> fairly well - R = 15 - 100 ohms, C = 0.047 - 0.1 uf or so.
>

As I said in an earlier post I'm more of a software kind of guy. Could you
describe what the arrangements are for an "RC snubber", and what the
connection arrangements are with respect to the motor contacts! Also if you
are feeling particularly educational any chance of explaining how the thing
works (or are we well into the black art of hardware design here...)!

Thanks

Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@162047 by Dan Michaels

flavicon
face
Andy Shaw wrote:
.......
 I found that a series RC snubber across the motor contacts worked
>> fairly well - R = 15 - 100 ohms, C = 0.047 - 0.1 uf or so.
>>
>
>As I said in an earlier post I'm more of a software kind of guy. Could you
>describe what the arrangements are for an "RC snubber", and what the
>connection arrangements are with respect to the motor contacts! Also if you
>are feeling particularly educational any chance of explaining how the thing
>works (or are we well into the black art of hardware design here...)!
>

Andy, thus starts a 3-week long seminar [just kidding - not really
black arts].

Basically, as indicated above a simple snubber is just a series
R-C directly across the motor terminals. However ---

Clasically, snubbers have been used across "relay contacts" in order
to protect the contacts from the large voltages created when you
interrupt power to an "inductive" load - E = L di/dt - when you break
current quickly by opening the relay contacts, di/dt is huge, and
so is E. This tends to burn the relay contacts and impact reliability.

It also produces loads of EMI [high-frequency noise] that gets
propagated onto the rest of the system, and can disrupt operation.

For DC relays, you can use an upsidedown diode for spike suppression,
but for AC classically they have used RC snubbers. The R actually does
the snubbing [ie, provides a low-impedance path for the inductive spike
to discharge through], while the C blocks the AC power from appearing
directly across the R. Typical R values are 10 - 100 ohms - and you
don't want this right across 220VAC, thus the C in series.

I have taken some great photos in the past of relay contact arcs with
and without snubbers. Without, you get a few msec of high-freq, hi-V
spiking on contact open. With a proper snubber, you get a slow wave
of just a few volts.

Nowadays, some people probably use bidirectional transient suppressor
diodes instead of R-C snubbers.

In the DC servo motor situation being discussed, the application of
the snubber is a little different. Here, it is basically snubbing
the noise generated by the brushes in the motor - they are, of course,
making and breaking contact and generating noise continuously.

Here, the snubber goes across the motor terminals. For DC servos,
they appear to simply use a small electrolytic cap, and this is
probably fine, and simply acts like a low-pass filter. I have also
used just a small R across the motor, and this also works, but
of course draws load current.

However, for the case of the Tamiya motors I mentioned, I am
running those with a PWM-controlled H-bridge chip, so the DC is
interrupted at a hi rate, and using a plain cap across the motor
ends up causing large current spikes:  I = C dv/dt - where dv/dt
is large. Therefore, I used a small R [10 - 100 ohms] in series
with the cap for best effect. The R snubs the inductive currents,
and also limits the capacitive currents. The C blocks the R
from DC loading the power source.

So, in this case, what I ended up with looks just like the R-C
snubber you find across AC relay contacts.

hope this helps,
- dan michaels
http://www.oricomtech.com
===========================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\17@170408 by Andy Shaw

flavicon
face
From: "Dan Michaels" <oricomspamKILLspamUSWEST.NET>
>
> Andy, thus starts a 3-week long seminar [just kidding - not really
> black arts].

Dan thanks for the info (now filed away for future ref.)....

Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...