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

EVENT PROCESSOR ARRAY (EPA)

CLKOUT

 

 

 

 

 

 

 

 

 

 

 

 

PH2

 

 

 

 

 

 

 

 

 

 

 

 

TxCLK

 

 

 

 

 

 

 

 

 

 

 

 

TxDIR

 

 

 

 

 

 

 

 

 

 

 

 

COUNT

x

x + 1

x + 2

x + 3

x + 4

x + 5

x + 6

x + 5

x + 4

x + 3

x + 2

x + 1

 

 

 

 

 

 

 

 

 

 

 

 

A0269-02

Figure 10-4. Quadrature Mode Timing and Count

10.4 EPA CHANNEL FUNCTIONAL OVERVIEW

The EPA has ten programmable capture/compare channels that can perform the following tasks.

capture the current timer value when a specified transition occurs on the EPA pin

start an A/D conversion when an event is captured or the timer value matches the programmed value in the event-time register

clear, set, or toggle the EPA pin when the timer value matches the programmed value in the event-time register

generate an interrupt when a capture or compare event occurs

generate an interrupt when a capture overrun occurs

reset its own base timer in compare mode

reset the opposite timer in both compare and capture mode

In addition to the capture/compare channels, the EPA also has two compare-only channels. They support all the compare functions of the capture/compare channels.

10-9

8XC196Kx, Jx, CA USER’S MANUAL

Each EPA channel has a control register, EPAx_CON (capture/compare channels) or COMPx_CON (compare-only channels); an event-time register, EPAx_TIME (capture/compare channels) or COMPx_TIME (compare-only channels); and a timer input (Figure 10-5). The control register selects the timer, the mode, and either the event to be captured or the event that is to occur. The event-time register holds the captured timer value in capture mode and the event time in compare mode. See “Programm ing the Capture/Compare Channels” on page 10-20 and “Programming the Compare-only Channels” on page 10-25 for configuration information.

The two compare-only channels share output pins with capture/compare channels 8 and 9. This means that both capture/compare channel 8 and compare-only channel 0 can set, clear, or toggle the EPA8/COMP0 pin. They can operate at the same time, and neither has priority in its access to the output pin. Capture/compare channel 9 and compare-only channel 1 share the EPA9/COMP1 pin in this same way.

 

 

Timer/Counter Unit

 

 

 

 

 

 

 

 

 

TIMER1

 

Clock on

 

 

 

 

 

 

 

 

 

 

TIMER2

 

TIMER1 overflow

 

 

 

 

 

 

 

 

 

 

 

 

External clocking (TxCLK) with up to 6-bit prescaler Quadrature clocking through TxCLK and TxDIR Internal clocking with up to 6-bit prescaler

Bus

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPA Capture/Compare

 

 

 

 

 

 

 

 

 

 

Capture Overrun

 

 

 

 

 

 

 

Channel x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OVRx

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interrupt

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPAx_TIME

 

 

 

Capture

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPA Pin

 

 

 

 

 

 

 

 

 

Buffer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Compare

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TGL

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Interrupt

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reset Timer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EPAx_CON

 

Overwrite

 

 

 

 

Start A/D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Mode Control

 

 

 

Mode Selection

Remap

EPA1 and 3 only. If enabled for EPA1, EPA0 shares the EPA1 pin. If enabled for EPA3, EPA2 shares the EPA3 pin.

A0270-02

Figure 10-5. A Single EPA Capture/Compare Channel

10-10

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