ATtiny167 Atmel Corporation, ATtiny167 Datasheet - Page 223

no-image

ATtiny167

Manufacturer Part Number
ATtiny167
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of ATtiny167

Flash (kbytes)
16 Kbytes
Pin Count
20
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
8
Hardware Qtouch Acquisition
No
Max I/o Pins
16
Ext Interrupts
16
Usb Speed
No
Usb Interface
No
Spi
2
Twi (i2c)
1
Uart
1
Lin
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
11
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
0.5
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 85
I/o Supply Class
1.8 to 5.5
Operating Voltage (vcc)
1.8 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
3
Input Capture Channels
1
Pwm Channels
9
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATtiny167-15MZ
Manufacturer:
ATMEL
Quantity:
670
Part Number:
ATtiny167-A15MZ
Manufacturer:
ATMEL
Quantity:
480
Part Number:
ATtiny167-A15MZ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATtiny167-A15XD
Manufacturer:
BOSCH
Quantity:
40 000
Part Number:
ATtiny167-A15XZ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATtiny167-AXZ
Quantity:
17
20.2.7
8265B–AVR–09/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
223

Related parts for ATtiny167