ATmega48 Automotive Atmel Corporation, ATmega48 Automotive Datasheet - Page 158

no-image

ATmega48 Automotive

Manufacturer Part Number
ATmega48 Automotive
Description
Manufacturer
Atmel Corporation

Specifications of ATmega48 Automotive

Flash (kbytes)
4 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
23
Ext Interrupts
24
Usb Speed
No
Usb Interface
No
Spi
2
Twi (i2c)
1
Uart
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
No
Crypto Engine
No
Sram (kbytes)
0.5
Eeprom (bytes)
256
Self Program Memory
NO
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 125
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
3
Output Compare Channels
6
Input Capture Channels
1
Pwm Channels
6
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes
20. Self-Programming the Flash
20.1
20.2
158
Performing Page Erase by SPM
Filling the Temporary Buffer (Page Loading)
Atmel ATtiny24/44/84 [Preliminary]
The device provides a self-programming mechanism (SPM) for downloading and uploading
program code by the MCU itself. The self programming can use any available data interface
and associated protocol to read code and write (program) that code into program memory.
Program memory is updated in a page-by-page fashion. Before programming a page with the
data stored in the temporary page buffer, the page must be erased. The temporary page buf-
fer is filled one word at a time using SPM, and the buffer can be filled either before the page
erase command or between a page erase and a page write operation:
Alternative 1 - Fill the buffer before a page erase
• Fill the temporary page buffer
• Perform a Page Erase
• Perform a Page Write
Alternative 2 - Fill the buffer after a page erase
• Perform a Page Erase
• Fill the temporary page buffer
• Perform a Page Write
If only a part of the page needs to be changed, the rest of the page must be stored (for exam-
ple in the temporary page buffer) before the erase, and then be re-written. When using
alternative 1, the boot loader provides an effective read-modify-write feature, which allows the
user software to first read the page and do the necessary changes, and then write back the
modified data. If alternative 2 is used, it is not possible to read the old data while loading
because the page is already erased. The temporary page buffer can be accessed in a random
sequence. It is essential that the page address used in both the page erase and page write
operation is addressing the same page.
To execute a page erase, set up the address in the Z-pointer, write "00000011" 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 in the Z-register. Other bits in the
Z-pointer will be ignored during this operation.
The CPU is halted during the page erase operation.
To write an instruction word, set up the address in the Z-pointer and data in R1:R0, write
“00000001” to SPMCSR and execute SPM within four clock cycles after writing SPMCSR. The
content of PCWORD in the Z-register is used to address the data in the temporary buffer. The
temporary buffer will auto-erase after a Page Write operation or by writing the CTPB bit in
SPMCSR. It is also erased after a system reset. Note that it is not possible to write more than
one time to each address without erasing the temporary buffer.
If the EEPROM is written in the middle of an SPM Page Load operation, all data loaded will be
lost.
7701E–AVR–02/11

Related parts for ATmega48 Automotive