Freescale Semiconductor MCF51QE128RM manual Module Initialization

Models: MCF51QE128RM

1 424
Download 424 pages 63.71 Kb
Page 293
Image 293

Chapter 15 Serial Communications Interface (S08SCIV4)

 

 

Module Initialization:

Write:

SCIxBDH:SCIxBDL

to set

baud rate

Write:

SCIxC1

to configure

1-wire/2-wire, 9/8-bit data, wakeup, and parity, if used.

Write;

SCIxC2

to configure

interrupts, enable Rx and Tx, RWU

 

 

 

Enable Rx wakeup, SBK sends break character

Write:

SCIxC3

to enable

Rx error interrupt sources. Also controls pin direction in

 

 

 

1-wire modes. R8 and T8 only used in 9-bit data modes.

Module Use:

Wait for TDRE, then write data to SCIxD

Wait for RDRF, then read data from SCIxD

A small number of applications will use RWU to manage automatic receiver wakeup, SBK to send break characters, and R8 and T8 for 9-bit data.

SCIxBDH

SCIxBDL

SCIxC1

SCIxC2

SCIxS1

SCIxS2

SCIxS3

SCIxD

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LBKDIE

 

RXEDGIE

 

 

 

SBR12

 

SBR11

SBR10

 

SBR9

 

SBR8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SBR7

 

SBR6

 

SBR5

 

SBR4

 

SBR3

 

 

SBR2

 

SBR1

 

SBR0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Baud rate = BUSCLK / (16 x SBR12:SBR0)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LOOPS

 

SCISWAI

 

RSRC

 

M

 

WAKE

 

 

ILT

 

PE

 

PT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Module configuration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIE

 

TCIE

 

RIE

 

ILIE

 

TE

 

 

RE

 

RWU

 

SBK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Local interrupt enables Tx and Rx enable

 

 

 

 

Rx wakeup and send break

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TDRE

 

TC

 

RDRF

 

IDLE

 

OR

 

 

NF

 

FE

 

PF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interrupt flags

 

 

 

 

 

Rx error flags

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LBKDIF

 

RXEDGIF

 

 

 

RXINV

 

RWUID

 

 

BRK13

 

LBKDE

 

RAF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Configure LIN support options and monitor receiver activity

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R8

 

T8

 

TXDIR

 

TXINV

 

ORIE

 

 

NEIE

 

FEIE

 

PEIE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9th data bits

 

 

 

 

 

Local interrupt enables

 

 

 

 

 

 

 

Rx/Tx pin

Tx data path

 

 

 

 

 

 

 

 

 

 

 

direction in

polarity

 

 

 

 

 

 

 

 

 

 

 

 

single-wire

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7/T7

 

R6/T6

 

R5/T5

 

R4/T4

 

R3/T3

 

 

R2/T2

 

R1/T1

 

R0/T0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read: Rx data; write: Tx data

 

 

 

 

 

 

 

 

 

 

 

Figure 15-2. SCI Module Quick Start

MCF51QE128 MCU Series Reference Manual, Rev. 3

Freescale Semiconductor

293

Get the latest version from freescale.com

Page 293
Image 293
Freescale Semiconductor MCF51QE128RM manual Module Initialization