完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
当我点击调试主项目按钮时,我会得到这样的错误:“在当前的PC 0x3FF中没有找到源代码行。打开程序内存视图查看指令代码解体“有人能指导我纠正吗?”谢谢
以上来自于百度翻译 以下为原文 When I click the Debug Main Project button I get this error: "No source code lines were found at current PC 0x3ff. Open program memory view to see instruction code disassembly" Can someone guide me in correcting this? Thanks |
|
相关推荐
19个回答
|
|
对不起,水晶球本周要维修。你用的是PIC设备?你在用什么语言编程?您使用的是什么版本的MPLABX?
以上来自于百度翻译 以下为原文 Sorry, crystal ball is in for repair this week. What PIC device are you using? What language are you programming in? What version MPLABX are you using? |
|
|
|
通常,这是由于程序停止在库函数中,源代码不适用于IDE。我猜想(QHB的上述响应)是您已经尝试调试在“发布”模式中构建的代码。苏珊
以上来自于百度翻译 以下为原文 Typically this is caused by the program stopping in a library function for which the source code is not available to the IDE. My guess (qhb's response above) is that you have tried to debug code that was built in the 'release' mode. Susan |
|
|
|
对。。。我也是……PIC12F509I在CysMyPLAB X IDE V4.05中编程
以上来自于百度翻译 以下为原文 Yes... mine too... It's PIC12F509 I'm programming in assembly MPLAB X IDE v4.05 |
|
|
|
如果是这样的话,我怎么解决这个问题呢?
以上来自于百度翻译 以下为原文 If this is the case, how can I solve the problem? |
|
|
|
如果你在汇编程序中编程,那么就没有“库”函数。PIC12F509在地址0x3FF开始执行,它包含一个特殊的时钟校准常数的MOVLW指令。你是在“绝对”还是“可重定位”模式下编程?MPLABX既可以处理,也可以默认为“可重新定位”。必须检查项目属性中的一个框,以将其设置为绝对模式。
以上来自于百度翻译 以下为原文 If you're programming in assembler, then there are no "library" functions. A PIC12F509 starts execution at address 0x3FF, which contains a special MOVLW instruction with the clock calibration constant. Are you programming in "absolute" or "relocatable" mode? MPLABX can handle both, but defaults to "relocatable". You have to check a box in the project properties to set it to absolute mode. |
|
|
|
如果我检查“内置绝对模式”,在MPASM(全局选项)下,我得到这个
以上来自于百度翻译 以下为原文 If I check "build in absolute mode", under mpasm (Global Options), I get this make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory '/Users/ale/MPLABXProjects/AcuLed_MAC.X' make -f nbproject/Makefile-default.mk dist/default/debug/AcuLed_MAC.X.debug.cof make[2]: Entering directory '/Users/ale/MPLABXProjects/AcuLed_MAC.X' mv: rename /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.O to build/default/debug/Code.o: No such file or directory "/Applications/microchip/mplabx/v4.05/mpasmx/mpasmx" -d__DEBUG -d__MPLAB_DEBUGGER_SIMULATOR=1 -q -p12f509 -u "/Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm" make[2]: *** [build/default/debug/Code.o] Error 1 Error[149] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 64 : Directive only allowed when generating an object file make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 104 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 204 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 210 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 212 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 284 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 288 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 294 : Using default destination of 1 (file). Message[305] /Users/ale/MPLABXProjects/AcuLed_MAC.X/Code.asm 325 : Using default destination of 1 (file). nbproject/Makefile-default.mk:98: recipe for target 'build/default/debug/Code.o' failed make[2]: Leaving directory '/Users/ale/MPLABXProjects/AcuLed_MAC.X' nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed make[1]: Leaving directory '/Users/ale/MPLABXProjects/AcuLed_MAC.X' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed BUILD FAILED (exit value 2, total time: 218ms) |
|
|
|
我想是时候让我们看看你的源代码了…
以上来自于百度翻译 以下为原文 I think it's about time to let us see your source code... |
|
|
|
干得好
以上来自于百度翻译 以下为原文 Here you go ;****************************************************************************** ;------------------------------------------------------------------------------ ; PINOUT ;------------------------------------------------------------------------------ ; 12F509 @ 8 pin ; ; |??/??| ; Vdd -|1 8|- Vss ; GP5 -|2 7|- GP0 ; GP4 -|3 6|- GP1 ; GP3/MCLR -|4 5|- GP2 ; |______| ; ; Vdd 1: ++ ; GP5/OSC1/CLKIN 2: Vibration ; GP4/OSC2 3: Frequency button ; GP3/!MCLR/VPP 4: Power/color button ; GP2/T0CKI 5: Blue light ; GP1/ICSPCLK 6: Green light ; GP0/ICSPDAT 7: Red light ; Vss 8: -- ; ;****************************************************************************** ; PORT DEFINITIONS ;****************************************************************************** ; ;GPIO map ;| 5 | 4 | 3 | 2 | 1 | 0 | ;|-----|-----|-----|-----|-----|-----| ;| VIB | FRQ | POW | GRE | BLU | RED | ; #define Frq_Btn GPIO,GP4 ; Frequency button #define Pow_Btn GPIO,GP3 ; Power and color button #define Red b'00000001' ; Red light bit #define Blue b'00000010' ; Green light bit #define Green b'00000100' ; Blue light bit #define F1hz d'20' ; Half cycle reps 25x20 = 500ms #define F5hz d'8' ; Half cycle reps 25x8 = 100ms #define F20hz d'1' ; Half cycle reps 25x1 = 25ms #define Frq_Lst sGPIO,GP4 ; Last status of frequency button #define Pow_Lst sGPIO,GP3 ; Last status of power button #define Cyc_Mod STAT,GP3 ; Cycle mode ; ;****************************************************************************** ; PROCESSOR DEFINITION ;****************************************************************************** ; LIST p=12F509 #include radix dec ; ;****************************************************************************** ; CONFIGURATION ;****************************************************************************** ; Internal oscillator, no WDT, no code protection, pin 4 set as GP3 ; __CONFIG _OSC_IntRC & _WDT_OFF & _CP_OFF & _MCLRE_OFF ; ;****************************************************************************** ; RAM MEMORY ;****************************************************************************** ; general purpose RAM ; UDATA Frq_Reps res 1 ; Number of repetitions for current frequency Frq_Tick res 1 ; Frequency cycle counter Pad_Delay_Cnt res 1 STAT res 1 ; Current led status Cyl_Cnt res 1 ; Counter for dubling frequency in cicle mode sGPIO res 1 ; Shadow Vib_Tick1 res 1 ; Vibration counter 1 Vib_Tick2 res 1 ; Vibration counter 2 Dly_2s res 1 ; Counter for 2 seconds delay (on $ off) ; ;****************************************************************************** ; RESET ENTRY ;****************************************************************************** ; ResetVec ORG 0x00 ; Reset Vector movwf OSCCAL ; Internal oscillator calibration goto Main ; ;****************************************************************************** ; SUBROUTINES ;****************************************************************************** ; ; Padding Delay ; Pad_Delay movlw 0x08 ; 25 cycles movwf Pad_Delay_Cnt Pad_Delay0 decfsz Pad_Delay_Cnt,f goto Pad_Delay0 nop ; 1 cycle retlw 0 ; 4 cycles (including call) ; ; Toggle led routine, it will toggle led on and of or cycle the three colors ; if in cycle mode ; Tog_Led btfsc Cyc_Mod ; control if led is in cycle mode goto Cycle movf STAT,w xorwf sGPIO,f ; if not toggle it retlw 0 Cycle decfsz Cyl_Cnt ; if yes decrement the counter and it for 0 retlw 0 movlw .2 movwf Cyl_Cnt ; load cycle counter btfss sGPIO,0 ; test the led for red goto $+4 bcf sGPIO,0 ; if yes bsf sGPIO,1 ; set it blue retlw 0 btfss sGPIO,1 ; test the led for blue goto $+4 bcf sGPIO,1 ; bsf sGPIO,2 ; if yes set it green retlw 0 bcf sGPIO,2 bsf sGPIO,0 ; otherwise the led is green so set it red retlw 0 ; ; Vibration toggle ; Tog_Vib movlw b'00100000' xorwf sGPIO,w movwf sGPIO retlw 0 ; ; Change frequency ; Frq_Cng movlw F1hz xorwf Frq_Reps,w btfss STATUS,2 goto Test_5hz movlw F5hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 Test_5hz movlw F5hz xorwf Frq_Reps,w btfss STATUS,2 goto Set_1hz movlw F20hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 Set_1hz movlw F1hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 ; ; Change color ; Col_Cng btfss STAT,0 ; test if the led is red goto Test_Blue ; if not go test if it's blue bcf sGPIO,0 movlw Blue movwf STAT call Zero_Vib retlw 0 Test_Blue btfss STAT,1 goto Test_Green bcf sGPIO,1 movlw Green movwf STAT call Zero_Vib retlw 0 Test_Green btfss STAT,2 goto Set_Red bcf sGPIO,2 bcf STAT,2 bsf Cyc_Mod bsf sGPIO,0 call Zero_Vib retlw 0 Set_Red movlw Red movwf STAT call Zero_Vib retlw 0 Zero_Vib movlw .50 movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 bcf sGPIO,5 retlw 0 ; ; SLEEP routine ; Go_Sleep movlw b'00100001' ; activate vibration and red light movwf GPIO movlw .20 movwf Frq_Tick movlw .10 movwf Vib_Tick1 movlw .3 movwf Vib_Tick2 Off_Loop clrf TMR0 movf Vib_Tick2,w btfsc STATUS,Z goto Off_Leds Off_Vib decfsz Vib_Tick1 ; test if vibration status change delay goto Off_Leds ; has gone movlw b'00100000' ; if yes change its state xorwf GPIO,f ; movlw .10 movwf Vib_Tick1 ; load the counter again decfsz Vib_Tick2 ; and test if the 2 reps has gone goto Off_Leds ; if not go to leds Off_Leds decfsz Frq_Tick ; test if delay for color change has gone goto OffLoop_Test btfss GPIO,0 ; if yes change the led color goto $+6 bcf GPIO,0 bsf GPIO,1 movlw .20 movwf Frq_Tick goto OffLoop_Test btfss GPIO,1 goto $+6 bcf GPIO,1 bsf GPIO,2 movlw .20 movwf Frq_Tick goto OffLoop_Test retlw 0 OffLoop_Test movlw .195 xorwf TMR0,w skpz goto OffLoop_Test call Pad_Delay goto Off_Loop ;****************************************************************************** ; MAIN PROGRAM ;****************************************************************************** ; Main ORG 0x100 btfsc STATUS,GPWUF ; Test for reset on pin change goto Init_HW ; ; ; if not initialise Variables on powerup (not wakeup) ; movlw F5hz ; set 1 Hz frequency movwf Frq_Reps ; in the frequency repetition counter movwf Frq_Tick ; and in the frequency tick counter movlw Red ; set the led color movwf STAT movlw .50 ; load the two vibration tick counters movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 movlw .2 ; load the counter for doubling frequency in movwf Cyl_Cnt ; cycle mode movlw .80 ; load the counter for on/off 2 seconds delay movwf Dly_2s ; movlw b'00011000' movwf sGPIO ; Init_HW: movf sGPIO,W ;??? clrf GPIO ; preset GPIO latch ; Wake on pin change ON, T0CKI OFF, weak pull ups ON, prescaler 1:128 movlw b'00010110' ; weak pull up not available for FRQ button OPTION ; TRISGPIO: GP0, GP1, GP2, GP5 outputs movlw b'11011000' tris GPIO SupLoop clrf TMR0 Led_Test decfsz Frq_Tick,f ; test if the frequency half cycle has passed goto Vibr_Test ; if not got to the next task call Tog_Led ; if yes toggle the led movf Frq_Reps,w ; and load the frequency cycle counter movwf Frq_Tick Vibr_Test btfsc sGPIO,5 ; test if the vibration is on goto Vib_ON decfsz Vib_Tick1 ; if not wait till 20s goto Frq_Test ; has passed movlw .50 movwf Vib_Tick1 decfsz Vib_Tick2 goto Frq_Test movlw .20 movwf Vib_Tick1 call Tog_Vib ; then turn it on goto Frq_Test Vib_ON decfsz Vib_Tick1 ; if it's on goto Frq_Test ; wait till 500 ms has passed movlw .50 movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 call Tog_Vib ; than turn it off Frq_Test btfsc Frq_Btn ; test if frequency button is pressed goto $+5 btfss Frq_Lst ; if yes test what was its last state goto Pow_Test ; if it was pressed go to power button test bcf Frq_Lst ; if it was not pressed update its state goto Pow_Test ; and go to pow test btfsc Frq_Lst ; if frq is not pressed test if it was the last time goto Pow_Test ; call Frq_Cng ; if yes change frequency bsf Frq_Lst ; and update its status Pow_Test btfsc Pow_Btn ; test if pow is pressed goto $+5 btfss Pow_Lst ; if yes test what was its last state goto OFF_Test ; if it was pressed go to OFF test bcf Pow_Lst ; if not update its state goto Output ; and go to output btfsc Pow_Lst ; if pow is not pressed test if it was the last time goto Output call Col_Cng ; if yes change color bsf Pow_Lst ; update its status goto Output ; and go to output OFF_Test decfsz Dly_2s ; test if 2 seconds has passed goto $+2 call Go_Sleep ; if yes go to sleep clrf GPIO ;?? sleep Output movf sGPIO,w movwf GPIO SupLoop_Test movlw .195 ; if 25ms has not passed wait xorwf TMR0,w skpz goto SupLoop_Test call Pad_Delay goto SupLoop END |
|
|
|
该代码是绝对代码和可重定位代码的混合。您只能在绝对代码中使用“org”。您只能在可重定位模式中使用“UDATA”和“RES”。您需要选择一个或另一个。
以上来自于百度翻译 以下为原文 That code is a mixture of absolute and relocatable code. You can only use "ORG" in absolute code. You can only use "UDATA" and "res" in relocatable mode. You need to pick one or the other. |
|
|
|
看看ATC:程序文件(x86) Microchip MPLABX V4.05 MPASMX 模板代码12F509TEM.ASMO绝对代码的一个例子,ANDC:程序文件(x86)Microchip MPLABXV4.05MPASMXMaskObj12F509TMPO.ASMMA可重新定位。
以上来自于百度翻译 以下为原文 Have a look at C:Program Files (x86)MicrochipMPLABXv4.05mpasmxtemplatesCode12F509TEMP.ASM for an example of absolute code, and C:Program Files (x86)MicrochipMPLABXv4.05mpasmxtemplatesObject12F509TMPO.ASM for relocatable. |
|
|
|
那么,如果我选择可重新定位,我应该使用代码而不是ORG吗?
以上来自于百度翻译 以下为原文 So, if I choose relocatable should I use CODE instead of ORG? |
|
|
|
这是你需要做的主要改变。而且,大多数警告是因为你省略了你所有的DEFSZ指令中的目标标志。如果你使用了“W”和“F”而不是“0”和“1”,那么你的代码就更可读了。那些已经在P12F50中为你定义的。9.公司
以上来自于百度翻译 以下为原文 That's the principal change you need to make. Also, most of those warning are because you have omitted the destination flag on all your DECFSZ instructions. Your code is much more readable if you use "w" and "f" rather than "0" and "1" for that suffix. Those have already been defined for you in p12F509.inc |
|
|
|
好的,我已经更新了代码,使用代码而不是org,将目标标志添加到DEFSZ,未选中的“内置绝对模式”。但仍然“在当前PC 0x3FF中没有找到源代码行”。打开程序内存视图以查看指令代码反汇编“更新代码”
以上来自于百度翻译 以下为原文 Ok, I've updated the code, using CODE instead of ORG, adding destination flags to DECFSZ, unchecked "build in absolute mode". But still getting "No source code lines were found at current PC 0x3ff. Open program memory view to see instruction code disassembly" The updated code ;****************************************************************************** ;------------------------------------------------------------------------------ ; PINOUT ;------------------------------------------------------------------------------ ; 12F509 @ 8 pin ; ; |??/??| ; Vdd -|1 8|- Vss ; GP5 -|2 7|- GP0 ; GP4 -|3 6|- GP1 ; GP3/MCLR -|4 5|- GP2 ; |______| ; ; Vdd 1: ++ ; GP5/OSC1/CLKIN 2: Vibration ; GP4/OSC2 3: Frequency button ; GP3/!MCLR/VPP 4: Power/color button ; GP2/T0CKI 5: Blue light ; GP1/ICSPCLK 6: Green light ; GP0/ICSPDAT 7: Red light ; Vss 8: -- ; ;****************************************************************************** ; PORT DEFINITIONS ;****************************************************************************** ; ;GPIO map ;| 5 | 4 | 3 | 2 | 1 | 0 | ;|-----|-----|-----|-----|-----|-----| ;| VIB | FRQ | POW | GRE | BLU | RED | ; #define Frq_Btn GPIO,GP4 ; Frequency button #define Pow_Btn GPIO,GP3 ; Power and color button #define Red b'00000001' ; Red light bit #define Blue b'00000010' ; Green light bit #define Green b'00000100' ; Blue light bit #define F1hz d'20' ; Half cycle reps 25x20 = 500ms #define F5hz d'8' ; Half cycle reps 25x8 = 100ms #define F20hz d'1' ; Half cycle reps 25x1 = 25ms #define Frq_Lst sGPIO,GP4 ; Last status of frequency button #define Pow_Lst sGPIO,GP3 ; Last status of power button #define Cyc_Mod STAT,GP3 ; Cycle mode ; ;****************************************************************************** ; PROCESSOR DEFINITION ;****************************************************************************** ; LIST p=12F509 #include radix dec ; ;****************************************************************************** ; CONFIGURATION ;****************************************************************************** ; Internal oscillator, no WDT, no code protection, pin 4 set as GP3 ; __CONFIG _OSC_IntRC & _WDT_OFF & _CP_OFF & _MCLRE_OFF ; ;****************************************************************************** ; RAM MEMORY ;****************************************************************************** ; general purpose RAM ; UDATA Frq_Reps res 1 ; Number of repetitions for current frequency Frq_Tick res 1 ; Frequency cycle counter Pad_Delay_Cnt res 1 STAT res 1 ; Current led status Cyl_Cnt res 1 ; Counter for dubling frequency in cicle mode sGPIO res 1 ; Shadow Vib_Tick1 res 1 ; Vibration counter 1 Vib_Tick2 res 1 ; Vibration counter 2 Dly_2s res 1 ; Counter for 2 seconds delay (on $ off) ; ;****************************************************************************** ; RESET ENTRY ;****************************************************************************** ; ResetVec CODE 0x00 ; Reset Vector movwf OSCCAL ; Internal oscillator calibration goto Main ; ;****************************************************************************** ; SUBROUTINES ;****************************************************************************** ; ; Padding Delay ; Pad_Delay movlw 0x08 ; 25 cycles movwf Pad_Delay_Cnt Pad_Delay0 decfsz Pad_Delay_Cnt,f goto Pad_Delay0 nop ; 1 cycle retlw 0 ; 4 cycles (including call) ; ; Toggle led routine, it will toggle led on and of or cycle the three colors ; if in cycle mode ; Tog_Led btfsc Cyc_Mod ; control if led is in cycle mode goto Cycle movf STAT,w xorwf sGPIO,f ; if not toggle it retlw 0 Cycle decfsz Cyl_Cnt,f ; if yes decrement the counter and it for 0 retlw 0 movlw .2 movwf Cyl_Cnt ; load cycle counter btfss sGPIO,0 ; test the led for red goto $+4 bcf sGPIO,0 ; if yes bsf sGPIO,1 ; set it blue retlw 0 btfss sGPIO,1 ; test the led for blue goto $+4 bcf sGPIO,1 ; bsf sGPIO,2 ; if yes set it green retlw 0 bcf sGPIO,2 bsf sGPIO,0 ; otherwise the led is green so set it red retlw 0 ; ; Vibration toggle ; Tog_Vib movlw b'00100000' xorwf sGPIO,w movwf sGPIO retlw 0 ; ; Change frequency ; Frq_Cng movlw F1hz xorwf Frq_Reps,w btfss STATUS,2 goto Test_5hz movlw F5hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 Test_5hz movlw F5hz xorwf Frq_Reps,w btfss STATUS,2 goto Set_1hz movlw F20hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 Set_1hz movlw F1hz movwf Frq_Reps movwf Frq_Tick call Zero_Vib retlw 0 ; ; Change color ; Col_Cng btfss STAT,0 ; test if the led is red goto Test_Blue ; if not go test if it's blue bcf sGPIO,0 movlw Blue movwf STAT call Zero_Vib retlw 0 Test_Blue btfss STAT,1 goto Test_Green bcf sGPIO,1 movlw Green movwf STAT call Zero_Vib retlw 0 Test_Green btfss STAT,2 goto Set_Red bcf sGPIO,2 bcf STAT,2 bsf Cyc_Mod bsf sGPIO,0 call Zero_Vib retlw 0 Set_Red movlw Red movwf STAT call Zero_Vib retlw 0 Zero_Vib movlw .50 movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 bcf sGPIO,5 retlw 0 ; ; SLEEP routine ; Go_Sleep movlw b'00100001' ; activate vibration and red light movwf GPIO movlw .20 movwf Frq_Tick movlw .10 movwf Vib_Tick1 movlw .3 movwf Vib_Tick2 Off_Loop clrf TMR0 movf Vib_Tick2,w btfsc STATUS,Z goto Off_Leds Off_Vib decfsz Vib_Tick1,f ; test if vibration status change delay goto Off_Leds ; has gone movlw b'00100000' ; if yes change its state xorwf GPIO,f ; movlw .10 movwf Vib_Tick1 ; load the counter again decfsz Vib_Tick2,f ; and test if the 2 reps has gone goto Off_Leds ; if not go to leds Off_Leds decfsz Frq_Tick,f ; test if delay for color change has gone goto OffLoop_Test btfss GPIO,0 ; if yes change the led color goto $+6 bcf GPIO,0 bsf GPIO,1 movlw .20 movwf Frq_Tick goto OffLoop_Test btfss GPIO,1 goto $+6 bcf GPIO,1 bsf GPIO,2 movlw .20 movwf Frq_Tick goto OffLoop_Test retlw 0 OffLoop_Test movlw .195 xorwf TMR0,w skpz goto OffLoop_Test call Pad_Delay goto Off_Loop ;****************************************************************************** ; MAIN PROGRAM ;****************************************************************************** ; Main: CODE 0x100 btfsc STATUS,GPWUF ; Test for reset on pin change goto Init_HW ; ; ; if not initialise Variables on powerup (not wakeup) ; movlw F5hz ; set 1 Hz frequency movwf Frq_Reps ; in the frequency repetition counter movwf Frq_Tick ; and in the frequency tick counter movlw Red ; set the led color movwf STAT movlw .50 ; load the two vibration tick counters movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 movlw .2 ; load the counter for doubling frequency in movwf Cyl_Cnt ; cycle mode movlw .80 ; load the counter for on/off 2 seconds delay movwf Dly_2s ; movlw b'00011000' movwf sGPIO ; Init_HW: movf sGPIO,W ;??? clrf GPIO ; preset GPIO latch ; Wake on pin change ON, T0CKI OFF, weak pull ups ON, prescaler 1:128 movlw b'00010110' ; weak pull up not available for FRQ button OPTION ; TRISGPIO: GP0, GP1, GP2, GP5 outputs movlw b'11011000' tris GPIO SupLoop clrf TMR0 Led_Test decfsz Frq_Tick,f ; test if the frequency half cycle has passed goto Vibr_Test ; if not got to the next task call Tog_Led ; if yes toggle the led movf Frq_Reps,w ; and load the frequency cycle counter movwf Frq_Tick Vibr_Test btfsc sGPIO,5 ; test if the vibration is on goto Vib_ON decfsz Vib_Tick1,f ; if not wait till 20s goto Frq_Test ; has passed movlw .50 movwf Vib_Tick1 decfsz Vib_Tick2,f goto Frq_Test movlw .20 movwf Vib_Tick1 call Tog_Vib ; then turn it on goto Frq_Test Vib_ON decfsz Vib_Tick1,f ; if it's on goto Frq_Test ; wait till 500 ms has passed movlw .50 movwf Vib_Tick1 movlw .16 movwf Vib_Tick2 call Tog_Vib ; than turn it off Frq_Test btfsc Frq_Btn ; test if frequency button is pressed goto $+5 btfss Frq_Lst ; if yes test what was its last state goto Pow_Test ; if it was pressed go to power button test bcf Frq_Lst ; if it was not pressed update its state goto Pow_Test ; and go to pow test btfsc Frq_Lst ; if frq is not pressed test if it was the last time goto Pow_Test ; call Frq_Cng ; if yes change frequency bsf Frq_Lst ; and update its status Pow_Test btfsc Pow_Btn ; test if pow is pressed goto $+5 btfss Pow_Lst ; if yes test what was its last state goto OFF_Test ; if it was pressed go to OFF test bcf Pow_Lst ; if not update its state goto Output ; and go to output btfsc Pow_Lst ; if pow is not pressed test if it was the last time goto Output call Col_Cng ; if yes change color bsf Pow_Lst ; update its status goto Output ; and go to output OFF_Test decfsz Dly_2s,f ; test if 2 seconds has passed goto $+2 call Go_Sleep ; if yes go to sleep clrf GPIO ;?? sleep Output movf sGPIO,w movwf GPIO SupLoop_Test movlw .195 ; if 25ms has not passed wait xorwf TMR0,w skpz goto SupLoop_Test call Pad_Delay goto SupLoop END |
|
|
|
这可能是正常的,我从来没有使用过一个古老的芯片组装。这个消息是准确的,因为你的PIC在那个位置开始,但是那个地址没有出现在你的来源中。你试过做它告诉你的吗?即打开“程序内存视图”?您应该能够从那里进入您的代码,因为它将从地址0x3FF滚动到0x000地址。
以上来自于百度翻译 以下为原文 That may be normal, I've never used one of those ancient chips in assembly. The message is accurate, as your PIC starts at that location, but that address does not appear in your source. Have you tried doing what it tells you to? i.e. opening the "Program memory view" ? You should be able to step into your code from there, as it will roll over from address 0x3ff to address 0x000 |
|
|
|
打开程序内存视图我看到这个(右边的菜单显示如果我用鼠标右键单击一行)
以上来自于百度翻译 以下为原文 Opening the Program Memory view I see this (the menu on the right shows if I click with right mouse button on one line) |
|
|
|
是的,在那里有一个MOVLW指令,带有校准常数。您应该能够从那里运行或单步执行到程序的开始。
以上来自于百度翻译 以下为原文 Yes, there is a MOVLW instruction there, with the calibration constant. You should be able to run or single step from there to the start of your program. |
|
|
|
|
|
|
|
您处于调试器中,因此您的工具栏上有“运行”和“单步执行”按钮(又名“步进”和“跨步”)。这不是您想要做的,通过代码吗?
以上来自于百度翻译 以下为原文 You are in the debugger, so your toolbar has buttons to "run" and "single-step" (aka "step into" and "step over"). Isn't that what you are trying to do, step through your code? |
|
|
|
当然,这就是我所做的…所以基本上我必须忽略那个信息?
以上来自于百度翻译 以下为原文 Sure, is that what I was doing... so basically I've to ignore that message? |
|
|
|
只有小组成员才能发言,加入小组>>
5184 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3179 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2230 浏览 5 评论
742浏览 1评论
629浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
512浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
640浏览 0评论
538浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 23:30 , Processed in 1.607678 second(s), Total 115, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号