8XC196MC, MD, MH USER’S MANUAL
8-2
The frequency register (FREQ_GEN) controls the output frequency. The frequency generator
loads the FREQ_GEN value into the counter. The counter counts down until it reaches zero, at
which time the value is reloaded from the FREQ_GEN register. Each load toggles the D flip-flop,
producing the 50% duty cycle output. The count register (FREQ_CNT) reflects the current value
of the down-counter. Table 8-1 describes the frequency generator’s output signal and Table 8-2
describes the control and status registers.
.
Table 8-1. Frequency Generator Signal
Port
Pin
Frequency
Generator
Signal
Frequency
Generator
Signal Type
Description
P7.7 FREQOUT O Frequency Generator Output
This signal carries the output of the frequency generator.
Table 8-2. Frequency Generator Control and Status Registers
Mnemonic Address Description
FREQ_GEN 1FB8H Frequency
The frequency register holds a programmed value that determines the
output frequency. This value is reloaded into the down-counter each time the
counter reaches 0.
FREQ_CNT 1FBAH Count
The read-only counter register reflects the current counter value.
P7_DIR 1FD3H Port 7 Direction
Bit 7 controls the direction of P7.7/FREQOUT. Clear this bit to configure
FREQOUT as a complementary output.
P7_MODE 1FD1H Port 7 Mode
Bit 7 controls the mode (general-purpose I/O or special-function signal) of
P7.7/FREQOUT. Set this bit to configure the pin for its FREQOUT function.
P7_PIN 1FD7H Port 7 Input
Bit 7 reflects the current state of P7.7/FREQOUT, regardless of its configu-
ration.
P7_REG 1FD5H Port 7 Data Output
Bit 7 contains data to be driven out by P7.7/FREQOUT in general-purpose
I/O mode. In special-function mode, the frequency generator controls the
pin.