ATMEGA48-20PJ Atmel, ATMEGA48-20PJ Datasheet - Page 278

IC AVR MCU 4K 5V 20MHZ 28-DIP

ATMEGA48-20PJ

Manufacturer Part Number
ATMEGA48-20PJ
Description
IC AVR MCU 4K 5V 20MHZ 28-DIP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheets

Specifications of ATMEGA48-20PJ

Core Processor
AVR
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
23
Program Memory Size
4KB (2K x 16)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 6x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
28-DIP (0.300", 7.62mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
ATMEGA48-24PJ
ATMEGA48-24PJ
26.8.11
26.8.12
278
ATmega48/88/168
Programming Time for Flash when Using SPM
Simple Assembly Code Example for a Boot Loader
The calibrated RC Oscillator is used to time Flash accesses.
gramming time for Flash accesses from the CPU.
Table 26-5.
Note:
Flash write (Page Erase, Page Write, and
write Lock bits by SPM)
.equ PAGESIZEB = PAGESIZE*2
.org SMALLBOOTSTART
Write_page:
Wrloop:
;-the routine writes one page of data from RAM to Flash
; the first data location in RAM is pointed to by the Y pointer
; the first data location in Flash is pointed to by the Z-pointer
;-error handling is not included
;-the routine must be placed inside the Boot space
; (at least the Do_spm sub routine). Only code inside NRWW section can
; be read during Self-Programming (Page Erase and Page Write).
;-registers used: r0, r1, temp1 (r16), temp2 (r17), looplo (r24),
; loophi (r25), spmcrval (r20)
; storing and restoring of registers is not included in the routine
; register usage can be optimized at the expense of code size
;-It is assumed that either the interrupt table is moved to the Boot
; loader section or that the interrupts are disabled.
; Page Erase
ldi
call Do_spm
; re-enable the RWW section
ldi
call Do_spm
; transfer data from RAM to Flash page buffer
ldi
ldi
ld
ld
ldi
call Do_spm
adiw ZH:ZL, 2
sbiw loophi:looplo, 2
brne Wrloop
; execute Page Write
subi ZL, low(PAGESIZEB)
sbci ZH, high(PAGESIZEB)
ldi
call Do_spm
; re-enable the RWW section
1. Minimum and maximum programming time is per individual operation.
spmcrval, (1<<PGERS) | (1<<SELFPRGEN)
spmcrval, (1<<RWWSRE) | (1<<SELFPRGEN)
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
r0, Y+
r1, Y+
spmcrval, (1<<SELFPRGEN)
spmcrval, (1<<PGWRT) | (1<<SELFPRGEN)
SPM Programming Time
Symbol
(1)
;PAGESIZEB is page size in BYTES, not words
Min Programming Time
;init loop variable
;not required for PAGESIZEB<=256
;use subi for PAGESIZEB<=256
;restore pointer
;not required for PAGESIZEB<=256
3.7 ms
Table 26-5
Max Programming Time
shows the typical pro-
4.5 ms
2545S–AVR–07/10

Related parts for ATMEGA48-20PJ