PIC18F the right way to light a led

Thread Starter

Topad

Joined Nov 30, 2021
24
Hi, I have pic18f with ports can sink or source max 20-25ma. I like to light up a red led rated 2v at 20ma. Of course with less current foward volatge might not be 2v anymore proabaly less. What would be a good current and resitor value to drive the red led from the i/o pin without the use of a transitor just simple led with with the pin as the source. Thank you. I currently have it at 7-9ma with a 350 ohms. Is this current too much for the i/pin in the long run or not even close knowing the max is 20ma?
 

boostbuck

Joined Oct 5, 2017
1,034
About 10mA would be a good choice. 350 Ohms seems about right. Max is 20mA so you are only at half.

If you run LEDs from a number of pins there is an issue of the TOTAL current taken (sum of all pins in use) exceeding the allowed limit for the chip.
 

Thread Starter

Topad

Joined Nov 30, 2021
24
Thank you @boostbuck yes not more than 10ma will be use and only using two leds two pins which will be less than 20ma in total, less 10ma in each pin. I seen many examples were they ususally just pick a 300 ohms or 330 ohms.
 

MaxHeadRoom

Joined Jul 18, 2013
30,558
What is a FETLington? All the disadvantages of FETs and Darlingtons?
It was a marketing ploy when Siliconix trademarked the Mosfet 2n7000.
The word "FETlington" is a reference to the Darlington-transistor-like saturation characteristic.
I have been using them since their inception.
 

Attachments

Last edited:
Top