beautypg.com

Capture operating mode, Capture registers a and b (ra and rb), Trigger conditions – Rainbow Electronics AT75C220 User Manual

Page 102: Status register

background image

AT75C220

102

Capture Operating Mode

This mode is entered by clearing the WAVE parameter in
TC_CMR (Channel Mode Register). Capture mode allows
the TC Channel to perform measurements such as pulse
timing, frequency, period, duty cycle and phase on TIOA
and TIOB signals which are inputs.

Figure 25 shows the configuration of the TC Channel when
programmed in capture mode.

Capture Registers A and B (RA and RB)
Registers A and B are used as capture registers. This
means that they can be loaded with the counter value when
a programmable event occurs on the signal TIOA.

The parameter LDRA in TC_CMR defines the TIOA edge
for the loading of register A, and the parameter LDRB
defines the TIOA edge for the loading of Register B.

RA is loaded only if it has not been loaded since the last
trigger or if RB has been loaded since the last loading of
RA.

RB is loaded only if RA has been loaded since the last trig-
ger or the last loading of RB.

Loading RA or RB before the read of the last value loaded
sets the Overrun Error Flag (LOVRS) in TC_SR (Status
Register). In this case, the old value is overwritten.

Trigger Conditions
In addition to the SYNC signal, the software trigger and the
RC compare trigger, an external trigger can be defined.

Bit ABETRG in TC_CMR selects input signal TIOA or TIOB
as an external trigger. Parameter ETRGEDG defines the
edge (rising, falling or both) detected to generate an exter-
nal trigger. If ETRGEDG = 0 (none), the external trigger is
disabled.

Status Register
The following bits in the status register are significant in
capture operating mode.

CPCS: RC Compare Status

There has been an RC Compare match at least once
since the last read of the status.

COVFS: Counter Overflow Status

The counter has attempted to count past $FFFF since
the last read of the status.

LOVRS: Load Overrun Status

RA or RB has been loaded at least twice without any
read of the corresponding register since the last read of
the status.

LDRAS: Load RA Status

RA has been loaded at least once without any read
since the last read of the status.

LDRBS: Load RB Status

RB has been loaded at least once without any read
since the last read of the status.

ETRGS: External Trigger Status

An external trigger on TIOA or TIOB has been detected
since the last read of the status.