전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

PM0222 데이터시트(PDF) 24 Page - STMicroelectronics

부품명 PM0222
상세설명  Brain smart hub family
PDF  33 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  STMICROELECTRONICS [STMicroelectronics]
홈페이지  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

PM0222 데이터시트(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


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
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