User: alciro    User
 Original    Translate to:  Deutsch  English  Français  中文  
 

Microcontroladores 8051

7.2. The serial port (UART)

Microcontrollers MCS-51 family have the hardware required to perform full duplex serial communication (transmit and receive simultaneously), by incorporating a UART or Universal Asynchronous Receiver and Transmitter (Universal Asynchronous Receiver-Transmitter).

The register SCON (98H, 152)

Record serial port settings .

MSB LSB
SM0 SM1 SM2 REN TB8 Rb8 IT RI
9FH 9EH 9Dh 9CH 9bh 9AH 99h 98H

SM0 - SM1. Selecting the operating mode of the serial port.

Mode SM0 SM1 Description Operating Speed
0 0 0 Shift Register set (clock / 12)
1 0 1 8-bit UART variable
2 1 0 9-bit UART set (clock / clock 64 or / 32)
3 1 1 9-bit UART variable

SM2. Special configuration of the operating modes.

  • Mode 0: SM2 has to remain at 0.
  • Mode 1: If SM2 is 1, RI is not activated unless it receives the Stop bit.
  • In modes 2 and 3: If SM2 is 1, enables multi-mode, and RI is not activated when the 9 th bit (Rb8) is 0.

REN. Reception control

0 -> Disable the reception.
1 -> Enable receiving characters.
Mode 0: 0 -> Air, 1 -> Front.

TB8. For communication with parity control, transmission.

Corresponding to 9 th bit (parity bit) to transmit communications of 9 bits with parity control in modes 2 and 3.

Rb8. For communication with parity check, receipt.

  • Mode 0: Not used.
  • Mode 1: Pick up the bit is Stop.
  • In modes 2 and 3: Get the 9th bit (parity bit).

IT. Indicator or transmission interrupt flag.

This flag indicates the end of the transmission of a character. Is activated at the start of the Stop bit.
0 mode is activated at the end of 8 th bit.
It should be clear by program.

RI. Indicator or receive interrupt flag.

This flag indicates the reception of a new character is available in SBUF. Is activated at the end of 8 th bit in Mode 0, and within the Stop bit in the other modes (with the exception of multiprocessor).
It should be clear by program.

Loading
copyright © 2007-2021  www.alciro.org  All rights reserved.         
Share |