Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sourcing and Sinking

Status
Not open for further replies.

DigiTan

New Member
What exactly does sinking mean when you're talking about a logic device's output? Is "sourcing/sinking" similar to "fan-in/fan-out" in any way?

Here's what I mean...(from an AVR datasheet)...
Port B is an 8-bit bi-directional I/O port. Port pins can provide internal pull-up resistors
(selected for each bit). PB0 and PB1 also serve as the positive input (AIN0) and the
negative input (AIN1), respectively, of the On-chip Analog Comparator. The Port B output
buffers can sink 20 mA and can drive LED displays directly. When pins PB0 to PB7
are used as inputs and are externally pulled low, they will source current if the internal
pull-up resistors are activated. The Port B pins are tri-stated when a reset condition
becomes active, even if the clock is not active.
 
DigiTan said:
What exactly does sinking mean when you're talking about a logic device's output? Is "sourcing/sinking" similar to "fan-in/fan-out" in any way?

No, it's not.

Sourcing is actually providing power from the pin of the device, so if you connect an LED and resistor from the pin to ground and set the pin high - current will flow from the pin, through the LED and resistor down to ground. In this case, the pin is the 'source' of the power for the LED.

Sinking is the opposite, the LED and resistor are connected from the pin to the positive supply rail, when the pin is LOW current flows from the positive rail, through the LED and resistor and down through the pin to ground - so the 'source' is the positive rail, and the current 'sinks' to ground through the pin.

An open-collector output pin can only sink current, it's something you need to be aware of, PIC's often have one open-collector output pin, I don't know about AVR's?.
 
Ah, I see. That's a good explaination.

AVR's allow for open-collector inputs, so long as the internal pull-ups aren't enabled.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top