ATMEGA165PV-8ANR Atmel, ATMEGA165PV-8ANR Datasheet - Page 261
![IC MCU AVR 16K 8MHZ 64TQFP](/photos/12/13/121332/313-64-tqfp_sml.jpg)
ATMEGA165PV-8ANR
Manufacturer Part Number
ATMEGA165PV-8ANR
Description
IC MCU AVR 16K 8MHZ 64TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Specifications of ATMEGA165PV-8ANR
Core Processor
AVR
Core Size
8-Bit
Speed
8MHz
Connectivity
SPI, UART/USART, USI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
54
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)
1.8 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
64-TQFP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
- Current page: 261 of 364
- Download datasheet (8Mb)
24.8.12
8019K–AVR–11/10
Boot Loader: Simple Assembly Code Example
.equ PAGESIZEB = PAGESIZE*2
.org SMALLBOOTSTART
Write_page:
Wrloop:
Rdloop:
;-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
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
;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
ATmega165P
261
Related parts for ATMEGA165PV-8ANR
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![ATmega165P](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Manufacturer:
Atmel Corporation
Datasheet:
![ATMEGA165P-16AU](/photos/12/13/121332/313-64-tqfp_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 64-TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16MU](/photos/12/13/121326/313-64-qfn_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 64-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16AUR](/photos/12/13/121332/313-64-tqfp_tmb.jpg)
Part Number:
Description:
MCU AVR 128K FLASH 16MHZ 64TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16MN](/photos/12/13/121326/313-64-qfn_tmb.jpg)
Part Number:
Description:
MCU AVR 16KB FLASH 16MHZ 64QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16MUR](/photos/12/13/121326/313-64-qfn_tmb.jpg)
Part Number:
Description:
IC MCU AVR 16K 16MHZ 64MLF
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16ANR](/photos/12/13/121332/313-64-tqfp_tmb.jpg)
Part Number:
Description:
IC MCU AVR 16K 16MHZ 64TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16MNR](/photos/12/13/121326/313-64-qfn_tmb.jpg)
Part Number:
Description:
IC MCU AVR 16K 16MHZ 64MLF
Manufacturer:
Atmel
Datasheet:
![ATMEGA165P-16AN](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
8-bit Microcontrollers - MCU AVR 16KB FL 512B EE 1KB SRAM 16 MHZ GRN
Manufacturer:
Atmel
![atmega165pv](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Atmega165p 8-bit Avr Microcontroller With 16k Bytes In-system Programmable Flash
Manufacturer:
ATMEL Corporation
Datasheet:
![ATMEGA165-16AI](/photos/12/13/121332/313-64-tqfp_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 64TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA165-16MI](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 64-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA165](/images/no-image3.png)
Part Number:
Description:
8-bit Microcontroller with 16K Bytes In-System Programmable Flash
Manufacturer:
ATMEL [ATMEL Corporation]
Datasheet:
![ATMEGA165-16MU](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
IC AVR MCU 16K 16MHZ 64-QFN
Manufacturer:
Atmel
Datasheet: