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

8XC196Kx, Jx, CA USER’S MANUAL

COMPx_CON

Address:

x = 0, 1F88H

(Continued)

 

x = 1, 1F8CH

x = 0–1

Reset State:

00H

The EPA compare control (COMPx_CON) registers determine the function of the EPA compare channels.

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

TB

CE

 

M1

 

M0

 

 

RE

 

AD

 

ROT

 

RT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

Bit

 

 

 

 

 

 

Function

 

 

 

Number

Mnemonic

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

AD

A/D Conversion

 

 

 

 

 

 

 

 

 

 

Allows the EPA to start an A/D conversion that has been previously set

 

 

 

up in the A/D control registers. To use this feature, you must select the

 

 

 

EPA as the conversion source in the AD_CONTROL register.

 

 

 

 

1

= EPA compare event triggers an A/D conversion

 

 

 

 

 

 

0

= causes no A/D action

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

ROT

Reset Opposite Timer and Reset Timer

 

 

 

 

 

 

 

 

These bits control whether an EPA compare event resets the reference

 

 

 

timer or the opposite timer.

 

 

 

 

 

 

 

 

ROT RT

 

 

 

 

 

 

 

 

 

 

 

 

 

X

0

 

reset function disabled

 

 

 

 

 

 

 

 

0

1

 

resets reference timer

 

 

 

 

 

 

 

 

1

1

 

resets opposite timer

 

 

 

 

 

 

 

 

The state of the TB bit (COMPx_CON.7) determines which timer is the

 

 

 

reference timer and which timer is the opposite timer.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

RT

Reset Timer

 

 

 

 

 

 

 

 

 

 

 

 

 

This bit controls whether the timer selected by the ROT bit will be reset

 

 

 

1

= resets the timer selected by the ROT bit

 

 

 

 

 

 

0

= disables the reset function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 10-11. EPA Compare Control (COMPx_CON) Registers (Continued)

10.6 ENABLING THE EPA INTERRUPTS

The EPA generates four individual event interrupts, EPA0–EPA3, and the multiplexed event interrupt, EPAx. To enable the interrupts, set the corresponding bits in the INT_MASK register (Figure 5-5 on page 5-13). To enable the individual sources of the multiplexed EPAx interrupt, set the corresponding bits in the EPA_MASK (Figure 10-12) and EPA_MASK1(Figure 10-13) registers. (Chapter 5, “Standard and PTS Interrupts,” discusses the interrupts in greater detail.)

10-26

EVENT PROCESSOR ARRAY (EPA)

EPA_MASK

Address:

1FA0H

 

Reset State:

0000H

The EPA interrupt mask (EPA_MASK) register enables or disables (masks) interrupts associated with the multiplexed EPAx interrupt.

 

 

15

 

 

 

 

 

 

 

 

8

 

 

CA, Jx

 

 

EPA8

EPA9

OVR0

 

OVR1

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0VR2

OVR3

 

OVR8

 

OVR9

 

 

 

 

15

 

 

 

 

 

 

 

 

8

 

 

Kx

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPA4

EPA5

EPA6

EPA7

 

EPA8

EPA9

OVR0

 

OVR1

 

 

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OVR2

OVR3

OVR4

OVR5

 

OVR6

OVR7

OVR8

 

OVR9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

Function

 

 

 

 

 

 

Number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

15:0

Setting a bit enables the corresponding interrupt as a multiplexed EPAx interrupt source.

 

 

 

The multiplexed EPAx interrupt is enabled by setting its interrupt enable bit in the interrupt

 

 

 

mask register (INT_MASK.0 = 1).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bits 2–5 and 12–15 are reserved on the 8XC196CA, Jx devices. For compatibility with future

 

 

 

devices, write zeros to these bits.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 10-12. EPA Interrupt Mask (EPA_MASK) Register

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPA_MASK1

 

 

 

 

 

 

Address:

1FA4H

 

 

 

 

 

 

 

 

 

 

Reset State:

00H

 

The EPA interrupt mask 1 (EPA_MASK1) register enables or disables (masks) interrupts associated with the EPAx interrupt.

7

 

 

 

 

 

0

 

COMP0

COMP1

OVRTM1

OVRTM2

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

Function

 

 

 

Number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7:4

Reserved; for compatibility with future devices, write zeros to these bits.

 

 

3:0

Setting a bit enables the corresponding interrupt as a multiplexed EPAx interrupt source.

 

The multiplexed EPAx interrupt is enabled by setting its interrupt enable bit in the

 

interrupt mask register (INT_MASK.0 = 1).

 

 

 

 

 

 

 

 

 

 

 

 

Figure 10-13. EPA Interrupt Mask 1 (EPA_MASK1) Register

10-27

8XC196Kx, Jx, CA USER’S MANUAL

10.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.

The EPA0–EPA3 pending bits are located in INT_PEND (Figure 5-5 on page 5-13). The pending bits for the multiplexed interrupts (those that share EPAx) are located in EPA_PEND (Figure 10-14) and EPA_PEND1 (Figure 10-15). If an interrupt is masked, software can still poll the interrupt pending registers to determine whether an event has occurred.

EPA_PEND

Address:

1FA2H

 

Reset State:

0000H

When hardware detects a pending EPAx interrupt, it sets the corresponding bit in EPA interrupt pending (EPA_PEND or EPA_PEND1) registers. The EPAIPV register contains a number that identifies the highest priority, active, multiplexed interrupt source. When EPAIPV is read, the EPA interrupt pending bit associated with the EPAIPV priority value is cleared.

 

15

 

 

 

 

 

 

 

8

CA, Jx

 

 

EPA8

EPA9

OVR0

OVR1

 

7

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

OVR2

OVR3

 

OVR8

OVR9

 

 

15

 

 

 

 

 

 

 

8

Kx

 

 

 

 

 

 

 

 

 

 

 

EPA4

EPA5

EPA6

EPA7

 

EPA8

EPA9

OVR0

OVR1

 

 

7

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

OVR2

OVR3

OVR4

OVR5

 

OVR6

OVR7

OVR8

OVR9

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

Function

 

 

 

Number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

15:0

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

 

cleared when the EPA interrupt priority vector register (EPAIPV) is read.

 

 

 

 

 

 

 

 

 

 

 

 

Bits 2–5 and 12–15 are reserved on the 8XC196CA, Jx devices. For compatibility with future devices, write zeros to these bits.

Figure 10-14. EPA Interrupt Pending (EPA_PEND) Register

10-28

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