Datasheet

PIC18(L)F2X/45K50
DS30684A-page 50 2012 Microchip Technology Inc.
3.15 Active Clock Tuning (ACT) Module
The Active Clock Tuning (ACT) module continuously
adjusts the 16 MHz internal oscillator, using an
available external reference, to achieve ± 0.20%
accuracy. This eliminates the need for a high-speed,
high-accuracy external crystal when the system has an
available lower speed, lower power, high-accuracy
clock source available.
Systems implementing a Real-Time Clock Calendar
(RTCC) or a full-speed USB application can take full
advantage of the ACT module.
3.16 Active Clock Tuning Operation
The ACT module defaults to the disabled state after
any Reset. When the ACT module is disabled, the user
can write to the TUN<6:0> bits in the OSCTUNE
register to manually adjust the 16 MHz internal
oscillator.
The module is enabled by setting the ACTEN bit of the
ACTCON register. When enabled, the ACT module
takes control of the OSCTUNE register. The ACT
module uses the selected ACT reference clock to tune
the 16 MHz internal oscillator to an accuracy of 16 MHz
± 0.2%. The tuning automatically adjusts the
OSCTUNE register every reference clock cycle.
3.17 Active Clock Tuning Source
Selection
The ACT reference clock is selected with the ACTSRC
bit of the ACTCON register. The reference clock
sources are provided by the:
USB module in full-speed operation (ACT_clk)
Secondary clock at 32.768 kHz (SOSC_clk)
3.18 ACT Lock Status
The ACTLOCK bit will be set to ‘1, when the 16 MHz
internal oscillator is successfully tuned.
The bit will be cleared by the following conditions:
Out of Lock condition
Device Reset
Module is disabled
3.19 ACT Out-of-Range Status
If the ACT module requires an OSCTUNE value
outside the range to achieve ± 0.20% accuracy, then
the ACT Out-of-Range (ACTORS) Status bit will be set
to ‘1’.
An out-of-range status can occur:
When the 16 MHZ internal oscillator is tuned to its
lowest frequency and the next ACT_clk event
requests a lower frequency.
When the 16 MHZ internal oscillator is tuned to its
highest frequency and the next ACT_clk event
requests a higher frequency.
When the ACT out-of-range event occurs, the 16 MHz
internal oscillator will continue to use the last written
OSCTUNE value. When the OSCTUNE value moves
back within the tunable range and ACTLOCK is
established, the ACTORS bit is cleared to ‘0’.
FIGURE 3-11: ACTIVE CLOCK TUNING BLOCK DIAGRAM
Note 1: When the ACT module is enabled, the
OSCTUNE register is only updated by
the module. Writes to the OSCTUNE
register by the user are inhibited, but
reading the register is permitted.
2: After disabling the ACT module, the user
should wait three instructions before
writing to the OSCTUNE register.