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.

Basic problem with transistors

Status
Not open for further replies.
The max output current of my uC's parallel ports is 20mA.
No.
The max allowed output current is 20mA. Texas Instruments show graphs of the minimum and typical output current from a 74HCxxx gate (same contruction as a microcontroller) and the output current can be more than 60mA which will destroy them. Driving the base of an NPN transistor the graphs show a typical current of 68mA when the supply is 6V. The typical output current is 42mA when the supply is 4.5V. It does not show the output current when the supply is only 3V.
 
I thought the maximum current for the HC series is 25mA per output with a maximum supply current of 50mA.
 
I know that the max allowed output current of a PIC micro-controller or a 74HCxxx is 25mA but the OP said that his micro-controller has a max output current of 20mA.

Maybe its max output current is actually only 20mA when its supply is as low as 3.0V.
 
I'm planning on looking at the IC in more detail as soon as I have the time.

I think I'll just stick to two pins per motor. All I need to know is how to connect the circuits so that PA0=1 and PA1=0 makes the motor go forward, PA0=0 and PA1=1 makes it go backwards, and PA0=PA1 prevents any of the BJTs, MOS-FETs, or whatever else might be used in the H-Bridge, from opening. I don't know if the suggested IC handles all this itself, but either way I would like to know how this behaviour would have been achieved with my schematic, even if the schematic wouldn't work for other reasons, since it's bugging me now and I don't see any reason why a link between the battery ground and PA0/PA1 via diodes wouldn't work... If someone could please answer this question I will be very grateful. I have asked several times now but I've only ever received answers to questions I didn't actually ask...

Even if I find out that the IC will handle all of this, I would still like to know why this aspect of my schematic was incorrect.

Thanks.
 
Last edited:
No.
The max allowed output current is 20mA.

I was informed by an experienced user of my series of microprocessors that 20mA is the maximum current which can be obtained from the parallel ports of the prototyping board on which my microprocessor sits. He said this was in the documentation, though the documentation is extensive so I'm not sure where. I'm using a 4010 rabbitcore microprocessor mounted on the prototyping board which came with the development kit.

I've never used PICs, though I intend to in future, so I can't claim to know anything about PICs. But obviously a rabbitcore processor is a completely different line of devices. The user on the rabbit forums seemed pretty sure that the current from the parallel ports wouldn't go higher than 20mA.

Incidentally, is there a difference between the terms "microcontroller" and "microprocessor"? If so, mine is the latter.
 
Last edited:
I was informed by an experienced user of my series of microprocessors that 20mA is the maximum current which can be obtained from the parallel ports of the prototyping board on which my microprocessor sits. He said this was in the documentation, though the documentation is extensive so I'm not sure where. I'm using a 4010 rabbitcore microprocessor mounted on the prototyping board which came with the development kit.

I would suggest you misunderstood (or he did?), port pins aren't normally over-current protected, and the specs are for the maximum allowed current, it's up to you to ensure that's not exceeded.
 
Really? Less than 20mA? I was told by someone that an LED typically requires around 100mA... Okay I'm well and truly confused now. Either way, I was told that the maximum current from the parallel ports was 8mA... I'll try to find the quote.
 
Really? Less than 20mA? I was told by someone that an LED typically requires around 100mA... Okay I'm well and truly confused now. Either way, I was told that the maximum current from the parallel ports was 8mA... I'll try to find the quote.

LED's light quite acceptably on just 1mA - at 100mA many would burn out, or have short lives.
 
Quotes from rabbit forums:

but the device you're driving it from might only be able to supply 8ma (and watch out, because there are devices that can sink and source different amounts of current)

The 8ma figure came from the Specifications section of the Rabbit 4000 Microprocessor User Manual. Also appears in the RabbitCore RCM4000 User's Manual (Table A-4).
 
LED's light quite acceptably on just 1mA - at 100mA many would burn out, or have short lives.

Ah... that's bad news for me then. In every circuit I've made so far using LEDs, I've tried to limit the current to 50-100mA since I was informed previously that a standard-sized LED would usually be run at about 100mA... though fortunately I haven't had any burn out yet. I didn't use resistors when connecting to my rabbit prototyping board since I thought if the 8mA max current was correct, it may not have even be able to light up the LEDs, let alone burn them out.


Anyway regardless of all of this, could someone answer my original question please:

giftiger_wunsch said:
I need to know is how to connect the circuits so that PA0=1 and PA1=0 makes the motor go forward, PA0=0 and PA1=1 makes it go backwards, and PA0=PA1 prevents any of the BJTs, MOS-FETs, or whatever else might be used in the H-Bridge, from opening. I don't know if the suggested IC handles all this itself, but either way I would like to know how this behaviour would have been achieved with my schematic, even if the schematic wouldn't work for other reasons, since it's bugging me now and I don't see any reason why a link between the battery ground and PA0/PA1 via diodes wouldn't work... If someone could please answer this question I will be very grateful. I have asked several times now but I've only ever received answers to questions I didn't actually ask...

I've been trying to wrap my head around why the last schematic I posted earlier wouldn't have this effect, but I haven't had any explanations yet :confused:
 
Last edited:
You're quoting figures out of context - such figures are usually the maximum ALLOWABLE current, not current limited to that figure. Does it anywhere say that the current is limited to that?.
 
You're quoting figures out of context

I didn't quote any figures. I quoted another user quoting figures. I'm an electronics noob, don't shout 'ALLOWABLE' at me as if saying it again is going to make me understand the difference. Feel free to either explain the difference to me or to shout at the person who told me that in the first place. Perhaps I misunderstood what he said, perhaps he misquoted the figures. You tell me.
 
