All of them."Yes" to which question?
Hmmmm.All of them.
If the mcu is sourcing current and can't source more than what the LED is rated then there is no real need for a current limiting resistor.Where should I connect the current limiting resister--At the cathode or at the anode of LED,when
1)LED is connected in pulled up fashion and uC is sinking current.
2)LED is connected in pulled down fashion and uC is sourcing current.
I wouldn't recommend that approach unless there was a compelling reason.If the mcu is sourcing current and can't source more than what the LED is rated then there is no real need for a current limiting resistor.
It will also make r-m-w I/O operations (bsf, bcf etc) on midrange/baseline PICs problematic.I wouldn't recommend that approach unless there was a compelling reason.
First, the maximum current rating for the port is a merely a guarantee that it can supply at least that much. There is no spec on how much more it might be able to source.
Second, the actual amount it can source is going to vary with lots of things, including temperature, supply voltage, total supply current for the chip, how old the part is, exactly which pin is being used, how many other pins are also in a current-limiting mode, and on, and on.
Because the actual pad voltage is being read and not a buffered copy of the output port contents?It will also make r-m-w I/O operations (bsf, bcf etc) on midrange/baseline PICs problematic.
Here it depends on what "can't" means.If the mcu is sourcing current and can't source more than what the LED is rated then there is no real need for a current limiting resistor.
The usual definition is that it is the maximum current that the device is guaranteed to be able to deliver and that it can do so and still be guaranteed to operate within spec. For instance, when a digital output says it can source a maximum of 20mA when outputing a HI, that means that as long as you don't pull more than 20mA from it that the voltage at the output will remain above V_OHL over the entire range of operating conditions that is spec'ed. Any given part will usually supply noticeably more than that while maintaining the spec'ed voltage and quite a bit more still before it truly maxes out.Here it depends on what "can't" means.
One meaning is the pin has a maximum current it can safely deliver. In this case a resistor is required to limit current below this value.
Another possible meaning is the pin has a maximum current limit to the amount of current it can supply. If that limit is below what the LED is rated then no resistor is required.
Every device I have ever worked with has been spec'ed with the first definition. I am unaware of any device with a current limited output pin.