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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SYNCHRONOUS SERIAL INTERFACE (SSI)

 

 

MC1550x

 

DSP56002

 

 

CODEC FILTER

 

 

ANALOG

TX1

TDD

SRD

 

INPUT

 

 

RDD

STD

 

 

 

 

 

 

TDC

SCK

 

ANALOG

 

RDC

 

 

RX0

TDE

SC2

 

OUTPUT

 

 

RCE

 

 

 

 

 

 

 

 

MSI

 

SERIAL CLOCK

 

 

 

 

SERIAL SYNC

 

 

 

 

TRANSMIT DATA

 

DSP DATA

 

DSP DATA

RECEIVE DATA

 

CODEC DATA

 

CODEC DATA

Figure 6-72 Normal Mode Example

6.4.7.2.1Normal Mode Transmit

The conditions for data transmission from the SSI are as follows:

1.Transmitter is Enabled (TE=1)

2.Frame sync (or clock in gated clock mode) is active

When these conditions occur in normal mode, the next data word will be transferred from TX to the transmit shift register, the TDE flag will be set (transmitter empty), and the transmit interrupt will occur if TIE equals one (transmit interrupt enabled.) The new data word will be transmitted immediately.

The transmit data output (STD) is three-stated, except during the data transmission period. The optional frame sync output, flag outputs, and clock outputs are not three-stated even if both receiver and transmitter are disabled.

The optional output flags are always updated at the beginning of the frame, regardless of

TE. The state of the flag does not change for the entire frame.

6 - 130 PORT C MOTOROLA

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SYNCHRONOUS SERIAL INTERFACE (SSI)

Figure 6-73 is an example of transmitting data using the SSI in the normal mode with a continuous clock, a bit-length frame sync, and 16-bit data words. The purpose of the program is to interleave and transmit right and left channels in a compact disk player. Four SSI pins are used:

1.SC0 is used as an output flag to indicate right-channel data (OF0=1) or left-chan- nel data (OF0=0)

2.SC2 is TX and RX frame sync out

3.STD is transmit data out

4.SCK clocks the transmit data out

Equates are set for convenience and readability. Test data is then put in the low X: memory locations. The transmit interrupt vector contains a JSR instruction (which forms a long interrupt). The data pointer and channel flag are initialized before initializing CRA and CRB. It is assumed that the DSP CPU and SSI have been previously reset.

At this point, the SSI is ready to transmit except that the interrupt is masked because the MR was cleared on reset and Port C is still configured as general-purpose I/O. Unmasking the interrupt and enabling the SSI pins allows transmission to begin. A “jump to self” instruction causes the DSP to hang and wait for interrupts to transmit the data. When an interrupt occurs, a JSR instruction at the interrupt vector location causes the XMT routine to be executed. Data is then moved to the TX register, and the data pointer is incremented. The flag is tested by the JSET instruction and, if it is set, a jump to left occurs, and the code for the left channel is executed. If the flag is not set, the code for the right channel is executed. In either case, the channel flag in X0 and then the output flag are set to reflect the channel being transmitted. Control is then returned to the main program, which will wait for the next interrupt.

MOTOROLA PORT C 6 - 131

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SYNCHRONOUS SERIAL INTERFACE (SSI)

;*************************************************

;SSI and other I/O EQUATES*

;*************************************************

 

IPR

EQU

$FFFF

 

CRA

EQU

$FFEC

 

CRB

EQU

$FFED

 

PCC

EQU

$FFE1

 

TX

EQU

$FFEF

 

FLG

EQU

$0010

 

 

ORG

X:0

 

 

DC

$AAAA00

;Data to transmit.

 

DC

$333300

 

 

DC

$CCCC00

 

 

DC

$F0F000

 

;*************************************************

;INTERRUPT VECTOR*

;*************************************************

ORG

P:$0010

JSR

XMT

;*************************************************

;MAIN PROGRAM*

;*************************************************

 

ORG

P:$40

 

MOVE

#0,R0

;Pointer to data buffer.

MOVE

#3,M0

;Set modulus to 4.

MOVE

#0,X0

;Initialize channel flag for SSI flag.

MOVE

X0,X:FLG

;Start with right channel first.

;*************************************************

;Initialize SSI Port*

;*************************************************

 

MOVEP

#$3000,X:IPR

;Set interrupt priority register for SSI.

MOVEP

#$401F,X:CRA

;Set continuous clock=5.12/32 MHz

 

 

;word length=16.

MOVEP

#$5334,X:CRB

;Enable TIE and TE; make clock and

 

 

;frame sync outputs; frame

 

 

;sync=bit mode; synchronous mode;

 

 

;make SC0 an output.

Figure 6-73 Normal Mode Transmit Example (Sheet 1 of 2)

6 - 132 PORT C MOTOROLA

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

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