Last edited:
I didn't quote any figures. I quoted another user quoting figures. I'm an electronics noob, don't shout 'ALLOWABLE' at me as if saying it again is going to make me understand the difference. Feel free to either explain the difference to me or to shout at the person who told me that in the first place. Perhaps I misunderstood what he said, perhaps he misquoted the figures. You tell me.
There is a High Power Mood Light project on another website.
The designer didn't know so he had the PIC micro-controller directly connected to the bases of the driver transistors without series current-limiting resistors.
People wrote in that their micro-controllers got so hot that they stopped.

The designer also drove the red LED with a current much higher than its max allowed current and some people wrote in that theirs burned out.
 
So what you're saying is that the current from the uC is limited only by the resistance of the circuit, but that the max recommended current will be 8mA? So the circuit should have a resistance of at least 3.3/0.008 = 412 ohms. Okay, I'll bear that in mind when I connect devices to the parallel ports. I suppose I'm lucky that I didn't damage both the LEDs and the processor when I made my 'pedestrian crossing' app then...

Anyway, could someone please address my previous question now that that issue is out of the way?

giftiger_wunsch said:
I need to know how to connect the circuits so that PA0=1 and PA1=0 makes the motor go forward, PA0=0 and PA1=1 makes it go backwards, and PA0=PA1 prevents any of the BJTs, MOS-FETs, or whatever else might be used in the H-Bridge, from opening. I don't know if the suggested IC handles all this itself, but either way I would like to know how this behaviour would have been achieved with my schematic, even if the schematic wouldn't work for other reasons, since it's bugging me now and I don't see any reason why a link between the battery ground and PA0/PA1 via diodes wouldn't work... If someone could please answer this question I will be very grateful. I have asked several times now but I've only ever received answers to questions I didn't actually ask...
 
I need to know is how to connect the circuits so that PA0=1 and PA1=0 makes the motor go forward, PA0=0 and PA1=1 makes it go backwards, and PA0=PA1 prevents any of the BJTs, MOS-FETs, or whatever else might be used in the H-Bridge, from opening.

I don't see any reason why a link between the battery ground and PA0/PA1 via diodes wouldn't work... .

Isn't part of this answer just that we just connect the PA0 & 1 signals to whatever suitable h-bridge is chosen?

But the rest of the asnwer, is to do with the link (green diodes) you mention between battery ground and the PA0/1 signals. That is a strange configuration I have not seen before, I can't get my head around it. I'm afraid you're going to have to explain the theory behind (if you have before already, I'm sorry I missed it, please try again). You teach us please :)
 
Okay my theory is this:

When PA0 is 3.3V and PA1 0V, the current flows out of PA0, through the bases of the top left and bottom right transistors, and ultimately ends up at the battery ground, where I joined those green wires to. The wire splits into two diodes, and the the current should flow through the diode to PA1, completing the circuit.

If the inverse is true, i.e. PA1 is 3.3V and PA0 is 0V, the current will flow through the bottom-left and top right transistors, again reaching the green wires connected to the battery ground, and this time the current will return to PA0.



When both PA0 and PA1 are at 3.3V, there is no voltage between the two terminals, since they are both high. No current flows, so none of the transistors allow current to pass between their collectors and emitters; the motor stops.


To clarify, the only reason for the diodes in the green wires is because without them, there is a direct conductive path between the two terminals, so virtually no current will actually reach the transistors.


Please let me know if you can see any holes in this theory.

Schematic has been added to this post as requested by marcbarker. Black denotes the H-Bridge, Blue is the uC output connections, and green is the wiring providing the uC output with a route back to ground via whichever port is connected to ground.

Note that I haven't updated the schematic yet, so I may well use that IC suggested my blueroomelectronics, and will certainly add resistors to the blue circuit to limit the current passing through the uC terminals.
 

Attachments

  • sam-proto1c.jpg
    sam-proto1c.jpg
    34.9 KB · Views: 197
Last edited:
This "maximum current thing" can sometimes get like crossing the road in germany. You can get arrested for crossing the road if the green 'cross' light is not lit, even if the cars are far away.

THis is my 0.02. The output of a logic device (in general) is literally a switch which either connects to the IC's supply, or to ground, that's what makes a H/L. This switch isn't perfect, it has an inherent resistance present in it. The amount of inherent resistance varies according to what kind of IC it is.

If it's a Line Driver IC (possibly good for a h-bridge too), the resistance is going to be low, 10 ohms, but if it's a "4000 series" IC running of a small battery, this resistance is something like 1000 ohm. The uC we've been talking about I'll guess is about 100 ohm. When you connect a logic IC output to ground and make it try assert a logic H, a current flows, and the IC starts to get hot. In practice it doesn't blow up, but it can burn off its printed number. But having said that another IC, say a 4000 series I mentioned earlier, can drive an LED directly without bothering with a 'current limiting resistor'.

Enter the 'current limiting resistor'. This is the thing that programs what this current is. I won't elaborate any more because in engineering, this is virtually a religion in itself!

The actual "amount of legal current" is a subjective thing anyway. A data sheet will state in it a "line drawn in the sand", i.e. "25 mA", because that's what inexperienced engineers want, so they can stay their side of the line and not be blamed for anything (defensive engineering). Or that "25 mA" is a value of current they happened to had tested it at, and they don't know (or publish) what happens with other currents.

What is not realised with "legitimate current", is that if you as an engineer 'covered yourself' by setting each IC output driving a load for 24.99 mA, but there are 16 outputs, you'd have an extra 0.4 A supply current! There is a thing called 'maximum package power dissipation', and you've probably exceeded it by this extra power.
 
Okay my theory is
<..> [under composition]
Please let me know if you can see any holes in this theory.

I need a picture, sorry :) can you edit the previous posting and add a schematic (again? sorry), with this scheme on it, so there's no chance of making an error understanding it.

EDIT I'll take a look later and post
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top