FREQUENCY GENERATOR

8.2PROGRAMMING THE FREQUENCY GENERATOR

This section explains how to configure the frequency generator and determine its status.

8.2.1Configuring the Output

The frequency generator’s output is multiplexed with P7.7, so you m ust configure it as a special- function output signal. To do so, follow this sequence:

1.Clear bit 7 of P7_DIR.

2.Set bit 7 of P7_MODE.

3.Clear bit 7 of P7_REG.

Refer to Chapter 6, “I/O Ports,” for additional information about configuring port pins.

8.2.2Programming the Frequency

Program the frequency register (Figure 8-2) to control the frequency of the output.

FREQ_GEN

Address:

1FB8H

(8XC196MD)

Reset State:

00H

The frequency (FREQ_GEN) register holds a programmed value that specifies the output frequency. This value is reloaded into the down-counter each time the counter reaches 0.

 

7

0

8XC196MD

 

Output Frequency

 

 

 

Bit

 

Function

Number

 

 

 

 

 

7:0

Output Frequency

 

Use the following formula to calculate the FREQ value for the desired output frequency

 

and write this value to the frequency register.

 

 

FXTAL1

 

FREQ = --------------------------------------------1

 

16

× FREQ_OUT

 

where:

 

 

FREQ

= 8-bit value to load into FREQ_GEN register

 

FXTAL1

= input frequency on XTAL1 pin, in MHz

 

FREQ_OUT

= output frequency on FREQOUT pin, in MHz

 

 

 

Figure 8-2. Frequency (FREQ_GEN) Register

8-3

Page 190
Image 190
Intel 8XC196MH, 8XC196MD, 8XC196MC manual Programming the Frequency Generator, Configuring the Output, Freqgen, Bit