Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

PM0222 Datasheet(PDF) 24 Page - STMicroelectronics

Part # PM0222
Description  Brain smart hub family
PDF  33 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

PM0222 Datasheet(HTML) 24 Page - STMicroelectronics

Back Button PM0222 Datasheet HTML 20Page - STMicroelectronics PM0222 Datasheet HTML 21Page - STMicroelectronics PM0222 Datasheet HTML 22Page - STMicroelectronics PM0222 Datasheet HTML 23Page - STMicroelectronics PM0222 Datasheet HTML 24Page - STMicroelectronics PM0222 Datasheet HTML 25Page - STMicroelectronics PM0222 Datasheet HTML 26Page - STMicroelectronics PM0222 Datasheet HTML 27Page - STMicroelectronics PM0222 Datasheet HTML 28Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 24 / 33 page
background image
UART
PM0222
24/33
DocID025476 Rev 1
9.3
Basic configuration
Before using the previous examples, the UART module has to be enabled in the CRMU
(see Section 3.1: Peripheral clock gating) and the correct mode has to be configured for the
corresponding IO (see Section 5.1.1: I/O mode).
There are four important registers:
UARTIBRD and UARTFBRD to configure the baud rate (see Section 9.2: Baud rate
calculation example or Brain reference manual, UART chapter, UARTFBRD register
description for more details)
UARTLCR_H to define the data size
UARTCR to enable the IP and the transmitter and receiver mode (both modes can be
enabled at the same time). A write to the transmit FIFO through the UARTDR register
triggers a transaction. A read from the receive FIFO through the UARTDR will return
the first data received.
This sequence below shows how to configure the UART to put it in receiver and transmitter
mode:
UART->UARTCR &= 0xFE; // disable the UART
UART-> UARTLCR_H &= 0x7; // disable and flush the FIFOs
UART->UARTCR |= 0x300; // UART in receiver and transmitter mode
UART-> UARTLCR_H |= 0x8; // enable the FIFOs
UART-> UARTLCR_H |= 0x60; // data transfer of 8 bits
UART->UARTIBRD = 0x1; // UART baud rate configuration, integer part
UART->UARTFBRD = 0x5; // UART baud rate configuration, fractional part
UART->UARTCR |= 0x1; // enable the UART
After this configuration the UART is able to work as a receiver and a transmitter, generating
a specific baud rate (see Section 9.2: Baud rate calculation example). To manage data
transfer, the UARTFR register contains a status bit concerning FIFO. A simple configuration
for a data transmission is:
- Wait until the UART busy flag (BUSY) goes low
- Write in the transmit FIFO to trigger the transaction and send data.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com