English
Language : 

PIC18F87K22 Datasheet, PDF (214/548 Pages) Microchip Technology – 64/80-Pin, High-Performance, 1-Mbit Enhanced Flash Microcontrollers with 12-Bit A/D and nanoWatt XLP Technology
PIC18F87K22 FAMILY
16.3 Timer3/5/7 16-Bit Read/Write Mode
Timer3/5/7 can be configured for 16-bit reads and
writes (see Figure 16.3). When the RD16 control bit
(TxCON<1>) is set, the address for TMRxH is mapped
to a buffer register for the high byte of Timer3/5/7. A
read from TMRxL will load the contents of the high byte
of Timer3/5/7 into the Timerx High Byte Buffer register.
This provides users with the ability to accurately read
all 16 bits of Timer3/5/7 without having to determine
whether a read of the high byte, followed by a read of
the low byte, has become invalid due to a rollover
between reads.
A write to the high byte of Timer3/5/7 must also take
place through the TMRxH Buffer register. The Timer3/
5/7 high byte is updated with the contents of TMRxH
when a write occurs to TMRxL. This allows users to
write all 16 bits to both the high and low bytes of
Timer3/5/7 at once.
The high byte of Timer3/5/7 is not directly readable or
writable in this mode. All reads and writes must take
place through the Timerx High Byte Buffer register.
Writes to TMRxH do not clear the Timer3/5/7 prescaler.
The prescaler is only cleared on writes to TMRxL.
16.4 Using the SOSC Oscillator as the
Timer3/5/7 Clock Source
The SOSC internal oscillator may be used as the clock
source for Timer3/5/7. The SOSC oscillator is enabled
by any peripheral that requests it. There are eight ways
the SOSC can be enabled: if the SOSC is selected as
the source by any of the odd timers, which is done by
each respective SOSCEN bit (TxCON<3>), if the
SOSC is selected as the RTCC source by the RTCOSC
Configuration bit (CONFIG3L<1>), if the SOSC is
selected as the CPU clock source by the SCS bits
(OSCCON<1:0>) or if the SOSCGO bit is set
(OSCCON2<3>). The SOSCGO bit is used to warm up
the SOSC so that it is ready before any peripheral
requests it. To use it as the Timer3/5/7 clock source, the
TMRxCS bit must also be set. As previously noted, this
also configures Timer3/5/7 to increment on every rising
edge of the oscillator source.
The SOSC oscillator is described in Section 14.5
“SOSC Oscillator”.
DS39960B-page 214
Preliminary
 2010 Microchip Technology Inc.