Microchip logo
  • All
  • Products
  • Documents
  • Applications Notes
×

8-Bit MCUs

Input and Output Features

As the most fundamental elements of every microcontroller (MCU), the Input/Output (I/O) pins serve as the device’s links to the outside world. Microchip PIC® and AVR® devices are designed to support industry-leading I/O controls and to provide innovative features that can take your products to the next level. Most of the features described below are standard on modern PIC and AVR MCUs.


Standard I/O Features

Tristate Control

Tristate control sets whether an I/O pin is a low-impedance output or a high-impedance, also called tri-stated, input. A pin that is tri-stated is an input that effectively turns off the output driver, making the pin an input. The ability to switch between the two modes of operation gives you choices in pin assignments. 

Analog or Digital Input

When using the I/O on an MCU, it is important to set whether an input is analog or digital. A digital input on a pin set for analog functions may cause unexpected or incorrect behavior due to the way the MCU tries to read the value. Likewise, reading an analog value on a pin set up for digital logic may add noise and error to the signal.

Open-Drain Output (PIC MCUs Only)

Open-drain logic is a type of active-low digital logic that supports multiple devices asserting a shared line at the same time. This type of logic is commonly used to indicate an interrupt or that data is ready. PIC MCUs have built-in open-drain output support that eliminates the need for an external transistor to enable denser system integration.

200713-MCU8-DIAG-Open-Drain-fig1

Figure 1 - Open Drain Output

Interrupt-on-Change

The Interrupt-on-Change (IOC) function on the I/O pins generates an interrupt based on a change in logic level. IOC is useful as a trigger to read data from a sensor or to indicate that a button has been pressed by the user.

Weak Pull-ups

Normally, switches and buttons have a pull-up resistor that ensures that when the button is not pressed (in the open state), the digital level of the I/O is defined to be at a logic 1. A weak (very-high-valued) pull-up resistor inside the MCU can be used in the same manner. 

200713-MCU8-DIAG-Internal-Pullups-fig2

Figure 2 - Weak Pull-ups

Schmitt Trigger

A Schmitt trigger is a type of digital input circuit that uses a positive-feedback threshold to determine whether a signal is a digital 1 or a digital 0. This can improve digital behavior with signals that bounce or that are temporarily at an undefined logic level.

 

Advanced Features

Our MCUs are available with advanced I/O features to improve their usability in a variety of applications. Advanced features vary by device. Please check the device family data sheet for more information.

Input Threshold Control

Ordinarily, an MCU’s operating voltage determines the threshold levels required for proper reception of a digital signal. However, input threshold controls allow an MCU that is running at a higher voltage to correctly receive a lower-voltage digital signal.

Slew Rate Control

The slew rate control registers offer the ability to increase the rise and fall time of a logic signal. Slowing the speed of the edges can reduce the electromagnetic interference generated by the sudden change in output. 
200713-MCU8-DIAG-Slew-Rate-fig3

Figure 3 – Rise and Fall Time in Waveforms

High-Current I/O (PIC MCUs Only)

High-current I/O allows the MCU’s I/O pins to sink or source up to 100 mA of current. Generally, the limit on MCUs is approximately 20 mA.

Peripheral Pin Select (PIC MCUs Only)

Peripheral Pin Select (PPS) is an advanced feature available in many PIC MCUs that allows for rerouting of digital peripheral I/O from a default location to a developer-selected location on the device. PPS can be used to simplify PCB layouts or to resolve signal connection issues. The PPS registers can be locked in place, preventing unwanted changes to the registers.

PORTMUX (AVR MCUs Only)

Available on AVR devices, the PORTMUX feature allows an alternative pin assignment for many of the on-board peripherals, similar to PPS operates on PIC devices.

Multi-Voltage I/O (AVR MCUs Only)

Multi-Voltage I/O (MVIO) allows the MCU to interface with digital inputs or outputs at a different operating voltage than the device. MVIO is designed to operate independently of both the core and auxiliary power supplies. If either supply loses power, then the MVIO pins are tri-stated.
200713-MCU8-DIAG-MVIO-fig4

Figure 4 – Example System with MVIO

Virtual Ports (AVR MCUs Only)

Virtual ports are mirrored copies of the PORT registers. Unlike the standard PORT registers, the virtual ports can be modified by bit manipulation instructions and can access a single bit in one cycle.

 

Special Pins

Reset (AVR MCUs Only)

AVR devices feature an active-low RESET line which, when held low, will reset the MCU. An internal pull-up resistor is built into the MCU, eliminating the need for an external pull-up resistor in most cases. Please consult the device data sheet for more information on RESET.

MCLR (PIC MCUs Only)

PIC devices utilize an active-low master clear (MCLR) line to reset the MCU. MCLR is also required for programming and debugging. The MCLR line must have an external pull-up resistor to VDD. Please consult the device data sheet for more information on MCLR.

I2C Pins (PIC MCUs Only)

Some of the I/O pins on PIC devices are special versions of standard I/O that have improved I2C or 2-wire bus performance. The enhancements on these pins include faster slew rates, stronger internal pull-ups and selectable thresholds for standardized I2C and SMBus interfaces.