Serial port - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Serial port

Description:

Baud rate: number of possible level transitions per second. Unit baud ... T 1/baud. T s/bit. 11 bits, 11 T s/bit. Serial port. Peripheral. TxD. RxD. C/GND. UART ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 24
Provided by: jankar
Category:
Tags: baud | port | serial

less

Transcript and Presenter's Notes

Title: Serial port


1
Serial port
  • Communicating
  • via the serial port

2
Serial ports
  • 1 bit wide
  • Simple, but slow

3
Serial port
TxD
RxD
?P
Peripheral
C/GND
4
Signal transmission
01110010
signal
MSB
LSB
1
0
t (s)
1 byte (data)
5
Transmission modes
  • Synchronoussynchronized by bytes or clock
    signal line
  • Asynchronousevery byte transmitted is
    synchronized by start and stop bits

6
Signal transmission
Bit transfer time
Signal (level)
Start bit
Parity bit
1
Stop bit
0
t (s)
8 data bits
7
Start bit
  • Used to synchronize receiver
  • Level 0 since idle is level 1

8
Stop bit(s)
  • 1 (, 1.5) or 2 bits
  • Level 1 to ensure return to idle (level 1)

9
Parity bit
  • 1 bit to ensure reliable transfer of data
  • Even paritydata bits and parity bit should
    contain even number of 1s
  • Odd paritydata bits and parity bit should
    contain odd number of 1s

10
Transfer rates
  • Bit rate number of bits transferred per second
    including start, parity and stop bits. Unit
    bits/s
  • Baud rate number of possible level transitions
    per second. Unit baud
  • Data bit rate number of data bits transferred
    per second.

11
Transfer rates
Signal (level)
T 1/baud
T s/bit
Start bit
Parity bit
1
Stop bit
0
8 data bits, 8 T s/data bit
t (s)
11 bits, 11 T s/bit
12
Serial port
TxD
8
Data bus
?P
RxD
Peripheral
UART
Address and control bus
C/GND
13
UARTUniversal Asynchronous Receiver Transmitter
  • Transmit register
  • Receive register
  • Buffers
  • Control register
  • Status register

14
Transmit register
  • Contains byte to send
  • Byte is shifted out with least significant bit
    first

15
Receive register
  • Contains last received byte
  • Least significant byte is shifted in first
  • Considered empty until last (most significant)
    bit is received

16
Buffers
  • Internal in UART
  • Receive buffer contains received bytes
  • Transmit buffer contains bytes to transmit

17
Control register
  • Number of databits (5, 6, 7 or 8),
  • Parity (none, even, odd),
  • Number of stop bits (1, 1.5, 2),
  • Baudrate (multiple of 150 up to 230400, e.g.
    9600)
  • Receive enable

18
Control register
  • Interrupt (received byte, transmit buffer empty)
  • Interrupt level register (at which level will
    interrupt occur)

19
Status register
  • Receive register full (byte received)
  • Transmit register empty
  • IRQ (Interrupt Request)
  • Error bits

20
Status register error bits
  • Parity error the parity bit was not according to
    specification, i.e. a bit was not correctly
    transmitted.
  • Overrun error the processor did not read
    received byte until after the next byte arrived
    (byte overwritten by next byte)
  • Framing error mismatch between start bit and
    stop bit(s)

21
RS-232-C
  • A standard for asynchronous serial communication
  • Standardized by EIA (Electronics Industry
    Association)

22
RS-232-C
  • 1 is transmitted as 12 volt (lt -3 volt)
  • 0 is transmitted as 12 volt (gt 3 volt)
  • A voltage level converter is needed between
    TTL-levels (0, 5 volt) and RS-232-C-levels (12,
    -12 volt)

23
RS-232-C serial port
TxD
8
TxD
Data bus
?P
RxD
Voltage level converter
RxD
Peripheral
UART
Address and control bus
C/GND
C/GND
Write a Comment
User Comments (0)
About PowerShow.com