📄 stepper.lst
字号:
A51 MACRO ASSEMBLER STEPPER 22/07/99 14:17:14 PAGE 1
DOS MACRO ASSEMBLER A51 V5.28m
OBJECT MODULE PLACED IN STEPPER.OBJ
ASSEMBLER INVOKED BY: C:\ANCHOR\KEIL2K\BIN\A51.EXE STEPPER.A51 RB(0) DB EP
LOC OBJ LINE SOURCE
1 NAME StepperMotorController
2
3 $INCLUDE(../Declare.A51)
=1 4 ; This module declares the variables and constants used in the examples
=1 5 ; It is common to all of the examples
=1 6 ;
=1 7 ; Declare Special Function Registers used
00A8 =1 8 EI DATA 0A8H
00E8 =1 9 EIE DATA 0E8H ; EZ-USB specific
0091 =1 10 EXIF DATA 091H ; EZ-USB specific
00D8 =1 11 EICON DATA 0D8H ; EZ-USB specific
0092 =1 12 PageReg DATA 092H ; EZ-USB specific, used with MOVX @Ri
0086 =1 13 DPS DATA 086H ; EZ-USB specific, used with dual data pointers
=1 14 ;
=1 15 ; "External" memory locations used, EZ-USB specific
=1 16 ; Note that most of these variables are in Page 7FH
7FE8 =1 17 SETUPDAT EQU 07FE8H
7FD4 =1 18 SUDPTR EQU 07FD4H
7FB4 =1 19 EP0Control EQU 07FB4H
7F00 =1 20 EP0InBuffer EQU 07F00H
7EC0 =1 21 EP0OutBuffer EQU 07EC0H ; Not in Page 7FH
7E80 =1 22 EP1InBuffer EQU 07E80H ; Not in Page 7FH
7FB5 =1 23 IN0ByteCount EQU 07FB5H
7FC5 =1 24 Out0ByteCount EQU 07FC5H
7FB7 =1 25 IN1ByteCount EQU 07FB7H
7FAC =1 26 IN07IEN EQU 07FACH
7FA9 =1 27 IN07IRQ EQU 07FA9H
7FAD =1 28 OUT07IEN EQU 07FADH
7FAA =1 29 OUT07IRQ EQU 07FAAH
7FAE =1 30 USBIEN EQU 07FAEH
7FAB =1 31 USBIRQ EQU 07FABH
7FD6 =1 32 USBControl EQU 07FD6H
7FA6 =1 33 I2CData EQU 07FA6H
7FA5 =1 34 I2CControl EQU 07FA5H
7F99 =1 35 PortA_PINS EQU 07F99H
7F9A =1 36 PortB_PINS EQU 07F9AH
7F93 =1 37 PortA_Config EQU 07F93H
7F94 =1 38 PortB_Config EQU 07F94H
7F96 =1 39 PortA_OUT EQU 07F96H
7F9C =1 40 PortA_OE EQU 07F9CH
7F9D =1 41 PortB_OE EQU 07F9DH
=1 42 ;
=1 43 ; Byte Variables
=1 44
---- =1 45 DSEG AT 20H
0020 =1 46 FLAGS: DS 1 ; This register is bit-addressable
=1 47 ; Bit Variables
0000 =1 48 Configured EQU FLAGS.0 ; Is this device configured
0001 =1 49 STALL EQU FLAGS.1 ; Need to STALL endpoint 0
0002 =1 50 SendData EQU FLAGS.2 ; Need to send data to PC Host
0003 =1 51 IsDescriptor EQU FLAGS.3 ; Enable a shortcut reply
=1 52 ;
0021 =1 53 MonitorSpace: DS 1FH ; Used by Dscope
0040 =1 54 Temp: DS 1 ; A temporary working register
0041 =1 55 Idle_Time: DS 1 ; The time the PC host wants us to wait
0042 =1 56 Expired_Time: DS 1 ; A downcounter for timed Reports
0043 =1 57 ReplyBuffer: DS 3 ; First byte is Count
=1 58 ;
A51 MACRO ASSEMBLER STEPPER 22/07/99 14:17:14 PAGE 2
=1 59 ; Declare the specific variables used by each of the examples
0046 =1 60 Overlay EQU $
0046 =1 61 Old_Buttons: DS 1 ; Used by BAL: stores current button position
0047 =1 62 LEDstrobe: DS 1 ; Used by BAL: strobe one LED on at a time
0048 =1 63 LEDvalue: DS 1 ; Used by BAL: stores current LED value
0049 =1 64 Msec_Counter: DS 1 ; Used by BAL: counts up to 4 msec
=1 65
0046 =1 66 ORG Overlay ; Overlay the variables (only one set in use at any one tim
e)
0046 =1 67 I2CDataByte: DS 1 ; Used by I2C: keep a local copy of data read from I2C bus
=1 68
0046 =1 69 ORG Overlay
0046 =1 70 LightValues: DS 6 ; Used by LP: local buffer for light brightness
=1 71
0046 =1 72 ORG Overlay
0046 =1 73 MotorControl: DS 3 ; Used by Stepper: direction, Low(count) and High(count)
0049 =1 74 CurrentPosition:DS 1 ; Used by Stepper: motor has 16 stable positions
=1 75
0046 =1 76 ORG Overlay
0046 =1 77 LimitValues: DS 12 ; Used by Temps: local buffer for limits
=1 78
0046 =1 79 ORG Overlay
0046 =1 80 LEDBuffer: DS 42 ; Used by RB: local buffer for reader board
=1 81 ;
82 $INCLUDE(../Vectors.A51)
=1 83 ; This module is common to all of the examples.
=1 84 ; It contains all of the interrupt vector declarations and
=1 85 ; the first level interrupt servicing (register save, call subroutine,
=1 86 ; clear interrupt source, restore registers, return)
=1 87 ; Suspend and Resume are handled totally in this module
=1 88 ;
=1 89 ; A Reset sends us to Program space location 0
---- =1 90 CSEG AT 0 ; Code space
=1 91 USING 0 ; Reset forces Register Bank 0
0000 020357 =1 92 LJMP Reset
=1 93 ;
=1 94 ; The interrupt vector table is also located here
=1 95 ; EZ-USB has two levels of USB interrupts:
=1 96 ; 1-the main level is described in this table (at ORG 43H)
=1 97 ; 2-there are 21 sources of USB interrupts and these are described in USB_ISR
=1 98 ; This means that two levels of acknowledgement and clearing will be required
=1 99 ; LJMP INT0_ISR ; Features not used are commented out
=1 100 ; ORG 0BH
=1 101 ; LJMP Timer0_ISR
=1 102 ; ORG 13H
=1 103 ; LJMP INT1_ISR
=1 104 ; ORG 1BH
=1 105 ; LJMP Timer1_ISR
=1 106 ; ORG 23H
=1 107 ; LJMP UART0_ISR
=1 108 ; ORG 2BH
=1 109 ; LJMP Timer2_ISR
=1 110 ; ORG 33H
=1 111 ; LJMP WakeUp_ISR
=1 112 ; ORG 3BH
=1 113 ; LJMP UART1_ISR
0043 =1 114 ORG 43H
0043 020100 =1 115 LJMP USB_ISR ; Auto Vector will replace byte 45H
=1 116 ; ORG 4BH
=1 117 ; LJMP I2C_ISR
=1 118 ; ORG 53H
=1 119 ; LJMP INT4_ISR
=1 120 ; ORG 5BH
=1 121 ; LJMP INT5_ISR
=1 122 ; ORG 63H
=1 123 ; LJMP INT6_ISR
A51 MACRO ASSEMBLER STEPPER 22/07/99 14:17:14 PAGE 3
=1 124
00E0 =1 125 ORG 0E0H ; Keep out of the way of dScope monitor
=1 126 ; If you are not using dScope then this memory hole
=1 127 ; may be used for useful routines.
0100 =1 128 ORG 100H
0100 02013C =1 129 USB_ISR:LJMP SUDAV_ISR
0103 00 =1 130 DB 0 ; Pad entries to 4 bytes
0104 020158 =1 131 LJMP SOF_ISR
0107 00 =1 132 DB 0
0108 020118 =1 133 LJMP SUTOK_ISR
010B 00 =1 134 DB 0
010C 020129 =1 135 LJMP Suspend_ISR
010F 00 =1 136 DB 0
0110 020120 =1 137 LJMP USBReset_ISR
0113 00 =1 138 DB 0
0114 020118 =1 139 LJMP Reserved
0117 00 =1 140 DB 0
=1 141 ; LJMP EP0In_ISR ; Endpoint Interrupts are not used in these examples
=1 142 ; DB 0 ; Comment out features not used
=1 143 ; LJMP EP0Out_ISR
=1 144 ; DB 0
=1 145 ; LJMP EP1In_ISR
=1 146 ; DB 0
=1 147 ; LJMP EP1Out_ISR
=1 148 ; DB 0
=1 149 ; LJMP EP2In_ISR
=1 150 ; DB 0
=1 151 ; LJMP EP2Out_ISR
=1 152 ; DB 0
=1 153 ; LJMP EP3In_ISR
=1 154 ; DB 0
=1 155 ; LJMP EP3Out_ISR
=1 156 ; DB 0
=1 157 ; LJMP EP4In_ISR
=1 158 ; DB 0
=1 159 ; LJMP EP4Out_ISR
=1 160 ; DB 0
=1 161 ; LJMP EP5In_ISR
=1 162 ; DB 0
=1 163 ; LJMP EP5Out_ISR
=1 164 ; DB 0
=1 165 ; LJMP EP6In_ISR
=1 166 ; DB 0
=1 167 ; LJMP EP6Out_ISR
=1 168 ; DB 0
=1 169 ; LJMP EP7In_ISR
=1 170 ; DB 0
=1 171 ; LJMP EP7Out_ISR
=1 172 ; End of Interrupt Vector tables
=1 173
=1 174 ; When a feature is used insert the required interrupt processing here
=1 175 ; The example use only used Endpoints 0 and 1 and also SOF for timing
0118 =1 176 Reserved:
0118 =1 177 INT0_ISR:
0118 =1 178 Timer0_ISR:
0118 =1 179 INT1_ISR:
0118 =1 180 Timer1_ISR:
0118 =1 181 UART0_ISR:
0118 =1 182 Timer2_ISR:
0118 =1 183 UART1_ISR:
0118 =1 184 I2C_ISR:
0118 =1 185 INT4_ISR:
0118 =1 186 INT5_ISR:
0118 =1 187 INT6_ISR:
0118 =1 188 SUTOK_ISR:
0118 =1 189 EP0In_ISR:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -