ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

PRO
Synthiam
#9  

Ah interesting. I thought the internal pullup was active on output. Surprising I missed that:) You should get an award if you are correct regarding the chip that the EZ-B uses. Which is not the chip you referenced.

To make it easier on everyone - there still is no need for a resistor on your LED because it won't do any damage

#10  

@Nomad If I understand you correctly, you agree that LEDs can be driven directly from EZB, although there are caveats that need to be explicitly noted in tutorial? Also I don't know myself but the pullup resistor might be enabled upon power on or connection to ARC. We will have to see what DJ says. (Edit: He already did)

#11  

If you drive a led at half the current it will last much longer and still have goood brightness,most leds are rated at 20ma max.

When i get home late tonight going to make a quick test using a inline current meter with the led to EZB to find out how much it really draws.

Canada
#12  

DJ - I removed the Bluetooth module from my EZ-B and the chip has 'Microchip & 18F4685' printed on it. I referred to the data sheet for this part. I also noticed that the pullups are only available on port B.

One thing I have learned about Microchip is that you need to read at least 3 different data sheets; 1 on hardware design, one on software design and another on the family the part belongs to. Each document will have a couple of critical points that the other two don't mention.

I don't need an award. SEND MONEY!, but seriously, I am happy to help out.

Troy - I don't want to confuse the issue because DJ is correct in saying that you can run the led directly and not damage the part. What I am trying to say is that there are some applications where using a resistor is beneficial in several ways. Since resistors are cheap and have virtually zero negative impact, why not use them all the time? It always comes down to the application.

For example, if the led is connected as in the tutorial and there is a 1 kohm pullup resistor on the pin, the led will be on when the port output is high. If the port was not connected, the 1 kohm res. would limit the current through the led to 3.8 ma since the led anode will be at 2 diode drops above ground potential. However, with the port connected it tries to drive the line to 4V which means its output will hit the 25 ma limit. To turn off the led the port pin goes low and steals the current being supplied to the led by the pullup. A low on the port pin will be 0.4V which means the port will be sinking 4 ma from the pullup to keep the led off. If your robot is powered by a 12V lead acid battery, this isn't a big concern. However, if you are using a couple of AAs and you have 8 leds your batteries will be dead in a few days just from sitting. Instead, keep the led connected to the pullup resistor but connect the cathode to the port pin. Now, the port sinks the 3.8 ma through the pullup when the led is on but when the led is off the port pin is high and zero current flows. This also results in less heat being generated in the microcontroller. My current project requires 2 gear motors and controller electronics with battery inside an 16 cu. in. waterproof shell with a total weight of less than 5 oz. For me, saving 4 ma is a big deal.

If you want to go even farther, consider that sinking 4 ma through a port pin will generate slightly less heat than sourcing 4 ma. I leave the proof of this as an exercise for the reader. It is very useful in combatting insomnia.

PRO
Synthiam
#13  

Sorry, you wrote 18F4684 in your previous post... Money? I wish!

Although our new web hire is pretty awesome and he's implementing a neat new community feature soon. When people ask questions, those who answer the question and help the OP out get EZ-Bucks! That's credits to be spent in our store. So the more helpful you are (i.e. rich and dave and others) will have credits to buy more things.

Also, those "things" are changing:D It's kind of exciting - I wish I could tell you all now. But I'm forbidden for a few more weeks. We'll announce Revolution on here before the press releases.