Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prof Afonso Ferreira Miguel

Similar presentations


Presentation on theme: "Prof Afonso Ferreira Miguel"— Presentation transcript:

1 Prof Afonso Ferreira Miguel
USART 8051 Prof Afonso Ferreira Miguel

2 Microcontrolador 8051 (MCS-51) Interface Serial
Full duplex UART. Four modes of operation: Synchronous serial I/O expansion. Asynchronous serial I/O with variable baud rate. Nine bit mode with variable baud rate. Nine bit mode with fixed baud rate. 10 or 11 bit frames. Interrupt driven or polled operation. Registers: SCON - Serial port control register. SBUF - Read received data. - Write data to be transmitted. PCON - SMOD bit.

3 Microcontrolador 8051 (MCS-51) Interface Serial: Modos
TXD and RXD are the serial output and input pins (Port 3, bits 1 and 0). Mode 0: Shift Register Mode. Serial data is transmitted/received on RXD. TXD outputs shift clock. Baud Rate is 1/12 of clock frequency; Mode 1: 10-bits transmitted or received. Start (0), 8 data bits (LSB first), and a stop bit (1). Baud Rate Clock is variable using Timer 1 overflow or external count input. Can go up to 104.2KHz (20MHz osc.); Mode 2: 11-bits transmitted or received. Start (0), 8 data bits (LSB first), programmable 9th bit, and stop bit (1). Baud Rate programmable to either 1/32 or 1/64 oscillator frequency (625KHz for 20MHz osc.); Mode 3: 11-bit mode. 9 data bits; Baud Rate variable using Timer 1 overflow or external input KHz max. (20 MHz osc.).

4 Microcontrolador 8051 (MCS-51)
SCON

5 Microcontrolador 8051 (MCS-51)

6 Microcontrolador 8051 (MCS-51)
Configuração

7 Microcontrolador 8051 (MCS-51)
Rotinas típicas para TX e RX um byte

8 Microcontrolador 8051 (MCS-51)
Rotina típica para transmitir uma string

9 Microcontrolador 8051 (MCS-51)
Utilizando a rotina anterior: Definindo a string em memória


Download ppt "Prof Afonso Ferreira Miguel"

Similar presentations


Ads by Google