Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Сигнальный МП Motorola DSP56002.pdf
Скачиваний:
21
Добавлен:
26.05.2014
Размер:
2.28 Mб
Скачать

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SERIAL COMMUNICATION INTERFACE (SCI)

6.3.3Register Contents After Reset

There are four methods to reset the SCI. Hardware or software reset clears the port control register bits, which configure all I/O as general-purpose input. The SCI will remain in the reset state while all SCI pins are programmed as general-purpose I/O (CC2, CC1, and CC0=0); the SCI will become active only when at least one of the SCI I/O pins is programmed as not general-purpose I/O.

During program execution, the CC2, CC1, and CC0 bits may be cleared (individual reset), which will cause the SCI to stop serial activity and enter the reset state. All SCI status bits will be set to their reset state; however, the contents of the interface control register are not affected, allowing the DSP program to reset the SCI separately from the other internal peripherals.

The STOP instruction halts operation of the SCI until the DSP is restarted, causing the SSR to be reset. No other SCI registers are affected by the STOP instruction. Table 6-2 illustrates how each type of reset affects each register in the SCI.

6.3.4SCI Initialization

The correct way to initialize the SCI is as follows:

1.Hardware or software reset

2.Program SCI control registers

3.Configure SCI pins (at least one) as not general-purpose I/O

Figure 6-14 and Figure 6-15 show how to configure the bits in the SCI registers. Figure 6-14 is the basic initialization procedure showing which registers must be configured. (1) A hardware or software reset should be used to reset the SCI and prevent it from doing anything unexpected while it is being programmed. (2) Both the SCI interface control register and the clock control register must be configured for any operation using the SCI. (3)

The pins to be used must then be selected to release the SCI from reset and (4) begin operation. If interrupts are to be used, the pins must be selected, and interrupts must be enabled and unmasked before the SCI will operate. The order does not matter; any one of these three requirements for interrupts can be used to finally enable the SCI.

Figure 6-15 shows the meaning of the individual bits in the SCR and SCCR. The figures below do not assume that interrupts will be used; they recommend selecting the appropriate pins to enable the SCI. Programs shown in Figures Figure 6-20, Figure 6-21, Figure

6-28, Figure 6-34, and Figure 6-36 control the SCI by enabling and disabling interrupts.

Either method is acceptable.

MOTOROLA PORT C 6 - 31

For More Information On This Product, Go to: www.freescale.com

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SERIAL COMMUNICATION INTERFACE (SCI)

Table 6-2 SCI Registers after Reset

Register

Bit

Bit Number

 

Reset Type

 

 

 

 

 

Bit

Mnemonic

 

 

 

 

HW Reset

SW Reset

IR Reset

ST Reset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SCKP

15

0

0

 

STIR

14

0

0

 

TMIE

13

0

0

 

TIE

12

0

0

 

RIE

11

0

0

 

ILIE

10

0

0

 

TE

9

0

0

SCR

RE

8

0

0

 

WOMS

7

0

0

 

RWU

6

0

0

 

WAKE

5

0

0

 

SBK

4

0

0

 

SSFTD

3

0

0

 

WDS (2–0)

2–0

0

0

 

 

 

 

 

 

 

 

R8

7

0

0

0

0

 

FE

6

0

0

0

0

 

PE

5

0

0

0

0

SSR

OR

4

0

0

0

0

 

IDLE

3

0

0

0

0

 

RDRF

2

0

0

0

0

 

TDRE

1

1

1

1

1

 

TRNE

0

1

1

1

1

 

 

 

 

 

 

 

 

TCM

15

0

0

 

RCM

14

0

0

SCCR

SCP

13

0

0

 

COD

12

0

0

 

CD (11–0)

11–0

0

0

 

 

 

 

 

 

 

SRX

SRX (23–0)

23–16, 15–8, 7–0

 

 

 

 

 

 

 

STX

STX (23–0)

23–0

 

 

 

 

 

 

 

SRSH

SRS (8–0)

8–0

 

 

 

 

 

 

 

STSH

STS (8–0)

8–0

 

 

 

 

 

 

 

NOTES:

SRSH – SCI receive shift register, STSH – SCI transmit shift register HW – Hardware reset is caused by asserting the external RESET pin. SW – Software reset is caused by executing the RESET instruction.

