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

EVENT PROCESSOR ARRAY (EPA)

10.5.4 Programming the Compare-only Channels

To program a compare event, you must first write to the COMPx_CON (Figure 10-11) register to configure the compare-only channel and then load the event time into COMPx_TIME. COMPx_CON has the same bits and settings as EPAx_CON. COMPx_TIME is functionally identical to EPAx_TIME.

COMPx_CON

Address:

x = 0, 1F88H

x = 0–1

Reset State:

x = 1, 1F8CH

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

TB

Time Base Select

 

 

 

 

 

 

 

 

 

Specifies the reference timer.

 

 

 

 

 

 

 

1

= timer 2 is the reference timer and timer 1 is the opposite timer

 

 

 

0

= timer 1 is the reference timer and timer 2 is the opposite timer

 

 

 

A compare event (start of an A/D conversion; clearing, setting, or

 

 

 

 

toggling an output pin; and/or resetting either timer) occurs when the

 

 

 

reference timer matches the time programmed in the event-time register.

 

 

 

 

 

 

 

 

 

6

CE

Compare Enable

 

 

 

 

 

 

 

 

 

This bit enables the compare function.

 

 

 

 

 

 

 

1

= compare function enabled

 

 

 

 

 

 

 

0

= compare function disabled

 

 

 

 

 

 

 

 

 

 

 

 

 

5:4

M1:0

EPA Mode Select

 

 

 

 

 

 

 

 

 

Specifies the type of compare event.

 

 

 

 

 

 

 

M1

M0

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

 

no output

 

 

 

 

 

 

 

 

 

0

 

1

 

clear output pin

 

 

 

 

 

 

 

1

 

0

 

set output pin

 

 

 

 

 

 

 

1

 

1

 

toggle output pin

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

RE

Re-enable

 

 

 

 

 

 

 

 

 

 

 

 

Allows a compare event to continue to execute each time the event-time

 

 

 

register (COMPx_TIME) matches the reference timer rather than only

 

 

 

upon the first time match.

 

 

 

 

 

 

 

 

 

1

= compare function always enabled

 

 

 

 

 

 

 

0

= compare function will drive the output only once.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

10-25

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