MG9S12DG256 Resistor Question

Started by "Fry, Gordon" March 26, 2010
Hey all,

As I'm working through my Introductory tutorial with this board, I'm having some trouble reaching a conclusion again.

The question that is stumping me on the tutorial is "What standard 5% value of resistor would you use to limit current?" First of all, what is meant by "5% value of resistor?" I guess the obvious answer would be:

1.) Find the value of the resistor
2.) Divide by 20

But this doesn't seem right though because it's just too easy. Why wouldn't you just place the final value of the resistor in the HC12 rather than asking this question. And obviously to find the value of the resistor would be a simple moving of variables in Ohm's Law.

The only real applicable equations I found in the microprocessor data sheet are:
RDSON = [VDD5 - VOH / IOH] - for outputs driven high
RDSON = [VOL/ IOL] - for outputs driven low

We were also informed of a few key assumptions to solve the bolded/underlined problem above:

1.) IOL for PortA output is 16[mA]
2.) It takes 10[mA] to drive LED to full brightness
3.) Forward voltage drop of LED is 1.5[V]
4.) Power supply is +5 VDC

Now, what info I can gather from the data sheet to help me out is that there is a 22 ohm resistor used for the LED backlight, and that IOL at full drive is 10[mA] (does this justify the 'full brightness' assumption?!). I am a bit lost as to how to continue this problem. Perhaps my instructor added too many assumptions to throw us off and the solving is rather quite easy, I really don't know.

If I could ask for any help that may lead me in the right direction, that would be most appreciated. Thank you all for any help you may be able to provide!

On 2010-March-26, at 4:42 PM, Fry, Gordon wrote:

> Hey all,
>
> First of all, what is meant by "5% value of resistor?"
>
>
>
Look up resistor tolerance.

I'll give you a hint, a 49 ohm resistor can be classified as a 47.5 ohm 5% resistor, but not as a 2%.
A



I can answer some of your questions.

> Hey all,
>
> As I'm working through my Introductory tutorial with this board, I'm having some
> trouble reaching a conclusion again.
>
> The question that is stumping me on the tutorial is "What standard 5% value of
> resistor would you use to limit current?" First of all, what is meant by "5%
> value of resistor?" I guess the obvious answer would be:
>
> 1.) Find the value of the resistor
> 2.) Divide by 20

Standard resistors don't have just any value but they are divided up in
standard values also known as E-series (google it). 5% in this case is the
tolerance of the nominal value. If the nominal value is 10kohm, the actual
value may be 10kohm +/- 500ohm or between 9.5kohm - 10.5kohm. The higher the
tolerance value is, the less standard values there are per decade. Resistors
with 5% tolerance have 24 standard values per decade so they belong to the E24
series. For resistors in the decade between 100ohm and 1000ohm the values for
the E24 series are 100, 110, 120, 130, 150, 160, 180, 200, 220, 240, 270, 300,
330, 360, 390, 430, 470, 510, 560, 620, 680, 750, 820 and 910.

This means that if you calculate a resistor value to 215ohm and it should be a
standard 5% value, you should pick a 220ohm resistor.

/Ruben
=============================Ruben Jsson
AB Liros Electronic
Box 9124, 200 39 Malm Sweden
TEL INT +46 40142078
FAX INT +46 40947388
r...@pp.sbbs.se
=============================
PortA pin current capacity is higher than your LED full brightness current
(LED maximum current). So you don't need resistor to protect MCU pin. But at
max current voltage drop on your LED is only 1.5V. MCU outputs 5V. If you
connect your LED to 5V voltage source, your LED will start conducting more
current than it is designed for and will get damaged sooner or later. You
need series resistance to protect LED. What's that resistance? It's not 22
Ohm.

Edward

