Skip to main content
Contents Index
Search Book
Search Results:
No results.
Readability settings Prev Up Next
\(\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\R}{\mathbb R}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Subsection 3.3.2 Step 2: Enable the USART Clock
Just as GPIOA needed its clock enabled before we could write MODER or AFR, USART2 has its own clock that must be enabled before any of its registers can be configured. USART2’s clock is controlled by bit 17 (USART2EN) of
RCC_APBENR1.
Figure 3.3.7. RCC APB peripheral clock enable register (APBENR1). The USART2EN bit (bit 17) must be set before any USART2 register can be written.
// Enable USART2 clock on the APB bus
RCC->APBENR1 |= RCC_APBENR1_USART2EN;