Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

PIH1_INT_PEND

Address:

1EAAH

 

Reset State:

0000H

When the peripheral interrupt handler 1 detects an interrupt request, it sets the corresponding bit in the interrupt pending (PIH1_INT_PEND) register. When the vector is taken, the hardware clears the pending bit. Software can generate an interrupt by setting the corresponding interrupt pending bit.

15

 

 

 

 

 

 

 

 

 

8

EPA16

OS7

OS6

OS5

 

OS4

 

OS3

OS2

OS1

7

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

OS0

OVRTM1

OVRTM2

OVRTM3

 

OVRTM4

 

OVR0

OVR1

OVR2

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

Function

 

 

 

Number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

15:0

Any set bit indicates that the corresponding PIH1 interrupt is pending. The interrupt bit is

 

cleared when processing transfers to the corresponding interrupt vector.

 

 

Bit Mnemonic

Interrupt Description

 

 

 

 

EPA16

 

EPA Capture/Compare Channel 16

 

 

 

 

OS7:0

 

Output Simulcapture Channel 0–7

 

 

 

 

OVRTM1:4

Timer 1–4 Overflow/Underflow

 

 

 

 

OVR0:2

 

EPA Channel 0–2 Capture Overrun

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 6-18. PIH1 Interrupt Pending (PIH1_INT_PEND) Register

6.6INITIALIZING THE PTS CONTROL BLOCKS

Each PTS interrupt requires a block of data, in register RAM, called the PTS control block (PTSCB). The PTSCB identifies which PTS microcode routine will be invoked and sets up the specific parameters for the routine. You must set up the PTSCB for each interrupt source before enabling the corresponding PTS interrupts.

Store the address of the first (lowest) PTSCB byte in the PTS vector table in special-purpose memory (see “Special-purpose Memory in Page FFH” on page 4-7). Figure 6-19 shows the PTSCB for each PTS mode. Unused PTSCB bytes can be used as extra RAM.

NOTE

The PTSCB must be located in the internal register file. The location of the first byte of the PTSCB must be aligned on a quad-word boundary (an address evenly divisible by 8).

6-30

STANDARD AND PTS INTERRUPTS

 

Single Transfer

 

Block Transfer

 

Dummy Mode

 

Missed-event

 

 

 

 

Mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Unused

 

Unused

 

Unused

 

Unused

 

 

 

 

 

 

 

 

 

Unused

 

PTSBLOCK

 

Unused

 

Unused

 

 

 

 

 

 

 

 

 

PTSDST (H)

 

PTSDST (H)

 

Unused

 

PTSPREV (H)

 

 

 

 

 

 

 

 

 

PTSDST (L)

 

PTSDST (L)

 

Unused

 

PTSPREV (L)

 

 

 

 

 

 

 

 

 

PTSSRC (H)

 

PTSSRC (H)

 

Unused

 

PTSCUR (H)

 

 

 

 

 

 

 

 

 

PTSSRC (L)

 

PTSSRC (L)

 

Unused

 

PTSCUR (L)

 

 

 

 

 

 

 

 

 

PTSCON

 

PTSCON

 

PTSCON

 

PTSCON

 

 

 

 

 

 

 

 

PTSVECT

PTSCOUNT

 

PTSCOUNT

 

Unused

 

PTSCOUNT

 

 

 

 

 

 

 

 

Figure 6-19. PTS Control Blocks

6.6.1Specifying the PTS Count

For single transfer, block transfer, and missed-event routines, the first location of the PTSCB contains an 8-bit value called PTSCOUNT. This value defines the number of interrupts that will be serviced by the PTS routine. The PTS decrements PTSCOUNT after each PTS cycle. When PTSCOUNT reaches zero, hardware clears the corresponding PTSSEL bit and sets the PTSSRV bit (Figure 6-20), which requests an end-of-PTS interrupt. If PIHx_PTS is the interrupt source, then hardware also clears the corresponding PIHx_PTSSEL bit and sets the PIHx_PTSSRV bit (Figure 6-12 and “Windowing” on page 4-17).

The end-of-PTS interrupt service routine should reinitialize the PTSCB, if required, and set the appropriate PTSSEL and PIHx_PTSSEL bits to re-enable PTS interrupt service.

6-31

8XC196EA USER’S MANUAL

PTSSRV

Address:

0006H

 

Reset State:

0000H

