
194
42073A-MCU Wireless-02/13
ATmega2564/1284/644RFR2
during some power-up cycles (e.g. calibrate only every 10
th power-up time and use the
old calibration results during all other times).
After the completion of the power-up process the calibration will start automatically if bit
LLENCAL in the control register LLCR is 1 (default). The completion of a calibration
cycle is indicated by the bit LLDONE in that same register. After the first cycle the
calibration will continue to run until either the device goes into a sleep mode (“power
down” or “power save”) or by setting the LLENCAL bit to 0. The output voltage of the
Low Leakage Voltage Regulator is then defined by the values in the data register
LLDRL and LLDRH and by the bits LLTCO and LLSHORT of the control register.
Write access to the three register is granted when the bit LLENCAL is set to 0. The
application software can then modify the calibration results. Higher values in the data
register generate lower output voltages in the sleep modes. In general it is not
recommended nor required to alter the automatically generated calibration result.
The write access to the three register must follow a certain scheme to be successful.
The registers are implemented in the I/O clock domain while the logic of the Low
Leakage Voltage Regulator runs with 64 kHz (clock output of the 128 kHz RC oscillator
divided by 2). It takes at least two 64 kHz clock cycles before the data written to the
register take effect in the regulator circuit. The write access from the software must be
aware of this process. Furthermore the value of LLDRH must be written first followed by
LLDRL. Otherwise the LLDRH write access will be ignored. The following Assembler
code fragment shows a working example. Note the polling of bit 3 LLCAL of the LLCR
register to verify the completion of the synchronization process.
Assembly Code Example
…
clr r20
sts
LLDRH,r18
; write LLDRH first
sts
LLDRL,r19
; write LLDRL second
sts
LLCR,r20
; bit 0 cleared = disable automatic calibration
; poll LLCAL bit of LLCR to check if automatic calibration is
; turned of
wait_calib:
lds
r20,LLCR
sbrc r20,3
rjmp wait_calib
; not executed if bit 3 of LLCR is cleared
…
12.6 Register Description
12.6.1 SMCR – Sleep Mode Control Register
Bit
7
6
5
4
3
2
1
0
$33 ($53)
Res3
Res2
Res1
Res0
SM2
SM1
SM0
SE
SMCR
Read/Write
R
RW
Initial Value
0
The Sleep Mode Control Register contains control bits for power management.
Bit 7:4 – Res3:0 - Reserved
Bit 3:1 – SM2:0 - Sleep Mode Select bit 2