----- Original Message -----
From: "Fry, Gordon"
To: <6...>
Sent: Saturday, March 27, 2010 12:42 AM
Subject: [68HC12] MG9S12DG256 Resistor Question
> Hey all,
>
> As I'm working through my Introductory tutorial with this board, I'm
> having some trouble reaching a conclusion again.
>
> The question that is stumping me on the tutorial is "What standard 5%
> value of resistor would you use to limit current?" First of all, what is
> meant by "5% value of resistor?" I guess the obvious answer would be:
>
> 1.) Find the value of the resistor
> 2.) Divide by 20
>
> But this doesn't seem right though because it's just too easy. Why
> wouldn't you just place the final value of the resistor in the HC12 rather
> than asking this question. And obviously to find the value of the resistor
> would be a simple moving of variables in Ohm's Law.
>
> The only real applicable equations I found in the microprocessor data
> sheet are:
> RDSON = [VDD5 - VOH / IOH] - for outputs driven high
> RDSON = [VOL/ IOL] - for outputs driven low
>
> We were also informed of a few key assumptions to solve the
> bolded/underlined problem above:
>
> 1.) IOL for PortA output is 16[mA]
> 2.) It takes 10[mA] to drive LED to full brightness
> 3.) Forward voltage drop of LED is 1.5[V]
> 4.) Power supply is +5 VDC
>
> Now, what info I can gather from the data sheet to help me out is that
> there is a 22 ohm resistor used for the LED backlight, and that IOL at
> full drive is 10[mA] (does this justify the 'full brightness'
> assumption?!). I am a bit lost as to how to continue this problem. Perhaps
> my instructor added too many assumptions to throw us off and the solving
> is rather quite easy, I really don't know.
>
> If I could ask for any help that may lead me in the right direction, that
> would be most appreciated. Thank you all for any help you may be able to
> provide!
>
>
> PortA pin current capacity is higher than your LED full brightness current (LED
> maximum current). So you don't need resistor to protect MCU pin. But at max

Yes you do. The LED in itself will not limit the current.

> current voltage drop on your LED is only 1.5V. MCU outputs 5V. If you connect
> your LED to 5V voltage source, your LED will start conducting more current than
> it is designed for and will get damaged sooner or later. You need series
> resistance to protect LED. What's that resistance? It's not 22 Ohm.

MCU outputs 5V at zero current. It has an internal resistance (although rather
low) which means that output voltage will drop with increased output current.
Without a resistor in series with the LED, the MCU will output as much current
as it can, with regards to the intenal resistance. The current will rise until
the MCU output resistance has caused a voltage drop of 3.5V (5V-1.5V), the LED
has broken or the MCU output pin has broken.

10mA is pretty much for a MCU output pin and the high output voltage at 10mA
will not be 5V. The low output voltage at 10mA will not be 0V.

You also has to take into account the maximum power dissipated by the whole
chip. Although one output pin has a maximum drive (or sink) current, you cant
drive (or sink) more current totally than the limit for the chip.

/Ruben

>
> Edward
>
> ----- Original Message -----
> From: "Fry, Gordon"
> To: <6...>
> Sent: Saturday, March 27, 2010 12:42 AM
> Subject: [68HC12] MG9S12DG256 Resistor Question
> > Hey all,
> >
> > As I'm working through my Introductory tutorial with this board, I'm
> > having some trouble reaching a conclusion again.
> >
> > The question that is stumping me on the tutorial is "What standard 5%
> > value of resistor would you use to limit current?" First of all, what is meant
> > by "5% value of resistor?" I guess the obvious answer would be:
> >
> > 1.) Find the value of the resistor
> > 2.) Divide by 20
> >
> > But this doesn't seem right though because it's just too easy. Why
> > wouldn't you just place the final value of the resistor in the HC12 rather
> > than asking this question. And obviously to find the value of the resistor
> > would be a simple moving of variables in Ohm's Law.
> >
> > The only real applicable equations I found in the microprocessor data
> > sheet are:
> > RDSON = [VDD5 - VOH / IOH] - for outputs driven high
> > RDSON = [VOL/ IOL] - for outputs driven low
> >
> > We were also informed of a few key assumptions to solve the
> > bolded/underlined problem above:
> >
> > 1.) IOL for PortA output is 16[mA]
> > 2.) It takes 10[mA] to drive LED to full brightness
> > 3.) Forward voltage drop of LED is 1.5[V]
> > 4.) Power supply is +5 VDC
> >
> > Now, what info I can gather from the data sheet to help me out is that
> > there is a 22 ohm resistor used for the LED backlight, and that IOL at
> > full drive is 10[mA] (does this justify the 'full brightness'
> > assumption?!). I am a bit lost as to how to continue this problem. Perhaps my
> > instructor added too many assumptions to throw us off and the solving is
> > rather quite easy, I really don't know.
> >
> > If I could ask for any help that may lead me in the right direction, that
> > would be most appreciated. Thank you all for any help you may be able to
> > provide!
> >
> >
> >
> >
> >
> >
Alright, haha. Thanks for all the posts everyone, but I believe that all of these posts have confused me a bit! It sounds like you are saying contradictory statements, and I do not necessarily know who is correct. Plus, I'm still not quite understanding how your posts relate to the assumptions in the problem. Ruben, everything you said makes sense, but I wouldn't know how to apply it.

