Download presentation
Presentation is loading. Please wait.
Published byMaurice Souter Modified over 9 years ago
1
MSP430 USART Afonso Ferreira Miguel
2
Características - Assíncrono
3
Operação USART In UART mode, the USART transmits and receives characters at a bit rate asynchronous to another device. Timing for each character is based on the selected baud rate of the USART. The transmit and receive functions use the same baud rate frequency.
4
Inicialização Set SWRST (BIS.B #SWRST,&UxCTL) Initialize all USART registers with SWRST = 1 (including UxCTL) Enable USART module via the MEx SFRs (URXEx and/or UTXEx) Clear SWRST via software (BIC.B #SWRST,&UxCTL) Enable interrupts (optional) via the IEx SFRs (URXIEx and/or UTXIEx) Failure to follow this process may result in unpredictable USART behavior.
5
Detecção de erros The USART module automatically detects framing errors, parity errors, overrun errors, and break conditions when receiving characters. The bits FE, PE, OE, and BRK are set when their respective condition is detected. When any of these error flags are set, RXERR is also set. The error conditions are described in Table:
6
Detecção de erros
7
UxCTL
8
UxTCTL
9
UxRCTL
10
UxBR0, UxBR1 e UxMCTL Ver arquivo Excel de configuração de Baud Rate
11
Byte de recepção
12
Byte de transmissão
13
Habilitação da recepção e transmissão da USART 0
14
Controle de dados enviados e recebidos
15
USART - Exemplo Configuração
16
USART - Exemplo Recebendo e Transmitindo
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.