Attiny12 calibrated internal rc oscillator, Oscillator calibration register – osccal, Attiny11/12 – Rainbow Electronics ATtiny12 User Manual

Page 30

Advertising
background image

30

ATtiny11/12

1006C–09/01

Note that if a level triggered or pin change interrupt is used for wake-up from Power-
down Mode, the changed level must be held for a time to wake up the MCU. This makes
the MCU less sensitive to noise. The wake-up period is equal to the clock-counting part
of the reset period (See Table 9). The MCU will wake up from the power-down if the
input has the required level for two watchdog oscillator cycles. If the wake-up period is
shorter than two watchdog oscillator cycles, the MCU will wake up if the input has the
required level for the duration of the wake-up period. If the wake-up condition disap-
pears before the wake-up period has expired, the MCU will wake up from power-down
without executing the corresponding interrupt. The period of the watchdog oscillator is
2.7 µs (nominal) at 3.0V and 25

°C. The frequency of the watchdog oscillator is voltage

dependent as shown in the section “ATtiny11 Typical Characteristics” on page 58.

When waking up from Power-down Mode, there is a delay from the wake-up condition
occurs until the wake-up becomes effective. This allows the clock to restart and become
stable after having been stopped. The wake-up period is defined by the same CKSEL
fuses that define the reset time-out period.

ATtiny12 Calibrated
Internal RC Oscillator

In ATtiny12, the calibrated internal oscillator provides a fixed 1.2 MHz (nominal) clock at
5V and 25

°C. This clock may be used as the system clock. See the section “Clock

Options” on page 5 for information on how to select this clock as the system clock. This
oscillator can be calibrated by writing the calibration byte to the OSCCAL register. When
this oscillator is used as the chip clock, the Watchdog Oscillator will still be used for the
Watchdog Timer and for the reset time-out. For details on how to use the pre-pro-
grammed calibration value, see the section “Calibration Byte in ATtiny12” on page 45. At
5V and 25

o

C, the pre-programmed calibration byte gives a frequency within ± 1% of the

nominal frequency.

Oscillator Calibration Register
– OSCCAL

• Bits 7..0 - CAL7..0: Oscillator Calibration Value

Writing the calibration byte to this address will trim the internal oscillator to remove pro-
cess variations from the oscillator frequency. When OSCCAL is zero, the lowest
available frequency is chosen. Writing non-zero values to this register will increase the
frequency of the internal oscillator. Writing $FF to the register gives the highest available
frequency. The calibrated oscillator is used to time EEPROM access. If EEPROM is
written, do not calibrate to more than 10% above the nominal frequency. Otherwise, the
EEPROM write may fail. Table 14 shows the range for OSCCAL. Note that the oscillator
is intended for calibration to 1.2 MHz, thus tuning to other values is not guaranteed.

Bit

7

6

5

4

3

2

1

0

$31

CAL7

CAL6

CAL5

CAL4

CAL3

CAL2

CAL1

CAL0

OSCCAL

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial Value

0

0

0

0

0

0

0

0

Table 14. Internal RC Oscillator Frequency Range

OSCCAL Value

Min Frequency

Max Frequency

$00

0.6 MHz

1.2 MHz

$7F

0.8 MHz

1.7 MHz

$FF

1.2 MHz

2.5 MHz

Advertising