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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

HOST INTERFACE (HI)

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

;This routine loads from the Host Interface.

;MC:MB:MA=100 - reserved

;MC:MB:MA=101 - Host

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

 

HOSTLD

BSET

#0,X:PBC

;Configure Port B as Host

 

DO

#512,_LOOP3

;Load 512 instruction words

_LBLA

JCLR

#3,X:HSR,_LBLB

;If HF0=1, stop loading data.

 

ENDDO

 

;Must terminate the DO loop

 

JMP

<_LOOP3

;

_LBLB

JCLR

#0,X:HSR,_LBLA

;Wait for HRDF to go high

 

 

 

;(meaning data is present).

 

MOVEP

X:HRX,P:(R0)+

;Store 24-bit data in P memory

_LOOP3

 

 

;and go get another 24-bit word.

 

JMP

<FINISH

;finish bootstrap

Figure 5-31 Bootstrap Code Fragment

Port B as the HI and the first JCLR looks for a flag (HF0) to indicate an early termination of the download. The second JCLR instruction causes the DSP to wait for a complete word to be received and then a MOVEP moves the data from the HI to memory.

5.3.6.2.4DSP to Host Data Transfer

Data is transferred from the DSP to the host processor in a similar manner as from the host processor to the DSP. Figure 5-32 shows the bits in the status registers (ISR and HSR) and control registers (ICR and HCR) used by the host processor and DSP CPU, respectively. The DSP CPU (see Figure 5-33) can poll the HTDE bit in the HSR (1) to see when it can send data to the host, or it can use interrupts enabled by the HTIE bit in the HCR (2). If HTIE=1 and interrupts are enabled, exception processing begins at interrupt vector P:$0022 (3). The interrupt routine should write data to the HTX (4), which will clear HTDE in the HSR. From the host’s viewpoint, (5) reading the RXL clears RXDF in the ISR. When RXDF=0 and HTDE=0 (6) the contents of the HTX will be transferred to the receive byte registers (RXH:RXM:RXL). This transfer sets RXDF in the ISR (7), which the host processor can poll to see if data is available or, if the RREQ bit in the ICR is set, the HI will interrupt the host processor with HREQ (8).

The code shown in Figure 5-34 is essentially the same as the MAIN PROGRAM in Figure 5-25 except that, since this code will transmit instead of receive data, the HTIE bit is set in the HCR instead of the HRIE bit.

The transmit routine used by the code in Figure 5-34 is shown in Figure 5-35. The interrupt vector contains a JSR, which makes it a long interrupt. The code sends a fixed test pattern

5 - 52 PORT B MOTOROLA

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

HOST INTERFACE (HI)

HOST STATUS

REGISTER (HSR)

(READ ONLY)

 

0

 

 

HRDF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HTDE

 

 

 

 

 

 

 

DSP56002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HCP

 

 

 

 

DSP.

 

 

 

 

 

 

HF0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 = HTX IS EMPTY AND CAN BE WRITTEN BY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HF1

 

 

 

HTDE — HOST TRANSMIT DATA EMPTY

 

 

 

 

 

 

0

 

 

 

 

 

 

 

0

 

0 = HTX IS FULL.

 

 

7

 

 

DMA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X:$FFE9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPTSTATUS

REGISTER(ISR)

(READONLY)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7 0

 

 

RXDF

 

 

 

 

1 = INDICATES THE RECIEVE BYTE REGISTERS (RXH, RXM, RXL)

 

 

 

 

 

TXDE

 

 

 

 

 

 

 

 

 

TRDY

 

 

 

 

 

 

 

 

 

HF2

 

 

 

— RECEIVE DATA REGISTER FULL

CONTAIN DATA FROM THE DSP. 0 = CLEARED BY READING RXL.

 

 

 

 

HOST

 

 

 

HF3

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

DMA

 

 

 

 

 

 

HREQ

 

 

 

 

 

 

 

 

 

 

 

 

RXDF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$2

 

 

 

 

 

 

HOST CONTROL

REGISTER (HCR)

(READ/WRITE)

0

 

HRIE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HTIE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HCIE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 = ENABLE THE DSP INTERRUPT TO P:$0022. 0 = DISABLE THE DSP INTERRUPT TO P:$0022.

 

 

 

