
NUC126
Aug. 08, 2018
Page
315
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
LXT
PLL
HCLKDIV
(CLK_CLKDIV0[3:0])
LIRC
HXT
Legend:
HXT: External 4~24 MHz High Speed Crystal
LXT: External 32.768 KHz Low Speed Crystal
PLL: PLL CLK
LIRC: Internal RC 10 KHz Low Speed Oscillator Clock
HIRC: Internal RC 22 MHz High Speed Oscillator Clock
HIRC48: Internal RC 48 MHz High Speed Oscillator Clock
Note:
Before clock switching, both the pre-selected and newly
selected clock sources must be turned on and stable.
GPIO clock sources the same as AHB bus clock.
HIRC48
÷ (H 1)
HCLKSEL
(CLK_CLKSEL0[2:0])
GPIOACKEN (CLK_AHBCLK[16])
GPIOA_CLK
GPIOB_CLK
GPIOC_CLK
GPIOD_CLK
GPIOE_CLK
GPIOF_CLK
GPIOBCKEN (CLK_AHBCLK[17])
GPIOCCKEN (CLK_AHBCLK[18])
GPIODCKEN (CLK_AHBCLK[19])
GPIOECKEN (CLK_AHBCLK[20])
GPIOFCKEN (CLK_AHBCLK[21])
000
001
010
011
100
111
HIRC
Figure 6.9-2 GPIO Clock Control Diagram
6.9.4
Basic Configuration
Clock Source Configuration
–
Enable GPIO peripheral clock in CLK_AHBCLK[21:16].
Reset Configuration
–
Reset GPIO controller in GPIORST (SYS_IPRST1[1]).
Pin Configuration
–
The GPIO pin functions are configured in SYS_PA_MFPL, SYS_PA_MFPH,
SYS_PB_MFPL, SYS_PB_MFPH, SYS_PC_MFPL, SYS_PC_MFPH,
SYS_PD_MFPL, SYS_PD_MFPH, SYS_PE_MFPL, SYS_PE_MFPH and
SYS_PF_MFPL registers.
6.9.5
Functional Description
6.9.5.1
Input Mode
Set MODEn (Px_MODE[2n+1:2n]) to 00 as the Px.n pin is in Input mode and the I/O pin is in tri-state
(high impedance) without output drive capability. The PIN (Px_PIN[n]) value reflects the status of the
corresponding port pins.
6.9.5.2
Push-pull Output Mode
Set MODEn (Px_MODE[2n+1:2n]) to 01 as Px.n pin is in Push-pull Output mode and the I/O pin
supports digital output function with source/sink current capability. The bit value in the corresponding