ATTINY12 ATMEL Corporation, ATTINY12 Datasheet - Page 53
![no-image](/images/manufacturer_photos/0/0/79/atmel_corporation_sml.jpg)
ATTINY12
Manufacturer Part Number
ATTINY12
Description
8-bit AVR Microcontroller with 1K Byte Flash
Manufacturer
ATMEL Corporation
Datasheet
1.ATTINY12.pdf
(91 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
ATTINY12-8PC
Manufacturer:
ATM
Quantity:
27 705
Company:
Part Number:
ATTINY12-8PC
Manufacturer:
AD
Quantity:
56
Part Number:
ATTINY12-8PC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY12-8SC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Company:
Part Number:
ATTINY12-8SI
Manufacturer:
ATMEL
Quantity:
1 729
Company:
Part Number:
ATTINY12-8SU
Manufacturer:
ATMEL
Quantity:
5
Company:
Part Number:
ATTINY128SC
Manufacturer:
ATMEL
Quantity:
7 373
Part Number:
ATTINY12L-4SC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY12L-4SU
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
ATTINY12V-1SI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Low-voltage Serial
Programming Algorithm
1006D–AVR–07/03
If the chip Erase command in Low-voltage Serial Programming is executed only once,
one data byte may be written to the flash after erase. Using the following algorithm guar-
antees that the flash will be erased:
•
•
•
For the EEPROM, an auto-erase cycle is provided within the self-timed write instruction
and there is no need to first execute the Chip Erase instruction. The Chip Erase instruc-
tion turns the content of every memory location in both the program and EEPROM
arrays into $FF.
The program and EEPROM memory arrays have separate address spaces:
$0000 to $01FF for program memory and $000 to $03F for EEPROM memory.
The device can be clocked by any clock option during Low-voltage Serial Programming.
The minimum low and high periods for the serial clock (SCK) input are defined as
follows:
Low: > 2 MCU clock cycles
High: > 2 MCU clock cycles
When writing serial data to the ATtiny12, data is clocked on the rising edge of SCK.
When reading data from the ATtiny12, data is clocked on the falling edge of SCK. See
Figure 31, Figure 32 and Table 26 for timing details. To program and verify the ATtiny12
in the serial programming mode, the following sequence is recommended (See 4 byte
instruction formats in Table 25):
1. Power-up sequence:
2. Wait for at least 20 ms and enable serial programming by sending the Program-
3. The serial programming instructions will not work if the communication is out of
4. If a Chip Erase is performed (must be done to erase the Flash), wait t
5. The Flash or EEPROM array is programmed one byte at a time by supplying the
Execute a chip erase command
Write $FF to address $00 in the flash
Execute a second chip erase command
Apply power between VCC and GND while RESET and SCK are set to “0”. In accor-
dance with the setting of CKSEL fuses, apply a crystal/resonator, external clock or
RC network, or let the device run on the internal RC oscillator. In some systems, the
programmer can not guarantee that SCK is held low during power-up. In this case,
RESET must be given a positive pulse of at least two MCU cycles duration after
SCK has been set to “0”.
ming Enable Serial instruction to the MOSI (PB0) pin.
synchronization. When in sync, the second byte ($53) will echo back when issu-
ing the third byte of the Programming Enable instruction. Whether the echo is
correct or not, all 4 bytes of the instruction must be transmitted. If the $53 did not
echo back, give SCK a positive pulse and issue a new Programming Enable
instruction. If the $53 is not seen within 32 attempts, there is no functional device
connected.
after the instruction, give RESET a positive pulse, and start over from Step 2.
See Table 27 on page 56 for t
address and data together with the appropriate Write instruction. An EEPROM
memory location is first automatically erased before new data is written. Use
Data Polling to detect when the next byte in the Flash or EEPROM can be writ-
ten. If polling is not used, wait t
WD_ERASE
WD_FLASH
value.
or t
WD_EEPROM
before transmitting the
ATtiny11/12
WD_ERASE
53