IR – Individual reset is caused by clearing PCC (bits 0–2) (configured for general-purpose I/O). ST – Stop reset is caused by executing the STOP instruction.

1 – The bit is set during the xx reset.

0 – The bit is cleared during the xx reset.

– – The bit is not changed during the xx reset.

Table 6-3 (a) through Table 6-4 (b) provide the settings for common baud rates for

6 - 32 PORT C MOTOROLA

For More Information On This Product, Go to: www.freescale.com

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SERIAL COMMUNICATION INTERFACE (SCI)

1.PERFORM HARDWARE OR SOFTWARE RESET.

2.PROGRAM SCI CONTROL REGISTERS:

a)SCI INTERFACE CONTROL REGISTER — X:$FFF0

b)SCI CLOCK CONTROL REGISTER — X:$FFF2

3.CONFIGURE AT LEAST ONE PORT C CONTROL BIT AS SCI.

 

23

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PORT C CONTROL

X:$FFE1

0

 

0

0

 

0

0

0

0

0

0

0

0

 

0

0

0

0

CC

CC

CC

CC

CC

CC

CC

 

CC

 

 

 

 

8

 

 

7

 

 

6

 

 

5

 

 

4

 

 

3

 

2

 

1

 

 

0

 

REGISTER (PCC)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SCLK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SCI

 

 

 

TXD

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RXD

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CCx

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0GPIO

1Serial Interface

4. SCI IS NOW ACTIVE.

Figure 6-14 SCI Initialization Procedure

the SCI. The asynchronous SCI baud rates show a baud rate error for the fixed oscillator frequency (see Table 6-3 (a)). These small-percentage baud rate errors should allow most UARTs to synchronize. The synchronous applications usually require exact frequencies, which require that the crystal frequency be chosen carefully (see Table 6-4 (a) and Table 6-4 (b)).

An alternative to selecting the system clock to accommodate the SCI requirements is to provide an external clock to the SCI. For example, a 2.048 MHz bit rate requires a CPU clock of 32.768 MHz. An application may need a 40 MHz CPU clock and an external clock for the SCI.

MOTOROLA PORT C 6 - 33

For More Information On This Product, Go to: www.freescale.com

34 - 6

More For

Information

.wwwGoto:

PORT

freescale

C

On

This

com.

 

Product,

MOTOROLA

Freescale Semiconductor, Inc.

STEP 2a. SELECT SCI OPERATION:

FOR A BASIC CONFIGURATION, SET:

SCKP

BIT 15 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE/DISABLE

 

 

STIR

BIT 14 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

TRANSMIT INTERRUPT

 

 

TMIE

BIT 13 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE = 1

 

 

ILIE

BIT 10 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

DISABLE = 0

 

 

RWU

BIT

6 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WAKE

BIT

5 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE/DISABLE

 

 

SBK

BIT

4 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE INTERRUPT

 

 

SSFTD —

BIT

3 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DISABLE = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE/DISABLE

(SCI) INTERFACE COMMUNICATION SERIAL

Inc Semiconductor, Freescale

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TRANSMIT DATA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DISABLE = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE/DISABLE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE DATA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ENABLE = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DISABLE = 0

 

 

 

 

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

X:$FFF0

SCKP

STIR

TMIE

TIE

RIE

ILIE

TE

RE

WOMS

RWU

WAKE

SBK

SSFTD

WDS2

WDS1

