📄 hidkb_2313.lst
字号:
AVRASM ver. 2.1.9 C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm Tue Oct 10 15:31:28 2006
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(52): Including file 'C:\AVR Projects\MAX3420E_EVKIT2_Code\tn2313def_lth.inc'
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(53): Including file 'C:\AVR Projects\MAX3420E_EVKIT2_Code\USB_constants.inc'
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(54): Including file 'C:\AVR Projects\MAX3420E_EVKIT2_Code\HID_KB_2313_Descriptors_and_Data.inc'
C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_EVKIT2_DemoCode.asm(55): Including file 'C:\AVR Projects\MAX3420E_EVKIT2_Code\MAX3420E_Macros.inc'
// Copyright (C) 2006 Maxim Integrated Products, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL MAXIM INTEGRATED PRODUCTS INC. BE LIABLE FOR ANY CLAIM, DAMAGES
// OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//---------------------------------------------------------------------------
;
; Atmel AtTiny2313 Firmware for Maxim 3420E EVKIT-2
;
; MAX3420E HID Keyboard emulator.
;
; At power on, if any of the pushbuttons 0-3 (SW1-SW4) is pressed, enter a test loop
; that reads the pushbuttons and copies their states to the four LEDS 0-3 (D1-D4). The
; LEDS are active-high, and the pushbuttons are active-low, so pressing a pushbutton
; should turn the corresponding LED off. When finished with this test, press buttons
; 0 and 3 simultaneously to proceed to the USB sample application.
;
; The sample application (which automatically runs if no buttons are pressed at power-on)
; implements a HID keyboard emulator. Pressing the SEND button (button 3) starts and stops
; typing an abbreviated version of the MAX3420E data sheet into any Windows window that
; can accept text and which currently has the focus. CAUTION--This includes any open
; window, such as email, a Word document, program editor, etc. Be sure you have a simple
; app like Notepad or Wordpad open and active before pushing the SEND button.
;
; Buttons:
; 0 (not used)
; 1 (not used)
; 2 (not used)
; 3 Start/Stop sending characters as keyboard
;
; Lights:
; 0 Blinks to show program is running
; 1 MAX3420E detected a USB bus reset
; 2 SUSPEND (PC stopped USB activity)
; 3 SEND light. Toggles when pushbutton 3 pressed.
;
.include "tn2313def_lth.inc"
;* 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 :"tn2313def.inc"
;* Title :Register/Bit Definitions for the ATtiny2313
;* Date :03.06.17
;* Version :1.00
;* Support E-mail :avr@atmel.com
;* Target MCU :ATtiny2313
;*
;* 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 two registers forming the data pointer Z have been
;* assigned names ZL - ZH.
;*
;* 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
;*
;***************************************************************************
;***** Specify Device
.device ATtiny2313
;*****************************************************************************
; I/O Register Definitions
;*****************************************************************************
.equ SREG = 0x3F
.equ SPL = 0x3D
.equ OCR0B = 0x3C
.equ GIMSK = 0x3B
.equ EIFR = 0x3A
.equ GIFR = 0x3A ; for compatibility purpose
.equ TIMSK = 0x39
.equ TIFR = 0x38
.equ SPMCSR = 0x37
.equ OCR0A = 0x36
.equ MCUCR = 0x35
.equ MCUSR = 0x34
.equ TCCR0B = 0x33
.equ TCCR0 = 0x33 ; for compatibility purpose
.equ TCNT0 = 0x32
.equ OSCCAL = 0x31
.equ TCCR0A = 0x30
.equ TCCR1A = 0x2F
.equ TCCR1B = 0x2E
.equ TCNT1H = 0x2D
.equ TCNT1L = 0x2C
.equ OCR1AH = 0x2B
.equ OCR1AL = 0x2A
.equ OCR1BH = 0x29
.equ OCR1BL = 0x28
.equ CLKPR = 0x26
.equ ICR1H = 0x25
.equ ICR1L = 0x24
.equ SFIOR = 0x23
.equ TCCR1C = 0x22
.equ WDTCR = 0x21
.equ PCMSK = 0x20
.equ EEAR = 0x1E ; for compatibility purpose
.equ EEARL = 0x1E
.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 GPIOR2 = 0x15
.equ GPIOR1 = 0x14
.equ GPIOR0 = 0x13
.equ PORTD = 0x12
.equ DDRD = 0x11
.equ PIND = 0x10
.equ USIDR = 0x0F
.equ USISR = 0x0E
.equ USICR = 0x0D
.equ UDR = 0x0C
.equ UCSRA = 0x0B
.equ USR = 0x0B ; for compatibility purpose
.equ UCSRB = 0x0A
.equ UCR = 0x0A ; for compatibility purpose
.equ UBRRL = 0x09
.equ UBRR = 0x09 ; for compatibility purpose
.equ ACSR = 0x08
.equ UCSRC = 0x03
.equ UBRRH = 0x02
.equ DIDR = 0x01
;*****************************************************************************
; Bit Definitions
;*****************************************************************************
;***** SREG *******
;.equ I = 7
;.equ T = 6
;.equ H = 5
;.equ S = 4
;.equ V = 3
;.equ N = 2
;.equ Z = 1
;.equ C = 0
;***** SPL ********
.equ SP7 = 7
.equ SP6 = 6
.equ SP5 = 5
.equ SP4 = 4
.equ SP3 = 3
.equ SP2 = 2
.equ SP1 = 1
.equ SP0 = 0
;***** GIMSK ******
.equ INT1 = 7
.equ INT0 = 6
.equ PCIE = 5
;***** EIFR *******
.equ INTF1 = 7
.equ INTF0 = 6
.equ PCIF = 5
;***** TIMSK ******
.equ TOIE1 = 7
.equ OCIE1A = 6
.equ OCIE1B = 5
.equ ICIE1 = 3
.equ OCIE0B = 2
.equ TOIE0 = 1
.equ OCIE0A = 0
.equ TICIE = 3 ; for compatibility purpose
;***** TIFR *******
.equ TOV1 = 7
.equ OCF1A = 6
.equ OCF1B = 5
.equ ICF1 = 3
.equ OCF0B = 2
.equ TOV0 = 1
.equ OCF0A = 0
;***** SPMCSR *****
.equ CTPB = 4
.equ RFLB = 3
.equ PGWRT = 2
.equ PGERS = 1
.equ SPMEN = 0
;***** MCUCR ******
.equ PUD = 7
.equ SM1 = 6
.equ SE = 5
.equ SM0 = 4
.equ ISC11 = 3
.equ ISC10 = 2
.equ ISC01 = 1
.equ ISC00 = 0
.equ SM = 4 ; for compatibility purpose
;***** MCUSR ******
.equ WDRF = 3
.equ BORF = 2
.equ EXTRF = 1
.equ PORF = 0
;***** TCCR0B *****
.equ FOC0A = 7
.equ FOC0B = 6
.equ WGM02 = 3
.equ CS02 = 2
.equ CS01 = 1
.equ CS00 = 0
;***** OSCCAL *****
.equ CAL6 = 6
.equ CAL5 = 5
.equ CAL4 = 4
.equ CAL3 = 3
.equ CAL2 = 2
.equ CAL1 = 1
.equ CAL0 = 0
;***** TCCR0A *****
.equ COM0A1 = 7
.equ COM0A0 = 6
.equ COM0B1 = 5
.equ COM0B0 = 4
.equ WGM01 = 1
.equ WGM00 = 0
;***** TCCR1A *****
.equ COM1A1 = 7
.equ COM1A0 = 6
.equ COM1B1 = 5
.equ COM1B0 = 4
.equ WGM11 = 1
.equ WGM10 = 0
.equ PWM11 = 1 ; for compatibility purpose
.equ PWM10 = 0 ; for compatibility purpose
;***** TCCR1B *****
.equ ICNC1 = 7
.equ ICES1 = 6
.equ WGM13 = 4
.equ WGM12 = 3
.equ CS12 = 2
.equ CS11 = 1
.equ CS10 = 0
.equ CTC1 = 3 ; for compatibility purpose
;***** CLKPR ******
.equ CLKPCE = 7
.equ CLKPS3 = 3
.equ CLKPS2 = 2
.equ CLKPS1 = 1
.equ CLKPS0 = 0
;***** SFIOR ******
.equ PSR10 = 0
;***** TCCR1C *****
.equ FOC1A = 7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -