.TUN0).
5 : 0$ +%.":0
When OSCCON has configured the CPU to use the primary clock, Configuration
register 1 high (CONFIG1H) selects the clock??™s source. FOSC3..FOSC0
set the source as a timing input on the OSC1 and OSC2 pins (in some cases
only OSC1 is used) or as the chip??™s internal oscillator block.
Depending on the values of the FOSC bits, the primary clock??™s frequency can
be the same as the frequency at OSC1 and OSC2 or four times that value. Setting
FOSC3..FOSC0 to 0001b configures the chip to use an external oscillator
for FOSC. A 10-MHz oscillator results in FOSC = 10 MHz. Setting the bits to
0110b enables using slower external clocks by setting FOSC equal to the external
oscillator??™s frequency multiplied by four. A 10-MHz oscillator results in
FOSC = 40 MHz.
The functions of the bits in the configuration registers vary with the chip, so
always check the data sheet for the chip you??™re using.
Chapter 11
236
& 5
5 &5 &50
The baud rate generator registers (SPBRG and optionally SPBRGH) contain a
value used in setting the bit rate. If the BAUDCON register??™s BRG16 = 0, the
value is 8 bits and SPBRG contains the entire value. If BRG16 = 1, the value is
16 bits, SPBRG contains the low byte, and SPBRGH contains the high byte.
& 5
To set the register values for a desired bit rate, do the following:
1.
Pages:
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265