ATMEGA16U2-16AU Atmel, ATMEGA16U2-16AU Datasheet - Page 22
![no-image](/images/manufacturer_photos/0/0/78/atmel_sml.jpg)
ATMEGA16U2-16AU
Manufacturer Part Number
ATMEGA16U2-16AU
Description
8-bit Microcontrollers - MCU 16K Flash
Manufacturer
Atmel
Datasheet
1.ATMEGA16U2-16AU.pdf
(310 pages)
Specifications of ATMEGA16U2-16AU
Product Category
8-bit Microcontrollers - MCU
Rohs
yes
Core
AVR
Data Bus Width
8 bit
Program Memory Size
16 KB
Data Ram Size
1.25 KB
Data Rom Size
512 B
Program Memory Type
Flash
Factory Pack Quantity
1250
- Current page: 22 of 310
- Download datasheet (5Mb)
7799D–AVR–11/10
The EEPROM can not be programmed during a CPU write to the Flash memory. The software
must check that the Flash programming is completed before initiating a new EEPROM write.
Step 2 is only relevant if the software contains a Boot Loader allowing the CPU to program the
Flash. If the Flash is never being updated by the CPU, step 2 can be omitted. See
gramming” on page 246
Caution: An interrupt between step 5 and step 6 will make the write cycle fail, since the
EEPROM Master Write Enable will time-out. If an interrupt routine accessing the EEPROM is
interrupting another EEPROM access, the EEAR or EEDR Register will be modified, causing the
interrupted EEPROM access to fail. It is recommended to have the Global Interrupt Flag cleared
during all the steps to avoid these problems.
When the write access time has elapsed, the EEPE bit is cleared by hardware. The user soft-
ware can poll this bit and wait for a zero before writing the next byte. When EEPE has been set,
the CPU is halted for two cycles before the next instruction is executed.
• Bit 0 – EERE: EEPROM Read Enable
The EEPROM Read Enable Signal EERE is the read strobe to the EEPROM. When the correct
address is set up in the EEAR Register, the EERE bit must be written to a logic one to trigger the
EEPROM read. The EEPROM read access takes one instruction, and the requested data is
available immediately. When the EEPROM is read, the CPU is halted for four cycles before the
next instruction is executed.
The user should poll the EEPE bit before starting the read operation. If a write operation is in
progress, it is neither possible to read the EEPROM, nor to change the EEAR Register.
The calibrated Oscillator is used to time the EEPROM accesses.
gramming time for EEPROM access from the CPU.
Table 7-2.
The following code examples show one assembly and one C function for writing to the
EEPROM. The examples assume that interrupts are controlled (e.g. by disabling interrupts glob-
ally) so that no interrupts will occur during execution of these functions. The examples also
assume that no Flash Boot Loader is present in the software. If such code is present, the
EEPROM write function must also wait for any ongoing SPM command to finish.
Symbol
EEPROM write
(from CPU)
1. Wait until EEPE becomes zero.
2. Wait until SELFPRGEN in SPMCSR becomes zero.
3. Write new EEPROM address to EEAR (optional).
4. Write new EEPROM data to EEDR (optional).
5. Write a logical one to the EEMPE bit while writing a zero to EEPE in EECR.
6. Within four clock cycles after setting EEMPE, write a logical one to EEPE.
EEPROM Programming Time
Number of Calibrated RC Oscillator Cycles
for details about Boot programming.
26,368
ATmega8U2/16U2/32U2
Table 7-2
Typ Programming Time
lists the typical pro-
3.3 ms
“Memory Pro-
22
Related parts for ATMEGA16U2-16AU
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![ATmega16](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Manufacturer:
Atmel Corporation
Datasheet:
![ATMEGA16-16AU](/photos/6/70/67042/313-44-tqfp_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 5V 44TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16MU](/photos/12/13/121316/313-44-qfn_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 5V 44-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16PU](/photos/6/70/67049/453-40-dip_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 5V 40DIP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16MQ](/photos/12/13/121316/313-44-qfn_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 16MHZ 44-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16PC](/photos/6/70/67049/453-40-dip_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ COM 40-DIP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16MC](/photos/12/13/121316/313-44-qfn_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ COM 44-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16PI](/photos/6/70/67049/453-40-dip_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ IND 40-DIP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16MI](/photos/12/13/121316/313-44-qfn_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ IND 44-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16AI](/photos/6/70/67042/313-44-tqfp_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ IND 44-TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16AU SL383](/photos/6/70/67042/313-44-tqfp_tmb.jpg)
Part Number:
Description:
IC MCU 8BIT 16KB FLASH 44TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16AQ](/photos/6/70/67042/313-44-tqfp_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 16MHZ 44-TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA16-16AC](/photos/6/70/67042/313-44-tqfp_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ COM 44-TQFP
Manufacturer:
Atmel
Datasheet: