
robotmaker
USA
Asked
— Edited
SHOULD always use a current resistor inline with led ,so you dont damage the ezb digital pin or burn out the diode
Here is a link for reasons why and formula to work out the resistor value.
Wednesday, 27 March 2013
GREAT Job RobotMaker !
I like the Idea of Showing the EZ-B Digital Output BOTH Sinking and Sourcing the Current !
In your example, P0 is SINKING the Current, and P1 is SOURCING the Current.
Therefore, P0 has approximately a 1-Volt Advantage over P1.
Chances are that the EZ-B has the HexFet Equivalent of a Totem Pole Output.
The Final Choice would be to find out Which FET has the Highest or Safest Current Limits ?
Best Wishes,
[email protected], 602-246-1246(H)
The EZ-B (as stated many times in this forum and on documentation) does not need a resistor for the LED. This is because the EZ-B microchip contains an internal resistor for the I/O
Users: Please ignore RobotMaker's post. There is no point to use a resistor for LED on EZ-B.
Further reading visit our hardware tutorial: https://synthiam.com/Tutorials/Hardware.aspx?id=7
:)
WHAT do meen by a fet having the highest or safest current limits ?
DO you meen from a microprocessor or fet driving circuit?
If microprocessor is depends on the type ,its in the data sheet of that microprocessor for max sink current and max source current
oh i did see that DJ ,SORRY, i thought it was a straight drive from microprocessor
DJ is right look at the led tutorial and see that its built in,not like other boards like arduino and other microprocessoor board that need it.
Thank You DJ For The Clarification !
As usual, I have got a lot of Homework and Catching Up to Do; The Joys of being age 68.
SAME with me ,i guess i didnt see it,and it hard to look up led in seach because of so many will come up.
NEXT time will look at the hardware manual first and if i can find the answer will post it,nobody is perfect.
DJ, I am sorry but you are incorrect in your statement about not needing a resistor to drive an led with the microcontroller on your board. I have been designing with Microchip's dsPic33F controllers for the past 3 years and its I/O ports are the same design as the ports in the 18F4684 that you use with the EZ-B.
From the Microchip 18F4684 datasheet (document DS39761C, page 134):
" Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the pull-ups. This is performed by clearing bit RBPU (INTCON2<7>). The weak pull-up is automatically turned off when the port pin is configured as an output. The pull-ups are disabled on all device Resets."
The reason that you can drive an led directly from the port pins is that they are internally limited to sourcing or sinking a maximum of 25 ma. However, you have no control over the brightness since every led will get this 25 ma. Another disadvantage is that driving 8 leds at 25ma makes a total of 200ma which is the aggregate current limit for all of the port pins. If you use resistors you can match the brightness of different types and colours of leds and reduce the current so that you can use all of the port pins. For some ir leds used in sensors and many high efficiency leds 10ma is sufficient.
There is also a more general concern about a lack of resistors. When port pins are connected to a cable, there can be voltage spikes from noise pickup and static electricity. If the port pin is connected directly to the wire it may be damaged. A 100 ohm res. between the port and the wire will give some protection (both outputs and inputs).
Finally, being able to drive an led directly is valuable if you are designing a commercial product for a very competitive market because it saves parts and board space. For most diy designs these are not issues so I always use transistors to drive leds and relays. You have a more robust design, the microcontroller will be isolated from the dangerous real world and there will be less heat generated in the microcontroller.
YES i tried to explain that but it does no good.