WDS0 SCIINTERFACECONTROLREGISTER(SCR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

000

= 8-BIT SYNCHRONOUS DATA (SHIFT REGISTER MODE)

 

 

 

 

 

 

 

 

 

 

 

WIRED - OR MODE

001

= RESERVED

 

 

 

 

 

 

 

 

 

 

 

 

 

 

010

= 10-BIT ASYNCHRONOUS (1 START, 8 DATA, 1 STOP)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MULTIDROP = 1

011

= RESERVED

 

 

 

 

 

 

 

 

 

 

 

 

 

 

100

= 11-BIT ASYNCHRONOUS (1 START, 8 DATA, EVEN PARITY, 1 STOP)

 

 

 

 

 

 

 

 

 

 

 

POINT TO POINT = 0

 

 

 

 

 

 

 

 

 

 

 

101

= 11-BIT ASYNCHRONOUS (1 START, 8 DATA, ODD PARITY, 1 STOP)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

110

= 11-BIT MULTIDROP (1 START, 8 DATA, EVEN PARITY, 1 STOP)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

111

= RESERVED

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 2a

Figure 6-15 SCI General Initialization Detail – Step 2 (Sheet 1 of 2)

MOTOROLA

More For

Information

.wwwGoto:

PORT

freescale

C

On

This

com.

 

Product,

35 - 6

Freescale Semiconductor, Inc.

STEP 2b. SELECT CLOCK AND DATA RATE:

SET THE CLOCK DIVIDER BITS (CD0 - CD11) ACCORDING TO TABLES 11 - 2 OR 11 - 3.

SET THE SCI CLOCK PRESCALER BIT (SCP, BIT 13) ACCORDING TO TABLES 11 - 2 OR 11 - 3.

 

 

 

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TRANSMIT CLOCK SOURCE

 

 

 

 

 

 

 

 

 

 

 

 

 

EXTERNAL CLOCK = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERNAL CLOCK = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE CLOCK SOURCE

 

 

 

 

 

 

 

 

 

 

 

 

 

EXTERNAL CLOCK = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERNAL CLOCK = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SCI CLOCK PRESCALER

 

 

 

 

 

 

 

 

 

 

 

 

 

DIVIDE BY 8 = 1

 

 

 

 

 

 

 

 

 

 

 

 

 

DIVIDE BY 1 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

SET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CLOCK OUT DIVIDER

 

 

 

 

 

 

 

 

 

 

 

 

 

IF SCLK PIN IS AN OTUPUT AND

 

 

 

 

 

 

 

 

 

 

 

COD = 1

 

SCLK OUTPUT = 16×

 

 

 

 

 

 

 

 

 

 

 

COD = 0

 

SCLK OUTPUT =

1×

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

 

 

 

 

 

 

SCP

COD

CD11

CD10

CD9

CD8

CD7

CD6

CD5

CD4

CD3

CD2

CD1

CD0

 

 

 

 

TCM

RCM

 

SCICLOCKCONTROLREGISTER(SCCR)

X:$FFF2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 2b

Figure 6-15 SCI General Initialization Detail – Step 2 (Sheet 2 of 2)

(SCI) INTERFACE COMMUNICATION SERIAL

Inc Semiconductor, Freescale

 

.

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SERIAL COMMUNICATION INTERFACE (SCI)

Table 6-3 (a) Asynchronous SCI Bit Rates for a 40-MHz Crystal

Bit Rate

SCP

Divider Bits

Bit Rate

(BPS)

Bit

(CD0–CD11)

Error, Percent

 

 

 

 

 

 

 

 

625.0K

0

$000

0

 

 

 

 

56.0K

0

$00A

+1.46

 

 

 

 

38.4K

0

$00F

+1.72

 

 

 

 

19.2K

0

$020

-1.36

 

 

 

 

9600

0

$040

+0.16

 

 

 

 

8000

0

$04D

+0.15

 

 

 

 

4800

0

$081

+0.15

 

 

 

 

2400

1

$020

-1.38

 

 

 

 

1200

1

$040

+0.08

 

 

 

 

600

1

$081

0

 

 

 

 

300

1

$103

0

BPS= f0 (64X (7(SCP) + 1) X (CD + 1)); f0=40 MHz

SCP=0 or 1

CD=0 to $FFF

Table 6-3 (b) Frequencies for Exact Asynchronous SCI Bit Rates

Bit Rate

SCP Bit

Divider Bits

Crystal

(BPS)

(CD0–CD11)

Frequency

 

 

 

 

 

 

 

 

 

9600

0

$040

39,936,000

 

 

 

 

4800

0

$081

39,936,000

 

 

 

 

2400

0

$103

39,936,000

 

 

 

 

1200

0

$207

39,936,000

 

 

 

 

300

0

$822

39,993,000

 

 

 

 

9600

1

$007

39,321,600

 

 

 

 

4800

1

$00F

39,321,600

 

 

 

 

2400

1

$01F

39,321,600

 

 

 

 

1200

1

$040

39,360,000

 

 

 

 

300

1

$103

39,936,000

 

 

 

 

f0=BPS X 64X (7(SCP) + 1)X(CD + 1)) SCP=0 or 1

CD=0 to $FFF

6 - 36 PORT C MOTOROLA

For More Information On This Product, Go to: www.freescale.com

Соседние файлы в предмете Радиоприемные устройства