ATMEGA16-16AUR Atmel, ATMEGA16-16AUR Datasheet - Page 256

MCU AVR 128KB FLASH 16MHZ 44TQFP

ATMEGA16-16AUR

Manufacturer Part Number
ATMEGA16-16AUR
Description
MCU AVR 128KB FLASH 16MHZ 44TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA16-16AUR

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
32
Program Memory Size
16KB (8K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
4.5 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
44-TQFP, 44-VQFP
For Use With
ATSTK600-TQFP44 - STK600 SOCKET/ADAPTER 44-TQFPATSTK500 - PROGRAMMER AVR STARTER KIT
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA16-16AUR
Manufacturer:
Encoders
Quantity:
101
Part Number:
ATMEGA16-16AUR
Manufacturer:
Atmel
Quantity:
10 000
Simple Assembly
Code Example for a
Boot Loader
2466T–AVR–07/10
.equ PAGESIZEB = PAGESIZE*2
.org SMALLBOOTSTART
Write_page:
Wrloop:
Rdloop:
Return:
;-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
ldi
call Do_spm
; read back and check, optional
ldi
ldi
subi YL, low(PAGESIZEB)
sbci YH, high(PAGESIZEB)
lpm
ld
cpse r0, r1
jmp
sbiw loophi:looplo, 1
brne Rdloop
; return to RWW section
; verify that RWW section is safe to read
in
spmcrval, (1<<PGERS) | (1<<SPMEN)
spmcrval, (1<<RWWSRE) | (1<<SPMEN)
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
r0, Y+
r1, Y+
spmcrval, (1<<SPMEN)
spmcrval, (1<<PGWRT) | (1<<SPMEN)
spmcrval, (1<<RWWSRE) | (1<<SPMEN)
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
r0, Z+
r1, Y+
Error
temp1, SPMCR
; PAGESIZEB is page size in BYTES, not
; words
;init loop variable
;not required for PAGESIZEB<=256
;use subi for PAGESIZEB<=256
;restore pointer
;not required for PAGESIZEB<=256
;init loop variable
;not required for PAGESIZEB<=256
;restore pointer
;use subi for PAGESIZEB<=256
ATmega16(L)
256

Related parts for ATMEGA16-16AUR