ATtiny22/22L
34
Memory Programming
Program and Data Memory Lock Bits
The ATtiny22/L MCU provides two lock bits which can be left unprogrammed (“1”) or can be programmed (“0”) to obtain the
additional features listed in Table 12 . The Lock bits can only be erased with the Chip Erase operation.
Note:
1. In the High-voltage Serial Programming mode, further programming of the Fuse bits are also disabled. Program the fuse bits
before programming the lock bits.
Fuse Bits
The ATtiny22/L has two Fuse bits, SPIEN and RCEN.
• When the SPIEN Fuse is programmed (“0”), Serial Program and Data Downloading is enabled. Default value is
programmed (“0”). This bit is not accessible in the Low-Voltage Serial Programming mode.
• When the RCEN Fuse is programmed (“0”), the internal RC oscillator is selected as the MCU clock source. Default value
is programmed (“0”). Changing the RCEN Fuse does not have effect until the next power-on reset.
The status of the Fuse bits is not affected by Chip Erase.
Signature Bytes
All Atmel microcontrollers have a three-byte signature code which identifies the device. The three bytes reside in a sepa-
rate address space.
For ATtiny22/L
they are:
1.
$000: $1E (indicates manufactured by Atmel)
2.
$001: $91 (indicates 2K bytes Flash memory)
3.
$002: $06 (Indicates ATtiny22/L when signature byte $001 is $91.)
Note:
1. When both lock bits are programmed (Lock mode 3), the signature bytes can not be read in the Low-voltage Serial mode.
Reading the signature bytes will return: $00, $01 and $02.
Programming the Flash and EEPROM
Atmel’s ATtiny22/L offers 2K bytes of in-system programmable Flash Program memory and 128 bytes of EEPROM Data
memory.
The ATtiny22/L is shipped with the on-chip Flash Program and EEPROM Data memory arrays in the erased state
(i.e., contents = $FF) and ready to be programmed.
The device supports a High-voltage (12V) Serial Programming mode and a Low-voltage Serial Programming mode. The
+12V is used for programming enable only, and no current of significance is drawn by this pin. The Low-voltage Serial
Programming mode provides a convenient way to download Program and Data into the device inside the user’s system.
The Program and EEPROM memory arrays in the ATtiny22/L are programmed byte-by-byte in either programming modes.
For the EEPROM, an auto-erase cycle is provided within the self-timed write instruction in the Low-voltage Serial
Programming mode.
During programming, the supply voltage must be in accordance with Table 13.
Table 12. Lock Bit Protection Modes
Memory Lock Bits
Protection Type
Mode
LB1
LB2
1
1
1
No memory lock features enabled.
2
0
1
Further programming of the Flash and EEPROM is disabled.
3
0
0
Same as mode 2, and verify is also disabled.