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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SYNCHRONOUS SERIAL INTERFACE (SSI)

6.4.7.3.1Network Mode Transmit

When TE is set, the transmitter will be enabled only after detection of a new data frame sync. This procedure allows the SSI to synchronize to the network timing.

Normal startup sequence for transmission in the first time slot is to write the data to be transmitted to TX, which clears the TDE flag. Then set TE and TIE to enable the transmitter on the next frame sync and to enable transmit interrupts.

Alternatively, the DSP programmer may decide not to transmit in the first time slot by writing any data to the time slot register (TSR). This will clear the TDE flag just as if data were going to be transmitted, but the STD pin will remain in the high-impedance state for the first time slot. The programmer then sets TE and TIE.

When the frame sync is detected (or generated), the first data word will be transferred from TX to the transmit shift register and will be shifted out (transmitted). TX being empty will cause TDE to be set, which will cause a transmitter interrupt. Software can poll TDE or use interrupts to reload the TX register with new data for the next time slot. Software can also write to TSR to prevent transmitting in the next time slot. Failing to reload TX (or writing to the TSR) before the transmit shift register is finished shifting (empty) will cause a transmitter underrun. The TUE error bit will be set, causing the previous data to be retransmitted.

The operation of clearing TE and setting it again will disable the transmitter after completion of transmission of the current data word until the beginning of the next frame sync period. During that time, the STD pin will be three-stated. When it is time to disable the transmitter, TE should be cleared after TDE is set to ensure that all pending data is transmitted.

The optional output flags are updated every time slot regardless of TE.

To summarize, the network mode transmitter generates interrupts every time slot and requires the DSP program to respond to each time slot. These responses can be:

1.Write data register with data to enable transmission in the next time slot

2.Write the time slot register to disable transmission in the next time slot

3.Do nothing – transmit underrun will occur the at beginning of the next time slot, and the previous data will be transmitted

6 - 140 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-78 differs from the program shown in Figure 6-73 only in that it uses the network mode to transmit only right-channel data. A time slot is assigned for the left-channel data, which could be inserted by another DSP using the network mode. In the “Initialize SSI Port” section of the program, two words per frame are selected using CRA, and the network mode is selected by setting MOD to one in the CRB. The main interrupt routine, which waits to move the data to TX, only transmits data if the current time slot is for the right channel. If the current time slot is for the left channel, the TSR is written, which three-states the output to allow another DSP to transmit the left channel during the time slot.

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

;SSI and other I/O EQUATES*

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

IPR

EQU

$FFFF

 

CRA

EQU

$FFEC

 

CRB

EQU

$FFED

 

PCC

EQU

$FFE1

 

TX

EQU

$FFEF

 

TSR

EQU

$FFEE

 

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 user flag for SSI flag.

MOVE

X0,X:FLG

;Start with the right channel.

Figure 6-78 Network Mode Transmit Example Program (Sheet 1 of 2)

MOTOROLA PORT C 6 - 141

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

SYNCHRONOUS SERIAL INTERFACE (SSI)

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

;Initialize SSI Port*

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

 

MOVEP

#$3000,X:IPR

;Set interrupt priority register for SSI.

MOVEP

#$411F,X:CRA

;Set continuous clock=5.12/32 MHz

 

 

;word length=16.

MOVEP

#$5B34,X:CRB

;Enable TIE and TE; make clock and

 

 

;frame sync outputs; frame

 

 

;sync=bit mode; synchronous mode;

 

 

;make SC0 an output.

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

;Init SSI Interrupt*

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

ANDI

#$FC,MR

;Unmask interrupts.

MOVEP

#$01F8,X:PCC

;Turn on SSI port.

JMP

*

;Wait for interrupt.

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

;MAIN INTERRUPT ROUTINE*

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

 

XMT

 

 

 

 

JSET

#0,X:FLG,LEFT

;Check user flag.

RIGHT

BCLR

#0,X:CRB

;Clear SC0 indicating right channel data

 

MOVEP

X:(R0)+,X:TX

Move data to TX register.

 

MOVE

#>$01,X0

;Set user flag to 1

 

MOVE

X0,X:FLG

;for next data.

 

RTI

 

 

LEFT

BSET

#0,X:CRB

;Set SC0 indicating left channel data.

 

MOVEP

X0,X:TSR

;Write to TSR register.

 

MOVE

#>$00,X0

;Clear user flag

 

MOVE

X0,X:FLG

;for next data.

 

RTI

 

 

 

END

 

 

Figure 6-78 Network Mode Transmit Example Program (Sheet 2 of 2)

6 - 142 PORT C MOTOROLA

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

SSISR

EQU

$FFEE

CRA

EQU

$FFEC

CRB

EQU

$FFED

PCC

EQU

$FFE1

RX

EQU

$FFEF

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

;INTERRUPT VECTOR*

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

ORG P:$000C

JSR RCV

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

;MAIN PROGRAM*

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

ORG

P:$40

 

MOVE

#0,R0

;Pointer to memory buffer for

MOVE

#$08,R1

;received data. Note data will be

MOVE

#3,M0

;split between two buffers which are

MOVE

#3,M1

;modulus 4.

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

;Initialize SSI Port*

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

MOVEP

#$3000,X:IPR

;Set interrupt priority register for SSI.

MOVEP

#$4100,X:CRA

;Set word length = 16 bits.

MOVEP

#$AB00,X:CRB

;Enable RIE and RE; synchronous

 

 

;mode with bit frame sync;

 

 

;clock and frame sync are

 

 

;external; SC0 is an input.

Figure 6-79 Network Mode Receive Example Program (Sheet 1 of 2)

MOTOROLA PORT C 6 - 143

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

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