View previous topic :: View next topic |
Author |
Message |
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Fri Dec 30, 2011 12:53 pm Post subject: |
|
|
Hi hobby,
my last comment here before you change the specs again:
Quote: | Hi Mak3,
Because the ATXMEGA128A1 is not low cost.
Farnell: 8Euro/10pc
With my final solution: PCA9685 2.13/10PC + ATTINT44 1.48/10pc = 3.61 Euro. |
You changed your specifications to 16 Channels !
We (the forum) can only answer on what you give us.
ATXMEGA16A4U = 4,01 Euro/10pc (still a one chip solution on a PCB and no external Osc needed up to 32Mhz, no external components for I2C like pullup)
(44 pin = the same as ATMGEA324P )
USB Interface included !
MAK3 |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Fri Dec 30, 2011 1:18 pm Post subject: |
|
|
hobby wrote: | The specification is change, sorry 2 LEDs in same time. |
This is not a problem.
Use a 220 ohm resistor on the PWM output (the I/O pin of an AVR can
drive up to 40mA, verify the datasheet). In this case two LEDs must
be always on.
You can also have a 470 ohm resistor for each LED but then you must make sure
that you have only two LEDs on at the same time, otherwise you will exceed the
maximum current on the I/O pin with the PWM output. In this case you
can have one LED or two LEDs on because the current of each LED is limited
by individual resistors.
Best regards,
Luciano |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 1:54 pm Post subject: |
|
|
Luciano,
Quote: | (the I/O pin of an AVR can drive up to 40mA, verify the datasheet) |
it's not sound and not recommended to drive the chip to it's maximum ratings.
The ATXMEGA16A4U as suggested by Mak, (only XMegas apply if 18pin hw-pwm is to be used) is on it's edge at 25mA.
Quote: | XMEGA A4U
36.1 Absolute Maximum Ratings
I I/O pin sink/source current -25 25 mA |
There are led-drivers available with integrated current sink, reducing external parts to a minimum. If looking a bit further, one would likely find suitable cheaper circuits than the PCA.
But if we're back to 16pin soft-pwm, it can be easily done with a single Tiny. |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Fri Dec 30, 2011 2:18 pm Post subject: |
|
|
40 mA?
5V / 220 ohm = 22.72 mA
Best regards,
Luciano |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 2:26 pm Post subject: |
|
|
I did refer to the statement in your post
Quote: | can drive up to 40mA |
and not your choice of resistor value.
The current thereof however is lower than in your calculation
Quote: | 5V / 220 ohm = 22.72 mA |
as you omit the led's forward voltage. |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Fri Dec 30, 2011 3:17 pm Post subject: |
|
|
@MWS and everybody interested.
Not everybody runs the MCU with the internal OSC. at 8 MHz.
The AT168 (also 48, 8 can do 24 MHz at 5 V! It also has enough pins to do at least 18 channels (I know because I did it without a problem or jitter). The price in the USA is about $3.00.
I was also not talking about ISRs because they are not needed for a simple thing like that.
This seems to turn into an electronics discussion.
BTW, with a forward voltage of for example 2 V there will be about 13-14 mA at 5 V (220 ohm resistor).
Have fun dissecting a problem that does not really exist.....he found a solution.
Have a HAPPY NEW YEAR!
Hubert[/quote] |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 3:34 pm Post subject: |
|
|
Hubert,
hgrueneis wrote: | Have fun dissecting a problem that does not really exist.....he found a solution. |
That's the fun in discussion, nobody is obligated to find a different or better solution, but everybody is allowed to
And if it would be always perfectly clear what TO's want, many discussions would stay undiscussed.
Quote: | Have a HAPPY NEW YEAR! |
Thanks, to you too, all the best,
Ludwig |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Dec 30, 2011 4:00 pm Post subject: |
|
|
Even while a pin can sink/source a max. of 25 or 40 mA, it does not mean you can use this on ALL pins! There is a maximum current for the chip. It depends on the chip. _________________ Mark |
|
Back to top |
|
|
hgrueneis
Joined: 04 Apr 2009 Posts: 902 Location: A-4786 Brunnenthal
|
Posted: Fri Dec 30, 2011 4:03 pm Post subject: |
|
|
@Ludwig
"RIGHT YOU ARE" to quote Yoda.
Hubert |
|
Back to top |
|
|
hobby
Joined: 12 Apr 2004 Posts: 109 Location: Brussels
|
Posted: Fri Dec 30, 2011 5:52 pm Post subject: |
|
|
Thank you all for your suggestions. I do a test tonight with a tiny44 and directly 3.6V to prevent resistance of LED (green LED voltage from 3.5 to 4V).
Happy New Year to all.
Thank you
Olivier _________________ Thanks
Olivier |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Fri Dec 30, 2011 6:32 pm Post subject: |
|
|
@MWS:
Stop criticizing the solutions posted by other users and
try to propose something on your own, if you can.
Best regards,
Luciano |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 7:12 pm Post subject: |
|
|
Luciano wrote: | Stop criticizing the solutions posted by other users |
Do you refer to improper calculation of led current and not recommendable advices about absolute maximum ratings ?
It was never my intention to criticize your person, instead to correct errors. It's not good to leave them unanswered.
Quote: | ...try to propose something on your own, if you can. |
I think I did, in this post and many times before.
What I'm still doing hard, is to propose errors as solutions, but I promise, I will try to learn. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 7:18 pm Post subject: |
|
|
hobby wrote: | I do a test tonight with a tiny44 and directly 3.6V to prevent resistance of LED (green LED voltage from 3.5 to 4V). |
If this means what I guess, leaving out resistors, this is definitely not a good idea. |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Fri Dec 30, 2011 8:25 pm Post subject: |
|
|
Ludwig, that's same as the man who jumped from the 100m high tower... first 99m are ok _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Dec 30, 2011 9:12 pm Post subject: |
|
|
If the µC glows brighter than the connected led, something might go wrong |
|
Back to top |
|
|
|