11.3 Functional Description
11.3.1 Port I/O Modes of Operation
Port pins are configured by firmware as digital or analog I/O using the special function registers. Port I/O initialization consists of the
following general steps:
1. Select the input mode (analog or digital) for all port pins, using the Port Input Mode register (PnMDIN).
2. Select the output mode (open-drain or push-pull) for all port pins, using the Port Output Mode register (PnMDOUT).
3. Select any pins to be skipped by the I/O crossbar using the Port Skip registers (PnSKIP).
4. Assign port pins to desired peripherals.
5. Enable the crossbar (XBARE = 1).
A diagram of the port I/O cell is shown in the following figure.
GND
VDD
VDD
(WEAK)
PORT
PAD
To/From Analog
Peripheral
PxMDIN.x
(1 for digital)
(0 for analog)
Px.x – Output
Logic Value
(Port Latch or
Crossbar)
XBARE
(Crossbar
Enable)
Px.x – Input Logic Value
(Reads 0 when pin is configured as an analog I/O)
PxMDOUT.x
(1 for push-pull)
(0 for open-drain)
WEAKPUD
(Weak Pull-Up Disable)
Figure 11.2. Port I/O Cell Block Diagram
Configuring Port Pins For Analog Modes
Any pins to be used for analog functions should be configured for analog mode. When a pin is configured for analog I/O, its weak pull-
up, digital driver, and digital receiver are disabled. This saves power by eliminating crowbar current, and reduces noise on the analog
input. Pins configured as digital inputs may still be used by analog peripherals; however this practice is not recommended. Port pins
configured for analog functions will always read back a value of 0 in the corresponding Pn Port Latch register. To configure a pin as
analog, the following steps should be taken:
1. Clear the bit associated with the pin in the PnMDIN register to 0. This selects analog mode for the pin.
2. Set the bit associated with the pin in the Pn register to 1.
3. Skip the bit associated with the pin in the PnSKIP register to ensure the crossbar does not attempt to assign a function to the pin.
EFM8UB3 Reference Manual
Port I/O, Crossbar, External Interrupts, and Port Match
silabs.com
| Building a more connected world.
Rev. 0.2 | 95