Gpio And Alternate Function (Gpio/Afio); Gpio Module Basic Structure Block Diagram - WCH CH32V003 Series Reference Manual

Table of Contents

Advertisement

CH32V003 Reference Manual
Chapter 7 GPIO and Alternate function (GPIO/AFIO)
The GPIO port can be configured for multiple input or output modes, with built-in pull-up or pull-down
resistors that can be turned off, and can be configured for push-pull or open-drain functions. the GPIO port
can also be multiplexed for other functions.
7.1 Main features
Each pin of the port can be configured to one of the following multiple modes.
l
Floating input
l
Pull-up input
l
Dropdown input
l
Analog input
Many pins have multiplexing capabilities, and many other peripherals map their output and input channels to
these pins. The specific usage of these multiplexed pins needs to be referred to the individual peripherals, and
the content of whether these pins are multiplexed and remapped is explained in this chapter.
7.2 Function description
7.2.1 Overview
Analog Input
To on-chip
peripheral
Alternate Function Input
Read
Bit set/reset
Write
registers
Read/write
from on-chip
Alternate Function Output
peripheral
As shown in Figure 7-1 I/O port structure, each pin has two protection diodes inside the chip, and the I/O port
can be divided into input and output driver modules internally. Among them, the input driver has a weak pull-
up and pull-down resistor optional, which can be connected to AD and other analog input peripherals; if the
input is to a digital peripheral, it needs to go through a TTL Schmitt trigger and then connect to GPIO input
registers or other multiplexed peripherals. The output driver has a pair of MOS tubes, and the I/O port can be
configured as open-drain or push-pull output by configuring whether the upper and lower MOS tubes are
enabled or not; the output driver can also be configured internally to control the output by GPIO or by other
multiplexed peripherals.
V1.3
Figure 7-1 GPIO module basic structure block diagram
Input data
register
TTL Schmitt
trigger
Input driver
Output driver
Output data
register
l
Open drain output
l
Push-pull output
l
Multiplexing the inputs and outputs of
functions
V
DD
on/off
on/off
on/off
on/off
V
SS
V
DD
P-MOS
Output
control
N-MOS
V
SS
Push-pull,
open-drain or
disabled
50
http://wch.cn
V
DD
Protection
diode
I/O pin
Protection
diode
V
SS

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents

Save PDF