What is open drain digital output?

What is open drain digital output?

An open-drain or open-collector output pin is driven by a single transistor, which pulls the pin to only one voltage (generally, to ground). When the output device is off, the pin is left floating (open, or hi-z).

What is open drain configuration?

The term “open drain” means there’s a current sink, but on a FET device, for example, a MOSFET. (A MOSFET is like a transistor that can handle higher voltages but operates in much the same way.) The term “open collector” refers to a current sink on a transistor output.

When does the input pin read as 0 on a PIC32?

When a pull-down is enabled, an input pin reads as 0 when no external voltage source is connected to the pin. The pull-ups and pull-downs are enabled using the CNPUx and CNPDx registers. The PIC32 documentation states that weak pull-ups and pull-downs should be disabled when a pin is used for digital output.

Can a weak pin be disabled on a PIC32?

The PIC32 documentation states that weak pull-ups and pull-downs should be disabled when a pin is used for digital output. This could be your only UNC Asheville class where pull-ups are discussed. Some digital output pins can be set to “drain” their lines.

Can a digital pin be used for both input and output?

A digital pin can be used for either input or output. By default, digital pins are set for output when the pin is configured for digital I/O using ANSELx . The input or output setting is controlled using the TRISx registers. “TRIS” is an abbreviation for TRI-STATE®, a registered trademark of National Semiconductor.

What’s the name of the SFR on the PIC32?

The SFR’s used to control the pins are known by special names, such as TRISA and TRISB. Note the are different names for the two ports. In PIC32 documentation, the name TRISx will be used to refer to either the TRISA and TRISB SFR. Each SFR has a unique address.