Hi,
Can any one clarify the generl digital output behaiour of a 5V PIC, I've strugled to find clarification in the data sheet.
I know there are a lot of specific bahaviour for certain pins but for a general purpose I/O pin
I'm setting the pin as a digital output to drive an LED and using FC component to toggle its state.
I think the bahviour is...
Output set to OFF will the pin Sink 25mA to ground.
Output Set to ON will the pin Souce 25mA to Vcc (5v).
or is this incorrent, it will only activly drive a single polatiry and I'm just measuring a weak internal pull up / down resistor somewhere?
Is there a better component for general toggling of digital pins?
Thanks for any help...got myself confused on this simple issue.
J.
Digital Outputs - On Off states
Re: Digital Outputs - On Off states
If I do have status LED's attached, does it make sense to Source 5V from the Pin, grounding the other side.
The logic of the component does then tie up with the LED hardware.
I've gotten so used to old micros prefering to sink current, this alternative of high side driving feels odd.
J.
The logic of the component does then tie up with the LED hardware.
I've gotten so used to old micros prefering to sink current, this alternative of high side driving feels odd.
J.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Digital Outputs - On Off states
The outputs will source or sink up to 25mA (Output high/low)
This is a maximum, the PIC does not do the limiting, you still need a resistor in series to ensure 25mA is not exceeded.
(At this current the PIC output is going to be less than 5v)
Ah, someone else who remembers fun with NMOS processors
This is a maximum, the PIC does not do the limiting, you still need a resistor in series to ensure 25mA is not exceeded.
(At this current the PIC output is going to be less than 5v)
Ah, someone else who remembers fun with NMOS processors
Last edited by LeighM on Mon Sep 21, 2020 11:40 am, edited 1 time in total.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Digital Outputs - On Off states
These is not correct.
If output is low then can only sink from VDD
If the output is high it can only source to ground.
Martin
Re: Digital Outputs - On Off states
Thanks,
yep.. Limiting resistors all in place.
So your average PIC micro generally does not have a preference over Sink or Source?
Have I gotten my sink and source terms confused then?
I thought;
If a pin can Sink current I thought it would act like a mini ground (Vss).
If a pin can source I thought it would act like a mini 5V (Vdd).
I think my previous experiance is misleading me..I've gotten so used to an active pin being pulled hard low.
The FC LED compoent, OFF drives the pin Low (near 0v) and ON drives the pin High (5v)
J.
yep.. Limiting resistors all in place.
So your average PIC micro generally does not have a preference over Sink or Source?
Have I gotten my sink and source terms confused then?
I thought;
If a pin can Sink current I thought it would act like a mini ground (Vss).
If a pin can source I thought it would act like a mini 5V (Vdd).
I think my previous experiance is misleading me..I've gotten so used to an active pin being pulled hard low.
The FC LED compoent, OFF drives the pin Low (near 0v) and ON drives the pin High (5v)
J.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Digital Outputs - On Off states
Presumably you meant "Output Set to ON will the pin Souce 25mA FROM Vcc"Output Set to ON will the pin Souce 25mA to Vcc (5v).
Which would be correct
Re: Digital Outputs - On Off states
I think my frame of reference is wrong somewhere...thats the problem of not learning this stuff academically.
I'm missing something but I dont have the technical vocabulary to explain the issue clearly.
I'll have to do some more googling. J.
I'm missing something but I dont have the technical vocabulary to explain the issue clearly.
I'll have to do some more googling. J.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: Digital Outputs - On Off states
You are correct in that the PIC does not have a preference over Sink or Source, due to CMOS design
So when configured as an output, both low (0) and high (1) are active drivers
Hope that helps
So when configured as an output, both low (0) and high (1) are active drivers
Hope that helps