The PTS service (PTSSRV) register is used by the hardware to indicate that the final PTS interrupt has been serviced by the PTS routine. When PTSCOUNT reaches zero, hardware clears the corresponding PTSSEL bit and sets the PTSSRV bit, which requests the end-of-PTS interrupt. When the end-of-PTS interrupt is called, hardware clears the PTSSRV bit. The end-of-PTS interrupt service routine must set the PTSSEL bit to re-enable the PTS channel.

15

PIH0_PTS

7

 

 

 

 

 

 

 

SDU

EXTINT

RI1

TI1

 

 

 

 

8

PIH1_PTS

SSIO1

SSIO0

 

 

 

0

 

 

 

 

AD

EPAx_OVR

RI0

TI0

 

 

 

 

Bit

 

Function

 

Number

 

 

 

 

 

 

 

 

15, 14,

Reserved; always write as zeros.

 

12, 10

 

 

 

 

 

13, 11,

A bit is set by hardware to request an end-of-PTS interrupt for the corresponding interrupt

9:0

through its standard interrupt vector.

 

 

The standard interrupt vector locations are as follows:

 

 

Bit Mnemonic

Interrupt

Standard Vector

 

PIH0_PTS

PIH0 PTS Service Request

see PIH0_PTSSRV

 

PIH1_PTS

PIH1 PTS Service Request

see PIH1_PTSSRV

 

SSIO0

SSIO 0 Transfer

FF2032H

 

SSIO0

SSIO 0 Transfer

FF2030H

 

SDU

Serial Debug Unit lnterrupt

FF200EH

 

EXTINT

External Interrupt Pin

FF200CH

 

RI1

SIO1 Receive

FF200AH

 

TI1

SIO1 Transmit

FF2008H

 

AD

A/D Conversion Complete

FF2006H

 

EPAx_OVR

EPA Channel 3–16 Overrun

FF2004H

 

RI0

SIO0 Receive

FF2002H

 

TI0

SIO0 Transmit

FF2000H

 

 

 

 

Figure 6-20. PTS Service (PTSSRV) Register

6-32

STANDARD AND PTS INTERRUPTS

PIH0_PTSSRV

Address:

1E94H

 

Reset State:

0000H

The PTS service (PIH0_PTSSRV) register for peripheral interrupt handler 0 is used by the hardware to indicate that the final PTS interrupt has been serviced by the PTS routine. When PTSCOUNT reaches zero, hardware clears the corresponding PIH0_PTSSEL bit and sets the PIH0_PTSSRV bit, which requests the end-of-PTS interrupt. When the end-of-PTS interrupt is called, hardware clears the PIH0_PTSSRV bit. The end-of-PTS interrupt service routine must set the PIH0_PTSSEL bit to reenable the PTS channel.

15

EPA15

EPA14

EPA13

EPA12

7

 

 

 

 

 

 

 

EPA7

EPA6

EPA5

EPA4

 

 

 

 

8

EPA11

EPA10

EPA9

EPA8

 

 

 

0

 

 

 

 

EPA3

EPA2

EPA1

EPA0

 

 

 

 

Bit

 

Function

 

Number

 

 

 

 

 

 

 

15:0

A bit is set by hardware to request an end-of-PTS interrupt for the corresponding interrupt

 

through its standard interrupt vector.

 

 

The standard interrupt vector locations are as follows:

 

 

Bit Mnemonic

Interrupt

Standard Vector

 

EPA15

EPA Capture/Compare Channel 15

FF20FCH

 

EPA14

EPA Capture/Compare Channel 14

FF20F8H

 

EPA13

EPA Capture/Compare Channel 13

FF20F4H

 

EPA12

EPA Capture/Compare Channel 12

FF20F0H

 

EPA11

EPA Capture/Compare Channel 11

FF20ECH

 

EPA10

EPA Capture/Compare Channel 10

FF20E8H

 

EPA9

EPA Capture/Compare Channel 9

FF20E4H

 

EPA8

EPA Capture/Compare Channel 8

FF20E0H

 

EPA7

EPA Capture/Compare Channel 7

FF20DCH

 

EPA6

EPA Capture/Compare Channel 6

FF20D8H

 

EPA5

EPA Capture/Compare Channel 5

FF20D4H

 

EPA4

EPA Capture/Compare Channel 4

FF20D0H

 

EPA3

EPA Capture/Compare Channel 3

FF20CCH

 

EPA2

EPA Capture/Compare Channel 2

FF20C8H

 

EPA1

EPA Capture/Compare Channel 1

FF20C4H

 

EPA0

EPA Capture/Compare Channel 0

FF20C0H

 

 

 

 

Figure 6-21. PIH0 PTS Service (PIH0_PTSSRV) Register

6-33

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