Docsity

Microprocessors: Serial Communications Interface (SCI) - Lessons 9, 10, Study notes of Microprocessors

Partial preview of the text

Download Microprocessors: Serial Communications Interface (SCI) - Lessons 9, 10 and more Study notes Microprocessors in PDF only on Docsity!

Revised: Aug 1, 2003

EE

Microprocessors

Lessons 9, 10

Serial Communications Interface

Revised: Aug 1, 2003

Overview

-^ Fundamentals and Terminology•^ Signals•^ Multiple Serial Interface•^ Serial Communications Interface (SCI) - Transmitter– Receiver– Registers -^ SCI Programming•^ RS-232 interface

Revised: Aug 1, 2003

Fundamentals and Terminology (cont)• ASCII - American Standard Code for Information Interchange

"Copyright of Motorola, Used by Permission"

Revised: Aug 1, 2003

Fundamentals and Terminology (cont)• Parity bit - used to detect a single error– odd parity: odd number of ones in character– even parity: even number of ones in character• Simplex: transmit or receive data, notsimultaneously

Revised: Aug 1, 2003

Serial Communications Interface (SCI)

Transmitter

Revised: Aug 1, 2003

Serial Communications Interface (SCI)

Receiver

Revised: Aug 1, 2003

SCI Baud Rate Control Registers

Revised: Aug 1, 2003

SCI Data Registers High/Low

Revised: Aug 1, 2003

SCI Programming

  • Revised: Aug 1,
  • SCI Control Registers 1,
    • Revised: Aug 1,
  • SCI Status Registers 1,
    • Revised: Aug 1,
  • Example (cont) SC1BDH, SC1BDL: SC1BDH = $00SC1BDL = $34 SC1CR1: M=0, (1 start, 1 stop,8 data bits) SC1CR2: TE =

Revised: Aug 1, 2003

Example (cont)

;SCI Initialization Example;Assume M = 8 MHz, 9600 BAUD;define register locations and masksSC1BDH = $00C

; Baud Register High location

SC1BDL = $00C

; Baud Register Low location

BAUD_HI = $

; Baud Register High mask

BAUD_LOW = $

; Baud Register Low mask

SC1CR1 = $00CA

; Control Register 1 location

SC1_CONT = $

; Control Register 1 mask

SC1CR2 = $00CB

; Control Register 2 location

SC1_MASK = $

; Control Register 2 mask

SC1SR1 = $00CC

; Status Register 1 location

SC1DRL = $00CF

; Data Register Low location

Revised: Aug 1, 2003

Example (cont)

;sci_init: initializes SCI system;Assume M = 8 MHz, 9600 BAUDsci_init:: LDAA

#BAUD_LOW

;set BAUD rate

STAA

SC1BDL

LDAA

#BAUD_HI

STAA

SC1BDH

LDAA

#SCI_CONT

;set MODE

STAA

SC1CR

LDAA

#SC1_MASK

;enable transmitter

STAA

SC1CR

LDAA

SC1SR

;clear TDRE bit - 2 step process

STAA

SC1DRL

;1: read SC1SR1, write SC1DRL

RTS^

;return from subsroutine

Revised: Aug 1, 2003

RS-232 Standard

-^ Electronic Industry Association (EIA) Standard•^ Evolved from 1960 standard - EIA-232-D•^ Four aspects: -^ Electrical specifications: voltage level, rise time, fall time–^ Functional specifications of each signal–^ Mechanical specifications: number of pins, connector shape,connector dimension–^ Procedural specifications -^ RS-232 voltage levels+12V0V -12V

idle^

idle

start^

data^

stop parity