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 :"m8535def.inc"
\r
6 ;* Title :Register/Bit Definitions for the ATmega8535
\r
7 ;* Date : April 16th, 2002
\r
9 ;* Support telephone :+47 72 88 43 88 (ATMEL Norway)
\r
10 ;* Support fax :+47 72 88 43 99 (ATMEL Norway)
\r
11 ;* Support E-mail :support@atmel.no
\r
12 ;* Target MCU :ATmega8535
\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
49 .equ GICR =$3b ;new name for GIMSK
\r
57 .equ MCUSR =$34 ;For compatibility,
\r
58 .equ MCUCSR =$34 ;keep both names until further
\r
78 .equ UBRRH =$20 ;Note! UCSRC equals UBRRH
\r
101 .equ UCSRC =$20 ;Note! UCSRC equals UBRRH
\r
117 ;***** Bit definitions*****
\r
122 .equ IVSEL =1 ; interrupt vector select
\r
123 .equ IVCE =0 ; interrupt vector change enable
\r
178 .equ PWM0 =6 ; OBSOLETE! Use WGM00
\r
182 .equ CTC0 =3 ; OBSOLETE! Use WGM01
\r
195 .equ PWM11 =1 ; OBSOLETE! Use WGM11
\r
196 .equ PWM10 =0 ; OBSOLETE! Use WGM10
\r
203 .equ CTC1 =3 ; OBSOLETE! Use WGM12
\r
204 .equ CTC11 =4 ; OBSOLETE! Use WGM13
\r
205 .equ CTC10 =3 ; OBSOLETE! Use WGM12
\r
214 .equ PWM2 =6 ; OBSOLETE! Use WGM20
\r
218 .equ CTC2 =3 ; OBSOLETE! Use WGM21
\r
373 .equ OR =3 ; old name kept for compatibilty
\r
375 .equ PE =2 ; old name kept for compatibilty
\r
386 .equ CHR9 =2 ; old name kept for compatibilty
\r
455 .equ I2C_TST =1 ;Present in core test mode only. Write Only.
\r
465 .equ TWI_TST =1 ;Present in core test mode only. Write Only.
\r
507 .equ SMALLBOOTSTART =0b00111110000000 ;($0F80) smallest boot block is 128W
\r
508 .equ SECONDBOOTSTART =0b00111100000000 ;($0F00) 2'nd boot block size is 256W
\r
509 .equ THIRDBOOTSTART =0b00111000000000 ;($0E00) third boot block size is 512W
\r
510 .equ LARGEBOOTSTART =0b00110000000000 ;($0C00) largest boot block is 1KW
\r
511 .equ BOOTSTART =THIRDBOOTSTART ;OBSOLETE!!! kept for compatibility
\r
512 .equ PAGESIZE =32 ;number of WORDS in a page
\r
513 .equ FLASHEND =$fff
\r
515 .equ INT0addr=$001 ;External Interrupt0 Vector Address
\r
516 .equ INT1addr=$002 ;External Interrupt1 Vector Address
\r
517 .equ OC2addr =$003 ;Output Compare2 Interrupt Vector Address
\r
518 .equ OVF2addr=$004 ;Overflow2 Interrupt Vector Address
\r
519 .equ ICP1addr=$005 ;Input Capture1 Interrupt Vector Address
\r
520 .equ OC1Aaddr=$006 ;Output Compare1A Interrupt Vector Address
\r
521 .equ OC1Baddr=$007 ;Output Compare1B Interrupt Vector Address
\r
522 .equ OVF1addr=$008 ;Overflow1 Interrupt Vector Address
\r
523 .equ OVF0addr=$009 ;Overflow0 Interrupt Vector Address
\r
524 .equ SPIaddr =$00a ;SPI Interrupt Vector Address
\r
525 .equ URXCaddr=$00b ;UART Receive Complete Interrupt Vector Address
\r
526 .equ UDREaddr=$00c ;UART Data Register Empty Interrupt Vector Address
\r
527 .equ UTXCaddr=$00d ;UART Transmit Complete Interrupt Vector Address
\r
528 .equ ADCCaddr=$00e ;ADC Interrupt Vector Address
\r
529 .equ ERDYaddr=$00f ;EEPROM Interrupt Vector Address
\r
530 .equ ACIaddr =$010 ;Analog Comparator Interrupt Vector Address
\r
531 .equ TWIaddr =$011 ;Irq. vector address for Two-Wire Interface
\r
532 .equ I2Caddr =$011 ; Irq. vector address for Inter Intergrated Circuit interface
\r
533 .equ INT2addr=$012 ;External Interrupt2 Vector Address
\r
534 .equ OC0addr =$013 ;Output Compare0 Interrupt Vector Address
\r
535 .equ SPMRaddr=$014 ;Store Program Memory Ready Interrupt Vector Address
\r