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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

HOST INTERFACE (HI)

STEP 2 OF HOST PORT CONFIGURATION

1.CLEAR HOST COMMAND BIT (HC):

BIT 7 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$1

 

 

 

HC

*

 

HV

 

 

 

COMMAND VECTOR REGISTER (CVR)

 

 

 

 

 

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

*Reserved; write as zero.

2.OPTION 1: SELECT HOST VECTOR (HV)

(OPTIONAL SINCE HV CAN BE SET ANY TIME BEFORE THE HOST COMMAND IS EXECUTED. DSP INTERRUPT VECTOR = THE HOST VECTOR MULTIPLIED BY 2. DEFAULT (UPON DSP RESET): HV = $12 DSP INTERRUPT VECTOR $0024

Figure 5-21 (a) HI Configuration–Host Side

STEP 2 OF HOST PORT CONFIGURATION

2. OPTION 2: SELECT POLLING MODE FOR HOST TO DSP COMMUNICATION

INITIALIZE DSP

AND HOST PORT

 

 

 

 

 

 

 

 

 

 

DISABLE INTERRUPTS

 

 

 

 

 

 

 

 

 

 

BIT 0 = 0

 

DMA OFF

 

 

 

 

 

 

 

BIT 1 = 0

 

 

 

 

 

 

 

 

 

 

 

BIT 5 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BIT 6 = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

OPTIONAL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT CONTROL REGISTER (ICR)

$0

 

INIT

HM1

HM0

HF1

HF0

*

TREQ

RREQ

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*Reserved; write as zero.

Figure 5-21 (b) HI Initialization–Host Side, Polling Mode

The previous transfer description is an overview. Specific and exact information for the HI data transfers and their timing can be found in Section 5.3.6.3 DMA Data Transfer and in the DSP56002 Advance Information Data Sheet (DSP56002/D).

5.3.6.2.1Host to DSP - Data Transfer

Figure 5-23 shows the bits in the ISR and ICR registers used by the host processor and the bits in the HSR and HCR registers used by the DSP to transfer data from the host processor to the DSP. The registers shown are the status register and control register as they are seen by the host processor, and the status register and control register as they are seen by the DSP.

Only the registers used to transmit data from the host processor to the DSP are

MOTOROLA PORT B 5 - 41

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

HOST INTERFACE (HI)

STEP 2 OF HOST PORT CONFIGURATION

2. OPTION 3: SELECT INTERRUPT MODE FOR

INITIALIZE DSP

INITIALIZE HI**

BIT 7 = 1

DMA OFF

BIT 5 = 0

BIT 6 = 0

OPTIONAL

DSP TO HOST

OR

HOST TO DSP

OR

DSP TO HOST

AND

HOST TO DSP

ENABLE

RECEIVE DATA FULL INTERRUPT

BIT 0 = 1

BIT 1 = 0

ENABLE

TRANSMIT DATA EMPTY INTERRUPT

BIT 0 = 0

BIT 1 = 1

ENABLE

RECEIVE DATA FULL INTERRUPT AND TRANSMIT DATA EMPTY INTERRUPT BIT 0 = 1

BIT 1 = 1

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT CONTROL REGISTER (ICR)

$0

 

INIT

HM1

HM0

HF1

HF0

*

TREQ

RREQ

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. OPTION 4: LOAD HOST INTERRUPT VECTOR IF USING THE INTERRUPT MODE AND THE HOST PROCESSOR REQUIRES AN INTERRUPT VECTOR.

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT VECTOR REGISTER (IVR)

$3

 

IV7

IV6

IV5

IV4

IV3

IV2

IV1

IV0

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*Reserved; write as zero.

**See Figure 10 - 23.

Figure 5-21 (c) HI Initialization–Host Side, Interrupt Mode

described. Figure 5-24 illustrates the process of that data transfer. The steps in Figure 5- 24 can be summarized as follows:

1.When the TXDE bit in the ISR is set, it indicates that the HI is ready to receive a data byte from the host processor because the transmit byte registers (TXH, TXM, TXL) are empty.

2.The host processor can poll as shown in this step.

3.Alternatively, the host processor can use interrupts to determine the status of this bit. Setting the TREQ bit in the ICR causes the HREQ pin to interrupt the host processor when TXDE is set.

4.Once the TXDE bit is set, the host can write data to the HI. It does this by writing three bytes to TXH, TXM, and TXL, respectively, or two bytes to TXM and TXL, respectively, or one byte to TXL.

5.Writing data to TXL clears TXDE in the ISR.

6.From the DSP’s viewpoint, the HRDF bit (when set) in the HSR indicates that data is waiting in the HI for the DSP.

5 - 42 PORT B MOTOROLA

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

HOST INTERFACE (HI)

7.When the DSP reads the HRX, the HRDF bit is automatically cleared and TXDE in the ISR is set.

8.When TXDE=0 and HRDF=0, data is automatically transferred from TBR to HRX which sets HRDF.

9.The DSP can poll HRDF to see when data has arrived, or it can use interrupts.

10.If HRIE (in the HCR) and HRDF are set, exception processing is started using interrupt vector P:$0020.

The code shown in Figure 5-25 is an excerpt from the Host I/O Port Technical Bulletin (inhouse document). The MAIN PROGRAM initializes the HI and then hangs in a wait loop while it allows interrupts to transfer data from the host processor to the DSP. The first three MOVEP instructions enable the HI and configure the interrupts. The following MOVE enables the interrupts (this should always be done after the interrupt programs and hardware are completely initialized) and prepares the DSP CPU to look for the host flag, HF0=1. The JCLR instruction is a polling loop that looks for HF0=1, which indicates that the host processor is ready. When the host processor is ready to transfer data to the DSP, the DSP enables HRIE in the HCR, which allows the interrupt routine to receive data from the host processor. The jump-to-self instruction that follows is for test purposes only, it can be replaced by any other code in normal operation.

STEP 2 OF HOST PORT CONFIGURATION

2. OPTION 5: SELECT DMA MODE FOR

INITIALIZE DSP

INITIALIZE HI**

BIT 7 = 1

24-BIT DMA

BIT 5 = 1

BIT 6 = 0

OR

16-BIT DMA

BIT 5 = 0

BIT 6 = 1

OR

DMA OFF

 

BIT 5 = 1

 

BIT 6 = 1

OPTIONAL

ENABLE

RECEIVE DATA FULL INTERRUPT

DSP TO HOST

BIT 0 = 1

BIT 1 = 0

OR

ENABLE

TRANSMIT DATA EMPTY INTERRUPT HOST TO DSP BIT 0 = 0

BIT 1 = 1

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

INTERRUPT CONTROL REGISTER (ICR)

$0

 

INIT

HM1

HM0

HF1

HF0

*

TREQ

RREQ

 

 

(READ/WRITE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*Reserved; write as zero.

**See Figure 5-23.

Figure 5-21 (d) HI Initialization–Host Side, DMA Mode

MOTOROLA PORT B 5 - 43

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

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