ATTINY167-15XD Atmel, ATTINY167-15XD Datasheet - Page 223

MCU AVR 16K FLASH 15MHZ 20-TSSOP

ATTINY167-15XD

Manufacturer Part Number
ATTINY167-15XD
Description
MCU AVR 16K FLASH 15MHZ 20-TSSOP
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheet

Specifications of ATTINY167-15XD

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
I²C, LIN, SPI, UART/USART, USI
Peripherals
Brown-out Detect/Reset, POR, PWM, Temp Sensor, WDT
Number Of I /o
16
Program Memory Size
16KB (8K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 11x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 150°C
Package / Case
20-TSSOP
Processor Series
ATTINY1x
Core
AVR8
Data Bus Width
8 bit
Data Ram Size
512 B
Maximum Clock Frequency
16 MHz
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
EWAVR, EWAVR-BL
Development Tools By Supplier
ATAVRDRAGON, ATSTK500, ATSTK600, ATAVRISP2, ATAVRONEKIT
Minimum Operating Temperature
- 40 C
For Use With
ATSTK600-SOIC - STK600 SOCKET/ADAPTER FOR SOIC
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
20.2.7
7728G–AVR–06/10
Simple Assembly Code Example for a Boot Loader
Note that the RWWSB bit will always be read as zero in ATtiny87/167. Nevertheless, it is
recommended to check this bit as shown in the code example, to ensure compatibility with
devices supporting Read-While-Write.
.equ PAGESIZEB = PAGESIZE*2
.org SMALLBOOTSTART
Write_page:
Wrloop:
Rdloop:
;- The routine writes one page of data from RAM to Flash
;
;
;- Error handling is not included
;- Registers used: r0, r1, temp1 (r16), temp2 (r17), looplo (r24),
;
; - Storing and restoring of registers is not included in the routine
;
; Page Erase
ldi
rcall Do_spm
; Clear temporary page buffer
ldi
rcall Do_spm
; Transfer data from RAM to Flash temporary page buffer
ldi
ldi
ld
ld
ldi
rcall Do_spm
adiw
sbiw
brne
; Execute Page Write
subi
sbci
ldi
rcall Do_spm
; Clear temporary page buffer
ldi
rcall Do_spm
; Read back and check, optional
ldi
ldi
subi
sbci
lpm
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
register usage can be optimized at the expense of code size
spmcsrval, (1<<PGERS) | (1<<SELFPGEN)
spmcsrval, (1<<CPTB) | (1<<SELFPGEN)
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
r0, Y+
r1, Y+
spmcsrval, (1<<SELFPGEN)
ZH:ZL, 2
loophi:looplo, 2
Wrloop
ZL, low(PAGESIZEB)
ZH, high(PAGESIZEB)
spmcsrval, (1<<PGWRT) | (1<<SELFPGEN)
spmcsrval, (1<<CPTB) | (1<<SELFPGEN)
looplo, low(PAGESIZEB)
loophi, high(PAGESIZEB)
YL, low(PAGESIZEB)
YH, high(PAGESIZEB)
r0, Z+
loophi (r25), spmcsrval (r20)
; AGESIZEB is page size in BYTES, not words
; use subi for PAGESIZEB<=256
; restore pointer
; not required for PAGESIZEB<=256
; init loop variable
; not required for PAGESIZEB<=256
; restore pointer
; init loop variable
; not required for PAGESIZEB<=256
ATtiny87/ATtiny167
223

Related parts for ATTINY167-15XD