Docsity

Serial - Introduction to Microprocessor Systems - Lecture Sli, Lecture notes of Computer Science

Partial preview of the text

Download Serial - Introduction to Microprocessor Systems - Lecture Sli and more Lecture notes Computer Science in PDF only on Docsity!

Topics

• Serial I/O

  • Serial data transfer concepts
  • Asynchronous and synchronous transfers
  • UARTs
    • UART Interrupts
  • Circular buffering
  • RS-232 and flow control

• ADuC7026 Serial Peripherals

  • UART
  • SPI
  • I 2

C

Serial I/O Concepts

• Serial communication transmits data one bit at a

time.

• Why?

  • Data transfers over long distances
  • Reduced pin and interconnection count
  • Easier to route with switches
  • Eliminates parallel bus skew issues

• Terminology

  • Communications channel
  • Simplex vs. duplex
  • Transmission rates
  • Information codes
  • Data Frames

Asynchronous vs. Synchronous

• Asynchronous Communication

– No common clock signal between transmitter

and receiver

– Synchronization must be established on a per

frame basis

– Example – RS

• Synchronous Communication

– Clock is transmitted in addition to data, or is

recovered from data signal

– Often includes a framing signal as well

– Example – I

2

S

Asynchronous Data Transfer

• RS-232 signal phases

– Idle

– Start bit

– Data

– Parity

– Stop bit – channel returns to idle condition

– Idle or Start next frame

IDLE START D0 D1 D2 D3 D4 D5 D6 P STOP IDLE or START

UART Interrupts

• UARTs often can generate interrupts for a

number of conditions

– Receive data ready

– Receive data error

  • Framing, parity, overrun

– Modem signal status changes

– Transmitter buffer and/or shifter empty

  • Issues using the transmit interrupt
    • Edge versus level interrupts
    • Loading the transmitter queue

Circular Buffering

• Implement simple FIFO queueing in software to

minimize data movement.

• Some CPUs (especially DSPs) implement circular

addressing modes in hardware for speed.

Flow Control

• A serial channel may deliver data faster

than the receiving device can process.

• Flow control gives the receiver a way to

signal the transmitter to stop transmission.

• Flow control can be implemented as

– Software

  • XON/XOFF flow control protocol

– Hardware

  • RTS/CTS

ADuC7026 Serial Peripherals

• There are 4 serial peripherals on the ADuC7026; a

UART and 3 synchronous ports (SPI and I

2

C)

• There are ten pins that are used by the serial

peripherals in two modes

ADuC7026 SPI Port

• The Serial Peripheral Interface (SPI) port can be

configured as a master or slave (shown below)

  • SPI consists of 2 unidirectional data lines, a clock line, and

a chip select line

  • The master generates the clock and select signals, so it

controls when/if transfers occur

ADuC7026 I

C Ports

• The Inter-Integrated Circuit (I

2

C) ports can operate as

master or slave

  • I 2

C supports multi-master buses using just 2 bidirectional

lines (clock and data)

  • Both use open-drain drivers and pull-up resistors
  • Collisions can occur without damage – recognized when a line will not return high after it is released

Asynchronous Communications -

RS232 Framing

Back

What do you need to know in order to figure

out what the data is?

Synchronous Communications

Back

frame

Serial Communications Standards

Back

RS-232 Connectors

Back