Thanks everyone for help, I'm still a beginner here so I'm trying the best I can! :D

________________________________

From: 6... on behalf of Ruben Jsson
Sent: Sat 3/27/2010 10:16 AM
To: 6...
Subject: Re: [68HC12] MG9S12DG256 Resistor Question


> PortA pin current capacity is higher than your LED full brightness current (LED
> maximum current). So you don't need resistor to protect MCU pin. But at max

Yes you do. The LED in itself will not limit the current.

> current voltage drop on your LED is only 1.5V. MCU outputs 5V. If you connect
> your LED to 5V voltage source, your LED will start conducting more current than
> it is designed for and will get damaged sooner or later. You need series
> resistance to protect LED. What's that resistance? It's not 22 Ohm.

MCU outputs 5V at zero current. It has an internal resistance (although rather
low) which means that output voltage will drop with increased output current.
Without a resistor in series with the LED, the MCU will output as much current
as it can, with regards to the intenal resistance. The current will rise until
the MCU output resistance has caused a voltage drop of 3.5V (5V-1.5V), the LED
has broken or the MCU output pin has broken.

10mA is pretty much for a MCU output pin and the high output voltage at 10mA
will not be 5V. The low output voltage at 10mA will not be 0V.

You also has to take into account the maximum power dissipated by the whole
chip. Although one output pin has a maximum drive (or sink) current, you cant
drive (or sink) more current totally than the limit for the chip.

/Ruben

>
> Edward
>
> ----- Original Message -----
> From: "Fry, Gordon" >
> To: <6...

















































First, go to Wikipedia, search for resistor, and scroll down to the section called "preferred values". That will explain what a "5% resistor" is. The rest of the problem is Ohm's Law.

The other posts are not saying contradictory things; you have to balance what the LED needs with what the MCU can provide. They are different, and finding that balance is what engineering is all about.

Gary Olmstead
Toucan Technology
Ventura CA
--- In 6..., "Fry, Gordon" wrote:
>
> Alright, haha. Thanks for all the posts everyone, but I believe that all of these posts have confused me a bit! It sounds like you are saying contradictory statements, and I do not necessarily know who is correct. Plus, I'm still not quite understanding how your posts relate to the assumptions in the problem. Ruben, everything you said makes sense, but I wouldn't know how to apply it.

I see Gary, thanks for your reply. So what I gather from this is the following:

The total voltage supplied to LED is 5VDC, and the LED absorbs 1.5V of this. Therefore, the voltage across the resistor is 3.5V. If I know the current driven to the LED is 16mA, I apply Ohm's Law, and find the resistor value to be 218.75 ohms. Now, finding the nearest E24 (5% tolerance) resistor, my final answer is 220 ohms.

Is this the correct implementation of this information, or have I made an error? Thanks again for the help everyone!

________________________________

From: 6... on behalf of garyolmstead
Sent: Sun 3/28/2010 7:50 AM
To: 6...
Subject: [68HC12] Re: MG9S12DG256 Resistor Question

First, go to Wikipedia, search for resistor, and scroll down to the section called "preferred values". That will explain what a "5% resistor" is. The rest of the problem is Ohm's Law.

The other posts are not saying contradictory things; you have to balance what the LED needs with what the MCU can provide. They are different, and finding that balance is what engineering is all about.

Gary Olmstead
Toucan Technology
Ventura CA

--- In 6...