📄 m162def.inc
字号:
;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ********************
;***** Created: 2007-12-13 07:27 ******* Source: ATmega162.xml ***********
;*************************************************************************
;* 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
;*
;* Number : AVR000
;* File Name : "m162def.inc"
;* Title : Register/Bit Definitions for the ATmega162
;* Date : 2007-12-13
;* Version : 2.24
;* Support E-mail : avr@atmel.com
;* Target MCU : ATmega162
;*
;* DESCRIPTION
;* When including this file in the assembly program file, all I/O register
;* names and I/O register bit names appearing in the data book can be used.
;* In addition, the six registers forming the three data pointers X, Y and
;* Z have been assigned names XL - ZH. Highest RAM address for Internal
;* SRAM is also defined
;*
;* The Register names are represented by their hexadecimal address.
;*
;* The Register Bit names are represented by their bit number (0-7).
;*
;* Please observe the difference in using the bit names with instructions
;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc"
;* (skip if bit in register set/cleared). The following example illustrates
;* this:
;*
;* in r16,PORTB ;read PORTB latch
;* sbr r16,(1<<PB6)+(1<<PB5) ;set PB6 and PB5 (use masks, not bit#)
;* out PORTB,r16 ;output to PORTB
;*
;* in r16,TIFR ;read the Timer Interrupt Flag Register
;* sbrc r16,TOV0 ;test the overflow flag (use bit#)
;* rjmp TOV0_is_set ;jump if set
;* ... ;otherwise do something else
;*************************************************************************
#ifndef _M162DEF_INC_
#define _M162DEF_INC_
#pragma partinc 0
; ***** SPECIFY DEVICE ***************************************************
.device ATmega162
#pragma AVRPART ADMIN PART_NAME ATmega162
.equ SIGNATURE_000 = 0x1e
.equ SIGNATURE_001 = 0x94
.equ SIGNATURE_002 = 0x04
#pragma AVRPART CORE CORE_VERSION V2E
; ***** I/O REGISTER DEFINITIONS *****************************************
; NOTE:
; Definitions marked "MEMORY MAPPED"are extended I/O ports
; and cannot be used with IN/OUT instructions
.equ TCCR3A = 0x8b ; MEMORY MAPPED
.equ TCCR3B = 0x8a ; MEMORY MAPPED
.equ TCNT3L = 0x88 ; MEMORY MAPPED
.equ TCNT3H = 0x89 ; MEMORY MAPPED
.equ OCR3AL = 0x86 ; MEMORY MAPPED
.equ OCR3AH = 0x87 ; MEMORY MAPPED
.equ OCR3BL = 0x84 ; MEMORY MAPPED
.equ OCR3BH = 0x85 ; MEMORY MAPPED
.equ ICR3L = 0x80 ; MEMORY MAPPED
.equ ICR3H = 0x81 ; MEMORY MAPPED
.equ ETIMSK = 0x7d ; MEMORY MAPPED
.equ ETIFR = 0x7c ; MEMORY MAPPED
.equ PCMSK1 = 0x6c ; MEMORY MAPPED
.equ PCMSK0 = 0x6b ; MEMORY MAPPED
.equ CLKPR = 0x61 ; MEMORY MAPPED
.equ SREG = 0x3f
.equ SPL = 0x3d
.equ SPH = 0x3e
.equ UBRR1H = 0x3c
.equ UCSR1C = 0x3c
.equ GICR = 0x3b
.equ GIFR = 0x3a
.equ TIMSK = 0x39
.equ TIFR = 0x38
.equ SPMCR = 0x37
.equ EMCUCR = 0x36
.equ MCUCR = 0x35
.equ MCUCSR = 0x34
.equ TCCR0 = 0x33
.equ TCNT0 = 0x32
.equ OCR0 = 0x31
.equ SFIOR = 0x30
.equ TCCR1A = 0x2f
.equ TCCR1B = 0x2e
.equ TCNT1L = 0x2c
.equ TCNT1H = 0x2d
.equ OCR1AL = 0x2a
.equ OCR1AH = 0x2b
.equ OCR1BL = 0x28
.equ OCR1BH = 0x29
.equ TCCR2 = 0x27
.equ ASSR = 0x26
.equ ICR1L = 0x24
.equ ICR1H = 0x25
.equ TCNT2 = 0x23
.equ OCR2 = 0x22
.equ WDTCR = 0x21
.equ UBRR0H = 0x20
.equ UCSR0C = 0x20
.equ EEARL = 0x1e
.equ EEARH = 0x1f
.equ EEDR = 0x1d
.equ EECR = 0x1c
.equ PORTA = 0x1b
.equ DDRA = 0x1a
.equ PINA = 0x19
.equ PORTB = 0x18
.equ DDRB = 0x17
.equ PINB = 0x16
.equ PORTC = 0x15
.equ DDRC = 0x14
.equ PINC = 0x13
.equ PORTD = 0x12
.equ DDRD = 0x11
.equ PIND = 0x10
.equ SPDR = 0x0f
.equ SPSR = 0x0e
.equ SPCR = 0x0d
.equ UDR0 = 0x0c
.equ UCSR0A = 0x0b
.equ UCSR0B = 0x0a
.equ UBRR0L = 0x09
.equ ACSR = 0x08
.equ PORTE = 0x07
.equ DDRE = 0x06
.equ PINE = 0x05
.equ OSCCAL = 0x04
.equ OCDR = 0x04
.equ UDR1 = 0x03
.equ UCSR1A = 0x02
.equ UCSR1B = 0x01
.equ UBRR1L = 0x00
; ***** BIT DEFINITIONS **************************************************
; ***** TIMER_COUNTER_1 **************
; TIMSK - Timer/Counter Interrupt Mask Register
.equ TICIE1 = 3 ; Timer/Counter1 Input Capture Interrupt Enable
.equ OCIE1B = 5 ; Timer/Counter1 Output CompareB Match Interrupt Enable
.equ OCIE1A = 6 ; Timer/Counter1 Output CompareA Match Interrupt Enable
.equ TOIE1 = 7 ; Timer/Counter1 Overflow Interrupt Enable
; TIFR - Timer/Counter Interrupt Flag register
.equ ICF1 = 3 ; Input Capture Flag 1
.equ OCF1B = 5 ; Output Compare Flag 1B
.equ OCF1A = 6 ; Output Compare Flag 1A
.equ TOV1 = 7 ; Timer/Counter1 Overflow Flag
; TCCR1A - Timer/Counter1 Control Register A
.equ WGM10 = 0 ; Pulse Width Modulator Select Bit 0
.equ PWM10 = WGM10 ; For compatibility
.equ WGM11 = 1 ; Pulse Width Modulator Select Bit 1
.equ PWM11 = WGM11 ; For compatibility
.equ FOC1B = 2 ; Force Output Compare for Channel B
.equ FOC1A = 3 ; Force Output Compare for Channel A
.equ COM1B0 = 4 ; Compare Output Mode 1B, bit 0
.equ COM1B1 = 5 ; Compare Output Mode 1B, bit 1
.equ COM1A0 = 6 ; Compare Ouput Mode 1A, bit 0
.equ COM1A1 = 7 ; Compare Output Mode 1A, bit 1
; TCCR1B - Timer/Counter1 Control Register B
.equ CS10 = 0 ; Clock Select1 bit 0
.equ CS11 = 1 ; Clock Select1 bit 1
.equ CS12 = 2 ; Clock Select1 bit 2
.equ WGM12 = 3 ; Pulse Width Modulator Select Bit 2
.equ CTC10 = WGM12 ; For compatibility
.equ WGM13 = 4 ; Pulse Width Modulator Select Bit 3
.equ CTC11 = WGM13 ; For compatibility
.equ ICES1 = 6 ; Input Capture 1 Edge Select
.equ ICNC1 = 7 ; Input Capture 1 Noise Canceler
; ***** TIMER_COUNTER_2 **************
; TCCR2 - Timer/Counter Control Register
.equ CS20 = 0 ; Clock Select
.equ CS21 = 1 ; Clock Select
.equ CS22 = 2 ; Clock Select
.equ WGM21 = 3 ; Pulse Width Modulator Select Bit 1
.equ CTC2 = WGM21 ; For compatibility
.equ COM20 = 4 ; Compare Match Output Mode
.equ COM21 = 5 ; Compare Match Output Mode
.equ WGM20 = 6 ; Pulse Width Modulator Select Bit 0
.equ PWM2 = WGM20 ; For compatibility
.equ FOC2 = 7 ; Forde Output Compare
; TCNT2 - Timer/Counter Register
.equ TCNT2_0 = 0 ; Timer/Counter Register Bit 0
.equ TCNT2_1 = 1 ; Timer/Counter Register Bit 1
.equ TCNT2_2 = 2 ; Timer/Counter Register Bit 2
.equ TCNT2_3 = 3 ; Timer/Counter Register Bit 3
.equ TCNT2_4 = 4 ; Timer/Counter Register Bit 4
.equ TCNT2_5 = 5 ; Timer/Counter Register Bit 5
.equ TCNT2_6 = 6 ; Timer/Counter Register Bit 6
.equ TCNT2_7 = 7 ; Timer/Counter Register Bit 7
; OCR2 - Output Compare Register
.equ OCR2_0 = 0 ; Output Compare Register Bit 0
.equ OCR2_1 = 1 ; Output Compare Register Bit 1
.equ OCR2_2 = 2 ; Output Compare Register Bit 2
.equ OCR2_3 = 3 ; Output Compare Register Bit 3
.equ OCR2_4 = 4 ; Output Compare Register Bit 4
.equ OCR2_5 = 5 ; Output Compare Register Bit 5
.equ OCR2_6 = 6 ; Output Compare Register Bit 6
.equ OCR2_7 = 7 ; Output Compare Register Bit 7
; TIMSK - Timer/Counter Interrupt Mask Register
.equ TOIE2 = 2 ; Timer/Counter2 Overflow Interrupt Enable
.equ OCIE2 = 4 ; Timer/Counter2 Output Compare Match Interrupt Enable
; TIFR - Timer/Counter Interrupt Flag Register
.equ TOV2 = 2 ; Timer/Counter2 Overflow Flag
.equ OCF2 = 4 ; Output Compare Flag 2
; ASSR - Asynchronous Status Register
.equ TCR2UB = 0 ; Timer/Counter Control Register2 Update Busy
.equ OCR2UB = 1 ; Output Compare Register2 Update Busy
.equ TCN2UB = 2 ; Timer/Counter2 Update Busy
.equ AS2 = 3 ; Asynchronous Timer 2
; ***** TIMER_COUNTER_3 **************
; ETIMSK - Extended Timer/Counter Interrupt Mask Register
.equ TOIE3 = 2 ; Timer/Counter3 Overflow Interrupt Enable
.equ OCIE3B = 3 ; Timer/Counter3 Output CompareB Match Interrupt Enable
.equ OCIE3A = 4 ; Timer/Counter3 Output CompareA Match Interrupt Enable
.equ TICIE3 = 5 ; Timer/Counter3 Input Capture Interrupt Enable
; ETIFR - Extended Timer/Counter Interrupt Flag register
.equ TOV3 = 2 ; Timer/Counter3 Overflow Flag
.equ OCF3B = 3 ; Output Compare Flag 3B
.equ OCF3A = 4 ; Output Compare Flag 3A
.equ ICF3 = 5 ; Input Capture Flag 3
; TCCR3A - Timer/Counter3 Control Register A
.equ WGM30 = 0 ; Pulse Width Modulator Select Bit 0
.equ WGM31 = 1 ; Pulse Width Modulator Select Bit 1
.equ FOC3B = 2 ; Force Output Compare for Channel B
.equ FOC3A = 3 ; Force Output Compare for Channel A
.equ COM3B0 = 4 ; Compare Output Mode 3B, bit 0
.equ COM3B1 = 5 ; Compare Output Mode 3B, bit 1
.equ COM3A0 = 6 ; Compare Ouput Mode 3A, bit 0
.equ COM3A1 = 7 ; Compare Output Mode 3A, bit 1
; TCCR3B - Timer/Counter3 Control Register B
.equ CS30 = 0 ; Clock Select3 bit 0
.equ CS31 = 1 ; Clock Select3 bit 1
.equ CS32 = 2 ; Clock Select3 bit 2
.equ WGM32 = 3 ; Pulse Width Modulator Select Bit 2
.equ WGM33 = 4 ; Pulse Width Modulator Select Bit 3
.equ ICES3 = 6 ; Input Capture 3 Edge Select
.equ ICNC3 = 7 ; Input Capture 3 Noise Canceler
; ***** ANALOG_COMPARATOR ************
; ACSR - Analog Comparator Control And Status Register
.equ ACIS0 = 0 ; Analog Comparator Interrupt Mode Select bit 0
.equ ACIS1 = 1 ; Analog Comparator Interrupt Mode Select bit 1
.equ ACIC = 2 ; Analog Comparator Input Capture Enable
.equ ACIE = 3 ; Analog Comparator Interrupt Enable
.equ ACI = 4 ; Analog Comparator Interrupt Flag
.equ ACO = 5 ; Analog Compare Output
.equ ACBG = 6 ; Analog Comparator Bandgap Select
.equ AINBG = ACBG ; For compatibility
.equ ACD = 7 ; Analog Comparator Disable
; ***** USART0 ***********************
; UDR0 - USART I/O Data Register
.equ UDR = UDR0 ; For compatibility
.equ UDR0_0 = 0 ; USART I/O Data Register bit 0
.equ UDR0_1 = 1 ; USART I/O Data Register bit 1
.equ UDR0_2 = 2 ; USART I/O Data Register bit 2
.equ UDR0_3 = 3 ; USART I/O Data Register bit 3
.equ UDR0_4 = 4 ; USART I/O Data Register bit 4
.equ UDR0_5 = 5 ; USART I/O Data Register bit 5
.equ UDR0_6 = 6 ; USART I/O Data Register bit 6
.equ UDR0_7 = 7 ; USART I/O Data Register bit 7
; UCSR0A - USART Control and Status Register A
.equ USR = UCSR0A ; For compatibility
.equ MPCM0 = 0 ; Multi-processor Communication Mode
.equ U2X0 = 1 ; Double the USART transmission speed
.equ U2X = U2X0 ; For compatibility
.equ UPE0 = 2 ; Parity Error
.equ DOR0 = 3 ; Data overRun
.equ DOR = DOR0 ; For compatibility
.equ FE0 = 4 ; Framing Error
.equ FE = FE0 ; For compatibility
.equ UDRE0 = 5 ; USART Data Register Empty
.equ UDRE = UDRE0 ; For compatibility
.equ TXC0 = 6 ; USART Transmitt Complete
.equ TXC = TXC0 ; For compatibility
.equ RXC0 = 7 ; USART Receive Complete
.equ RXC = RXC0 ; For compatibility
; UCSR0B - USART Control and Status Register B
.equ UCR = UCSR0B ; For compatibility
.equ TXB80 = 0 ; Transmit Data Bit 8
.equ TXB8 = TXB80 ; For compatibility
.equ RXB80 = 1 ; Receive Data Bit 8
.equ RXB8 = RXB80 ; For compatibility
.equ UCSZ02 = 2 ; Character Size
.equ UCSZ2 = UCSZ02 ; For compatibility
.equ TXEN0 = 3 ; Transmitter Enable
.equ TXEN = TXEN0 ; For compatibility
.equ RXEN0 = 4 ; Receiver Enable
.equ RXEN = RXEN0 ; For compatibility
.equ UDRIE0 = 5 ; USART Data register Empty Interrupt Enable
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -