ATmega16M1 Automotive Atmel Corporation, ATmega16M1 Automotive Datasheet - Page 159

no-image

ATmega16M1 Automotive

Manufacturer Part Number
ATmega16M1 Automotive
Description
Manufacturer
Atmel Corporation

Specifications of ATmega16M1 Automotive

Flash (kbytes)
16 Kbytes
Pin Count
32
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
12
Hardware Qtouch Acquisition
No
Max I/o Pins
27
Ext Interrupts
27
Usb Speed
No
Usb Interface
No
Spi
1
Uart
1
Can
1
Lin
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
11
Adc Resolution (bits)
10
Adc Speed (ksps)
125
Analog Comparators
4
Resistive Touch Screen
No
Dac Channels
1
Dac Resolution (bits)
10
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
1
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 150
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
14
Input Capture Channels
1
Pwm Channels
10
32khz Rtc
No
Calibrated Rc Oscillator
Yes
20.3
20.4
7701E–AVR–02/11
Performing a Page Write
Addressing the Flash During Self-Programming
To execute a page write, set up the address in the Z-pointer, write "00000101" to SPMCSR,
and execute SPM within four clock cycles after writing SPMCSR. The data in R1 and R0 are
ignored. The page address must be written to PCPAGE. Other bits in the Z-pointer must be
written to zero during this operation.
The CPU is halted during the page write operation.
The Z-pointer is used to address the SPM commands.
Because the Flash is organized in pages (see
can be treated as having two different sections. One section, consisting of the least significant
bits, is addressing the words within a page, while the most significant bits are addressing the
pages. This is shown in
operations are addressed independently. Therefore it is of major importance that the software
addresses the same page in both the Page Erase and Page Write operation.
The LPM instruction uses the Z-pointer to store the address. Because this instruction
addresses the flash byte-by-byte, the LSB (bit Z0) of the Z-pointer is also used.
Figure 20-1. Addressing the Flash During SPM
Note:
Bit
ZH (R31)
ZL (R30)
Z - REGISTER
1. The different variables used in
PROGRAM MEMORY
BIT
PAGE
PROGRAM
COUNTER
15
Z15
15
Z7
7
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
PCMSB
Figure 21-1 on page
Z14
14
Z6
6
Atmel ATtiny24/44/84 [Preliminary]
PCPAGE
Z13
Z5
13
5
Figure 20-1
ZPAGEMSB
PAGEMSB
PCWORD
Z12
12
Z4
4
167. Note that the Page Erase and Page Write
Table 21-7 on page
WORD ADDRESS
WITHIN A PAGE
(1)
are listed in
1
Z11
0
0
11
Z3
3
INSTRUCTION WORD
PAGE
Table 21-7 on page
Z10
10
Z2
2
166), the Program Counter
Z9
Z1
9
1
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
166.
Z8
Z0
8
0
159

Related parts for ATmega16M1 Automotive