📄 snsles2431.lst
字号:
MPASM 5.15 SNSLES2431.ASM 2-22-2008 14:34:38 PAGE 9
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
000048 00237 HIGH_OL_SPEEDH res 1
000049 00238 HIGH_OL_SPEEDL res 1
00239
00240
00241 ;----------------------------------------------------------------
000000 00242 org 0x00
000000 EF2C F000 00243 goto Start ;Reset Vector address
00244
000008 00245 org 0x0008
000008 EFB3 F000 00246 goto ISR_HIGH ;Higher priority ISR at 0x0008
00247
000018 00248 org 0x0018
000018 EFE9 F001 00249 goto ISR_LOW ;Lower priority ISR at 0x0018
00250
000030 00251 org 0x30
Warning[207]: Found label after column 1. (CONVERT)
000030 26F9 00252 CONVERT addwf PCL,1
00253
000032 0C85 00254 retlw 0x85
000034 0CED 00255 retlw 0xed ;800,1
00256
000036 0C9E 00257 retlw 0x9e
000038 0C57 00258 retlw 0x57 ;1000,2
00259
00003A 0CB4 00260 retlw 0xb4
00003C 0CE0 00261 retlw 0xe0 ;1300,3
00262
00003E 0CC2 00263 retlw 0xc2
000040 0CF6 00264 retlw 0xf6 ;1600,4
00265
000042 0CCC 00266 retlw 0xcc
000044 0C99 00267 retlw 0x99 ;1900,5
00268
000046 0CD3 00269 retlw 0xd3
000048 0C9B 00270 retlw 0x9b ;2200,6
00271
00004A 0CD8 00272 retlw 0xd8
00004C 0CEF 00273 retlw 0xef ;2500,7
00274
00004E 0CDD 00275 retlw 0xdd
000050 0C1E 00276 retlw 0x1e ;2800,8
00277
000052 0CE0 00278 retlw 0xe0
000054 0C7E 00279 retlw 0x7e ;3100,9
00280
00281
00282
00283
00284
00285
000056 0012 00286 return
00287
00288
MPASM 5.15 SNSLES2431.ASM 2-22-2008 14:34:38 PAGE 10
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00289
00290 ;****************************************************************
000058 00291 Start
00292 ;****************************************************************
000058 6A29 00293 clrf PDC_TEMPH
00005A 6A2A 00294 clrf PDC_TEMPL
00005C 6A01 00295 clrf SPEED_REFH
00005E 6A03 00296 clrf FLAGS
000060 6A04 00297 clrf FLAGS1
00298 ; call LED_Display
000062 EC3C F003 00299 call FIRST_ADC_INIT ;Initialize ADC
00300
000066 00301 WAIT_HERE
00302
000066 EC4E F003 00303 call LED_BLINK
00006A ECB6 F002 00304 call KEY_CHECK
00305
00006E A604 00306 btfss FLAGS1,KEY_PRESSED
000070 D7FA 00307 bra WAIT_HERE
00308
00309
000072 EC66 F002 00310 call INIT_PERPHERALS ; Initialize all required peripherals(ADC,PWM,IC
etc)
00311
00312
000076 9A82 00313 bcf LED1
000078 9882 00314 bcf LED2
00007A 9682 00315 bcf LED3
00316
00007C 0EA0 00317 movlw 0xA0
00007E 6E0B 00318 movwf COUNTER_SP1
00319
00320
000080 6A03 00321 clrf FLAGS
000082 6A04 00322 clrf FLAGS1
000084 6A05 00323 clrf FLT_FLAGS
000086 6A06 00324 clrf FLAGS_SRLS
000088 0EF0 00325 movlw 0xF0
00008A 6E39 00326 movwf COUNT_OPEN_LOOPH
00008C 6E38 00327 movwf COUNT_OPEN_LOOPL
00328
00008E 8CF2 00329 bsf INTCON,PEIE ;Port interrupts enable
000090 8EF2 00330 bsf INTCON,GIE ;Global interrupt enable
00331
000092 8A04 00332 bsf FLAGS1,FWD_REV
000094 6A3C 00333 clrf OVDCOND_TEMP
00334
000096 0E85 00335 movlw 0x85
000098 6E48 00336 movwf HIGH_OL_SPEEDH
00009A 0EED 00337 movlw 0xed
00009C 6E49 00338 movwf HIGH_OL_SPEEDL
00339
00009E 0E00 00340 movlw 0x00
MPASM 5.15 SNSLES2431.ASM 2-22-2008 14:34:38 PAGE 11
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0000A0 6E40 00341 movwf CX
0000A2 6E41 00342 movwf CX1
0000A4 6E42 00343 movwf CX2
0000A6 6E43 00344 movwf CX3
0000A8 6E44 00345 movwf CX4
0000AA 6E45 00346 movwf CX5
00347 ;*******************************************************************
00348 ;The control loops in this routine
0000AC 00349 MAIN_LOOP
00350
00351
0000AC A206 00352 btfss FLAGS_SRLS,SWITCH_SENSORLESS ;Is the control ready to switch to sensoless?
0000AE D007 00353 bra KEEP_SAME_PWM ;No; ramp up is in progress
0000B0 AC03 00354 btfss FLAGS,CALC_PWM ;
0000B2 D005 00355 bra KEEP_SAME_PWM
0000B4 EC0E F002 00356 call UPDATE_PWM ;Reload PWM duty cycles accordin
g to the speed requiredA57H
0000B8 9C03 00357 bcf FLAGS,CALC_PWM
0000BA EF56 F000 00358 goto MAIN_LOOP
00359
0000BE 00360 KEEP_SAME_PWM
0000BE ECB6 F002 00361 call KEY_CHECK ;Any key pressed?
0000C2 ECE0 F002 00362 call PROCESS_KEY_PRESSED ;Service Key routine
00363
0000C6 B005 00364 btfsc FLT_FLAGS,OCUR ;Over current condition?
0000C8 EC5A F002 00365 call FAULTA_PROCESS ;Stop motor and stand by
00366
0000CC B203 00367 btfsc FLAGS,FLAG_FAULT ;If the fault exists, toggle the LEDs
0000CE EC34 F003 00368 call TOGGLE_LEDS
00369
0000D2 A2C2 00370 btfss ADCON0,GO
0000D4 82C2 00371 bsf ADCON0,GO ;Set GO bit for ADC conversion start
0000D6 EF56 F000 00372 goto MAIN_LOOP
00373
00374
00375 ;------------------------------------------------------
00376 ;------------------------------------------------------
0000DA 00377 LED_Display
0000DA 9A94 00378 bcf TRISC,5
0000DC 8A82 00379 bsf LED1
0000DE EC03 F004 00380 call Delay_300ms
0000E2 EC03 F004 00381 call Delay_300ms
0000E6 EC03 F004 00382 call Delay_300ms
0000EA EC03 F004 00383 call Delay_300ms
0000EE EC03 F004 00384 call Delay_300ms
0000F2 EC03 F004 00385 call Delay_300ms
0000F6 EC03 F004 00386 call Delay_300ms
0000FA EC03 F004 00387 call Delay_300ms
0000FE 9A82 00388 bcf LED1
000100 EC03 F004 00389 call Delay_300ms
000104 EC03 F004 00390 call Delay_300ms
000108 EC03 F004 00391 call Delay_300ms
MPASM 5.15 SNSLES2431.ASM 2-22-2008 14:34:38 PAGE 12
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00010C EC03 F004 00392 call Delay_300ms
000110 EC03 F004 00393 call Delay_300ms
000114 EC03 F004 00394 call Delay_300ms
000118 EC03 F004 00395 call Delay_300ms
00011C EC03 F004 00396 call Delay_300ms
000120 8A82 00397 bsf LED1
000122 EC03 F004 00398 call Delay_300ms
000126 EC03 F004 00399 call Delay_300ms
00012A EC03 F004 00400 call Delay_300ms
00012E EC03 F004 00401 call Delay_300ms
000132 EC03 F004 00402 call Delay_300ms
000136 EC03 F004 00403 call Delay_300ms
00013A EC03 F004 00404 call Delay_300ms
00013E EC03 F004 00405 call Delay_300ms
000142 9A82 00406 bcf LED1
000144 EC03 F004 00407 call Delay_300ms
000148 EC03 F004 00408 call Delay_300ms
00014C EC03 F004 00409 call Delay_300ms
000150 EC03 F004 00410 call Delay_300ms
000154 EC03 F004 00411 call Delay_300ms
000158 EC03 F004 00412 call Delay_300ms
00015C EC03 F004 00413 call Delay_300ms
000160 EC03 F004 00414 call Delay_300ms
00415
000164 0012 00416 return
00417
00418 ;--------------------------------------------------------------
00419 ;Higher priority Interrupt Service routine
00420 ;In this routine, activities on Input capture pins are monitored.
00421 ;Back EMF signals are compared with a DC voltage in the hardware.
00422 ; Based on the BEMF states, the switchig sequence is changed.
00423 ;--------------------------------------------------------------
00424
000166 00425 ISR_HIGH
000166 B006 00426 btfsc FLAGS_SRLS,IC_ALOWED ;Check if the control switched to sensorless
000168 D002 00427 bra BYPASS_IC_INT ;No
00016A B2A4 00428 btfsc PIR3,IC1IF ;Yes, monitor Input capure pin1
00016C D012 00429 bra HALL_A_HIGH
00430
00016E 00431 BYPASS_IC_INT
00016E B09E 00432 btfsc PIR1,TMR1IF ;Timer1 overflow interrupt
000170 D055 00433 bra TIMER1_INT
00434
000172 BC9E 00435 btfsc PIR1,ADIF ;ADC interrupt
000174 D003 00436 bra AD_CONV_COMPLETE
00437
000176 B8A4 00438 btfsc PIR3,PTIF ;PWM interrupt
000178 D12D 00439 bra PWM_INTERRUPT
00440
00017A 0011 00441 RETFIE FAST
00442
00443
00444 ;******************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -