1 ;***************************************************************************
\r
2 ;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y
\r
5 ;* File Name :"m161def.inc"
\r
6 ;* Title :Register/Bit Definitions for the ATmega161
\r
9 ;* Support telephone :+47 72 88 87 20 (ATMEL Norway)
\r
10 ;* Support fax :+47 72 88 87 18 (ATMEL Norway)
\r
11 ;* Support E-mail :avr@atmel.no
\r
12 ;* Target MCU :ATmega161
\r
15 ;* When including this file in the assembly program file, all I/O register
\r
16 ;* names and I/O register bit names appearing in the data book can be used.
\r
17 ;* In addition, the six registers forming the three data pointers X, Y and
\r
18 ;* Z have been assigned names XL - ZH. Highest RAM address for Internal
\r
19 ;* SRAM is also defined
\r
21 ;* The Register names are represented by their hexadecimal address.
\r
23 ;* The Register Bit names are represented by their bit number (0-7).
\r
25 ;* Please observe the difference in using the bit names with instructions
\r
26 ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc"
\r
27 ;* (skip if bit in register set/cleared). The following example illustrates
\r
30 ;* in r16,PORTB ;read PORTB latch
\r
31 ;* sbr r16,(1<<PB6)+(1<<PB5) ;set PB6 and PB5 (use masks, not bit#)
\r
32 ;* out PORTB,r16 ;output to PORTB
\r
34 ;* in r16,TIFR ;read the Timer Interrupt Flag Register
\r
35 ;* sbrc r16,TOV0 ;test the overflow flag (use bit#)
\r
36 ;* rjmp TOV0_is_set ;jump if set
\r
37 ;* ... ;otherwise do something else
\r
38 ;***************************************************************************
\r
40 ;***** Specify Device
\r
43 ;***** I/O Register Definitions
\r
95 .equ UDR =$0c ;for compatibility with s8515
\r
97 .equ USR =$0b ;for compatibility with s8515
\r
99 .equ UCR =$0a ;for compatibility with s8515
\r
101 .equ UBRR =$09 ;for compatibility with s8515
\r
112 ;***** Bit Definitions
\r
162 .equ SRW =6 ;for compatibility with s8515
\r
165 .equ SM =4 ;for compatibility with s8515
\r
368 ; USR (for compatibility with s8515)
\r
409 ; UCR (for compatibility with s8515)
\r
449 ; Boot loader Lock bit
\r
463 .equ FLASHEND =$1FFF
\r
466 .equ XRAMEND =$FFFF
\r
468 .equ BOOTSTART =$1E00
\r
470 .equ INT0addr =$002 ;External Interrupt0 Vector Address
\r
471 .equ INT1addr =$004 ;External Interrupt1 Vector Address
\r
472 .equ INT2addr =$006 ;External Interrupt1 Vector Address
\r
473 .equ CMP2addr =$008 ;Input Capture1 Interrupt Vector Address
\r
474 .equ OVF2addr =$00a ;Overflow1 Interrupt Vector Address
\r
475 .equ ICP1addr =$00c ;Input Capture1 Interrupt Vector Address
\r
476 .equ OC1Aaddr =$00e ;Output Compare1A Interrupt Vector Address
\r
477 .equ OC1Baddr =$010 ;Output Compare1B Interrupt Vector Address
\r
478 .equ OVF1addr =$012 ;Overflow1 Interrupt Vector Address
\r
479 .equ CMP0addr =$014 ;Overflow1 Interrupt Vector Address
\r
480 .equ OVF0addr =$016 ;Overflow0 Interrupt Vector Address
\r
481 .equ SPIaddr =$018 ;SPI Interrupt Vector Address
\r
482 .equ URXC0addr =$01a ;UART Receive Complete Interrupt Vector Address
\r
483 .equ URXC1addr =$01c ;UART Receive Complete Interrupt Vector Address
\r
484 .equ UDRE0addr =$01e ;UART Data Register Empty Interrupt Vector Address
\r
485 .equ UDRE1addr =$020 ;UART Data Register Empty Interrupt Vector Address
\r
486 .equ UTXC0addr =$022 ;UART Transmit Complete Interrupt Vector Address
\r
487 .equ UTXC1addr =$024 ;UART Transmit Complete Interrupt Vector Address
\r
488 .equ EERDYaddr =$026 ;UART Transmit Complete Interrupt Vector Address
\r
489 .equ ACIaddr =$028 ;Analog Comparator Interrupt Vector Address
\r
491 ;for compatibility with s8515
\r
492 .equ URXCaddr =$01a ;UART Receive Complete Interrupt Vector Address
\r
493 .equ UDREaddr =$01e ;UART Data Register Empty Interrupt Vector Address
\r
494 .equ UTXCaddr =$022 ;UART Transmit Complete Interrupt Vector Address
\r