Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
64
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

Table 5-5. Single Transfer Mode PTSCB

Unused

Unused

PTSDST (HI) = 60H

PTSDST (LO) = 00H

PTSSRC (HI) = 00H

PTSSRC (LO) = 20H

PTSCON = 85H (Mode = 100, DI & DU = 1, BW = 0)

PTSCOUNT = 09H

5.6.4Block Transfer Mode

In block transfer mode, an interrupt causes the PTS to move a block of bytes or words from one memory location to another. See AP-445, 8XC196KR Peripherals: A User’s Point of View, for application examples with code. Figure 5-12 shows the PTS control block for block transfer modes.

In this mode, each PTS cycle consists of the transfer of an entire block of bytes or words. Because a PTS cycle cannot be interrupted, the block transfer mode can create long interrupt latency. The worst-case latency could be as high as 500 states, if you assume a block transfer of 32 words from one external memory location to another, using an 8-bit bus with no wait states. See Table 5-4 on page 5-10 for execution times of PTS routines.

The PTSCB in Table 5-6 sets up three PTS cycles that will transfer five bytes from memory locations 20H–24H to 6000H–6004H (cycle 1), 6005H–6009H (cycle 2), and 600AH–600EH (cycle 3). The source and destination are incremented after each byte transfer, but the original source address is reloaded into PTSSRC at the end of each block-transfer cycle. In this routine, the PTS always gets the first byte from location 20H.

Table 5-6. Block Transfer Mode PTSCB

Unused

PTSCOUNT = 05H

PTSDST (HI) = 60H

PTSDST (LO) = 00H

PTSSRC (HI) = 00H

PTSSRC (LO) = 20H

PTSCON = 17H (Mode = 000; DI, SI, DU, BW = 1; SU = 0)

PTSCOUNT = 03H

5-24

STANDARD AND PTS INTERRUPTS

PTS Block Transfer Mode Control Block

In block transfer mode, the PTS control block contains a block size (PTSBLOCK), a source and destination address (PTSSRC and PTSDST), a control register (PTSCON), and a transfer count (PTSCOUNT).

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

Unused

 

0

0

0

 

0

 

0

0

0

0

 

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSBLOCK

 

 

 

 

 

PTS Block Size

 

 

 

 

 

 

 

 

15

 

 

 

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSDST (HI)

 

 

 

PTS Destination Address (high byte)

 

 

 

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSDST (LO)

 

 

 

PTS Destination Address (low byte)

 

 

 

 

 

 

 

15

 

 

 

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSSRC (HI)

 

 

 

 

PTS Source Address (high byte)

 

 

 

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSSRC (LO)

 

 

 

 

PTS Source Address (low byte)

 

 

 

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSCON

 

M2

M1

M0

 

BW

 

SU

DU

SI

DI

 

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSCOUNT

 

 

 

 

Consecutive Block Transfers

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Register

 

Location

 

 

 

 

 

Function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSBLOCK

 

PTSCB + 6

PTS Block Size

 

 

 

 

 

 

 

 

 

 

Specifies the number of bytes or words in each block. Valid values are

 

 

 

 

 

 

1–32, inclusive.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSDST

 

PTSCB + 4

PTS Destination Address

 

 

 

 

 

 

 

 

 

 

Write the destination memory location to this register. A valid address is

 

 

 

 

 

 

any unreserved memory location; however, it must point to an even

 

 

 

 

 

 

address if word transfers are selected.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PTSSRC

 

PTSCB + 2

PTS Source Address

 

 

 

 

 

 

 

 

 

 

Write the source memory location to this register. A valid address is any

 

 

 

 

 

 

unreserved memory location; however, it must point to an even address

 

 

 

 

 

 

if word transfers are selected.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5-13. PTS Control Block – Block Transfer Mode

5-25

Соседние файлы в предмете Электротехника