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

EVENT PROCESSOR ARRAY (EPA)

OSx_TIME

Address:

See Table 11-2 on page 11-4

x = 0–7

Reset:

XXXXH

The output/simulcapture time registers (OSx_TIME) are the event-time registers for the output/simulcapture channels. The EPA triggers a compare event when the reference timer matches the value in OSx_TIME. If simulcapture is enabled, the EPA simultaneously captures the value of the specified timer into this register, overwriting the previous value.

15

0

OS Timer Value

 

Bit

Function

 

 

Number

 

 

 

 

 

 

 

 

 

15:0

OS Timer Value

 

 

 

After programming the OSx_CON register, write the compare event time to this register.

 

 

 

The EPA generates the programmed event when the value of the reference timer

 

 

 

matches the event-time value in this register.

 

 

 

If simulcapture is enabled, the EPA simultaneously captures the value of the specified

 

 

 

timer into this register, overwriting the event-time value.

 

 

 

 

 

 

 

 

 

 

 

Figure 11-17. Output Simulcapture x Time (OSx_TIME) Register

 

11.6 ENABLING THE EPA INTERRUPTS

The EPA generates 32 individual event interrupts (EPA16:0, OS7:0, OVRTM4:1, OVR2:0) and the shared overrun event interrupt (EPAx_OVR) from EPA16:3. The individual interrupts are directly mapped into the two peripheral interrupt handler (PIH) interrupt pending registers (PIH0_INT_PEND and PIH1_INT_PEND). The timer overrun events from EPA16:3 share the EPAx_OVR interrupt, which maps into the INT_PEND register. To enable the individual interrupts, set the corresponding bits in the PIHx_INT_MASK registers, then set the appropriate bits in INT_MASK1 to enable either PTS or interrupt controller service for the PIH vectors. To enable the shared overrun interrupt, set the corresponding bit in the INT_MASK register. Chapter 6, “Standard and PTS Interrupts,” discusses the interrupts in greater detail.

11-25

8XC196EA USER’S MANUAL

PIH0_INT_MASK

Address:

1E98H

 

Reset State:

0000H

The PIH0 interrupt mask (PIH0_INT_MASK) register enables or disables (masks) individual interrupt requests to peripheral interrupt handler 0. (The EI and DI instructions enable and disable servicing of all maskable interrupts.)

EPA15

EPA14

 

EPA13

EPA12

 

EPA11

EPA10

EPA9

EPA8

EPA7

EPA6

 

EPA5

EPA4

 

EPA3

EPA2

EPA1

EPA0

 

 

 

 

 

 

 

 

 

15:0

Setting a bit enables the corresponding interrupt request to peripheral interrupt handler 0.

 

Bit Mnemonic Interrupt Description

 

 

 

 

EPA15:0

EPA Capture/Compare Channels 0–15

 

 

 

 

 

 

 

 

 

 

 

 

Figure 11-18.

PIH0 Interrupt Mask (PIH0_INT_MASK) Register

 

 

 

 

PIH1_INT_MASK

Address:

1EA8H

 

Reset State:

0000H

The PIH1 interrupt mask (PIH1_INT_MASK) register enables or disables (masks) individual interrupt requests to the peripheral interrupt handler 1. (The EI and DI instructions enable and disable servicing of all maskable interrupts.)

EPA16

OS7

 

OS6

OS5

 

OS4

 

OS3

OS2

OS1

OS0

OVRTM1

OVRTM2

OVRTM3

 

OVRTM4

 

OVR0

OVR1

OVR2

 

 

 

 

 

 

 

 

 

15:0

Setting a bit enables the corresponding interrupt request to peripheral interrupt handler 1.

 

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 11-19. PIH1 Interrupt Mask (PIH1_INT_MASK) Register

11-26

EVENT PROCESSOR ARRAY (EPA)

INT_MASK

Address:

0008H

 

Reset State:

00H

The interrupt mask (INT_MASK) register enables or disables (masks) individual interrupt requests. (The EI and DI instructions enable and disable servicing of all maskable interrupts.) INT_MASK is the low byte of the processor status word (PSW). PUSHF or PUSHA saves the contents of this register onto the stack and then clears this register. Interrupt calls cannot occur immediately following a push instruction. POPF or POPA restores it.

7

 

 

 

 

 

 

 

 

 

0

SDU

EXTINT

 

RI1

TI1

 

 

AD

EPAx_OVR

RI0

TI0

 

 

 

 

 

 

 

 

 

7:0

Setting a bit enables the corresponding interrupt.

 

 

 

 

Bit Mnemonic Interrupt Description

 

 

 

 

 

SDU

Serial Debug Unit lnterrupt

 

 

 

 

EXTINT

External Interrupt Pin

 

 

 

 

 

RI1

SIO1 Receive

 

 

 

 

 

TI1

SIO1 Transmit

 

 

 

 

 

AD

A/D Conversion Complete

 

 

 

 

EPAx_OVR

EPA Channel 3–16 Overrun

 

 

 

 

RI0

SIO0 Receive

 

 

 

 

 

TI0

SIO0 Transmit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 11-20. Interrupt Mask (INT_MASK) Register

11-27

8XC196EA USER’S MANUAL

INT_MASK1

Address:

0013H

 

Reset State:

00H

The interrupt mask 1 (INT_MASK1) register enables or disables (masks) individual interrupt requests. (The EI and DI instructions enable and disable servicing of all maskable interrupts.) INT_MASK1 can be read from or written to as a byte register. PUSHA saves this register on the stack and POPA restores it.

7

 

 

 

 

 

 

 

 

0

NMI

STACK

 

PIH0_PTS

PIH0_INT

 

PIH1_PTS

PIH1_INT

SSIO1

SSIO0

 

 

 

 

 

 

 

 

 

7:0

Setting a bit enables the corresponding interrupt.

 

 

 

 

Bit Mnemonic Interrupt Description

 

 

 

 

NMI

Nonmaskable Interrupt

 

 

 

 

STACK

Stack Overflow Error

 

 

 

 

PIH0_PTS

PIH0 PTS Service Request

 

 

 

 

PIH0_INT

PIH0 Interrupt Request

 

 

 

 

PIH1_PTS

PIH1 PTS Service Request

 

 

 

 

PIH1_INT

PIH1 Interrupt Request

 

 

 

 

SSIO1

SSIO1 Transfer

 

 

 

 

 

 

SSIO0

SSIO0 Transfer

 

 

 

 

 

 

The NMI and stack overflow interrupts are always enabled. These nonfunctional mask

 

bits exist for design symmetry with the INT_PEND1 register. Always write zeros to these

 

bits.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 11-21. Interrupt Mask 1 (INT_MASK1) Register

11.7 DETERMINING EVENT STATUS

In compare mode, an interrupt pending bit is set each time a match occurs on an enabled event (even if the interrupt is specifically masked in the mask register). In capture mode, an interrupt pending bit is set each time a programmed event is captured and the event time moves from the capture buffer to the EPAx_TIME register. If the capture buffer is full when an event occurs, an overrun interrupt pending bit is set.

Even if an interrupt is masked, software can poll the interrupt pending registers to determine whether an event has occurred.

11-28

12

Analog-to-digital

(A/D) Converter

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