HF2

 

 

 

 

 

HTIE — HOST TRANSMIT INTERRUPT ENABLE

 

 

 

HF3

 

 

 

 

DSP INTERRUPT IS CAUSED BY HTDE = 1

 

 

0

 

 

 

 

 

 

0

 

 

 

 

7

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X:$FFE8

 

 

 

 

 

 

0

CONTROL RREQ

(READ/WRITE)

 

PIN)HREQ

 

 

 

 

INTERRUPT

 

 

REGISTER(HCR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TREQ

 

 

 

RREQ —RECEIVE REQUEST ENABLE (USED TO CONTROL THE

1 = ENABLE INTERRUPT REQUESTS CREATED BY RXDF. 0 = DISABLE INTERRUPT REQUESTS.

 

 

 

 

 

0

 

 

 

 

 

 

 

HF0

 

 

 

 

 

 

 

HF1

 

 

 

 

 

 

HM0

 

 

MODES

 

 

 

 

 

 

 

 

 

HM1

 

 

 

 

 

 

 

 

 

 

 

7

 

INIT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$0

 

 

 

 

Figure 5-32 Bits Used for DSP to Host Transfer

($123456) and then resets the HI for the next interrupt.

MOTOROLA PORT B 5 - 53

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

54 - 5

More For

Information

.wwwGoto:

PORT

freescale

B

On

This

com.

 

Product,

MOTOROLA

Freescale Semiconductor, Inc.

VIEW FROM HOST VIEW FROM HOST

5. READ OF RXL BY HOST CLEARS RXDF IN ISR.

 

 

 

1. WHEN HTDE = 1, THEN HTX IS EMPTY.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6. WHEN RXDF = 0 AND HTDE = 0, THEN TRANSFER OCCURS.

 

 

 

 

 

7

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

0

 

 

 

 

 

 

 

 

DMA

0

0

 

HF1

HF0

HCP

 

 

1

HRDF

 

 

HOST STATUS

 

 

 

 

 

X:$FFE9

 

 

 

 

 

 

 

$5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REGISTER (HSR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RXH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$6

 

 

RXM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HTDE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HOST TRANSMIT DATA EMPTY

 

 

 

 

 

 

 

LAST READ

 

$7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RXL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. DSP56002 MAY POLL HTDE.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE BYTE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REGISTERS (RBR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HOST CONTROL

7. THE TRANSFER SETS RXDF FOR THE HOST TO POLL.

 

 

X:$FFE8

 

 

0

0

0

 

HF3

HF2

HCIE

 

 

1

 

HRIE

 

 

 

 

 

 

 

 

 

 

REGISTER (HCR)

7

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT

 

 

HREQ

DMA

0

HF3

HF2

 

TRDY

TXDE

1

$2

 

 

 

STATUS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REGISTER(ISR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RXDF

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DATA FULL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT

 

 

INIT

HM1

HM0

HF1

HF0

0

TREQ

1

 

$0

 

 

 

CONTROL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REGISTER(ICR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RREQ

 

 

 

 

 

 

 

 

 

 

 

 

 

RECEIVE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

REQUEST ENABLE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8. IF RREQ = 1, THEN HREQ PIN IS ASSERTED TO INTERRUPT HOST.

HREQ

PIN

HTIE

HOST TRANSMIT INTERRUPT ENABLE

3.IF HTIE = 1, AND INTERRUPTS ARE ENABLED, THEN EXCEPTION PROCESSING BEGINS.

P:$0000

P:$0022

HOST TRANSMIT DATA VECTOR

P:$007E AVAILABLE FOR HOST COMMAND

FAST INTERRUPT

OR

LONG INTERRUPT

4. DSP56002 WRITES DATA TO HTX, WHICH CLEARS HTDE IN HSR.

 

 

23

 

0

 

 

 

 

 

 

 

HIGH BYTE

MIDDLE BYTE

LOW BYTE

X:$FFEB

 

 

 

 

 

Figure 5-33 Data Transfer from DSP to Host

HOST RECEIVE DATA

REGISTER (HSR)

(HI) INTERFACE HOST

Semiconductor, Freescale

 

.Inc

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