I get an error when compiling: Error: GCASM: Symbol RP0 has not been defined
The code was two lines long: ;Chip Settings #chip 12F617,8
if I change by add the RPO instruction. The error is resolved but the memory management may not be working.
;Chip Settings #chip 12F617,8 set RP0 = 0
How can I correct the memory management?
I returned to this chip today.
I have made not progress. I can program using an ASM file from another source but still no luck with GCB.
Working ASM from another source. This proves the software and hardware is ok.
;flasher.asm ;simple program for PIC12F617 ;chip plugged into Low Pin Count Demo Board ;flashes LED on GP2 (pin 5) ;pot slider connected to AN0 (pin 7) ;switch on GP3 (pin 4) list p=12f617 ;list directive to define processor #include "p12f617.inc" ;processor specific variable definitions errorlevel -302 __config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_ON & _IOSCFS_8MHZ) ;----------------------------------------------------------------- ;defines ;----------------------------------------------------------------- #define LED GPIO2 ;GP2 (pin 5) ;----------------------------------------------------------------- ;variables ;----------------------------------------------------------------- cblock 0x20 Counter1 Counter2 Shadow endc ;------------------------------------------------------------------ ;initialisation ;------------------------------------------------------------------ org 0 clrf W movwf ANSEL banksel TRISIO clrf W movwf TRISIO banksel GPIO ;----------------------------------------------------------------------- ;main program loop ;----------------------------------------------------------------------- loop: movlw 0x04 movwf GPIO call dly movlw 0x00 movwf GPIO call dly goto loop dly: movlw 0x20 movlw Counter1 dly1: movlw 0xFF movlw Counter2 dly2: decfsz Counter2,F goto dly2 decfsz Counter1,F goto dly1 return end
GCB Code - do not work
;Program compiled by Great Cow BASIC (0.9 5/11/2012) ;Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums, ;check the documentation or email w_cholmondeley at users dot sourceforge dot net. ;******************************************************************************** ;Set up the assembler options (Chip type, clock source, other bits and pieces) LIST p=12F617, r=DEC #include <P12F617.inc> __CONFIG _MCLRE_OFF & _WDT_OFF & _XT_OSC ;******************************************************************************** ;Set aside memory locations for variables DELAYTEMP EQU 112 DELAYTEMP2 EQU 113 SysWaitTempMS EQU 114 SysWaitTempMS_H EQU 115 ;******************************************************************************** ;Vectors ORG 0 goto BASPROGRAMSTART ORG 4 retfie ;******************************************************************************** ;Start of program memory page 0 ORG 5 BASPROGRAMSTART ;Call initialisation routines call INITSYS ;Start of the main program ;Chip Settings ;#define LedPorts ;DIR GPIO.1 out banksel TRISIO bcf TRISIO,1 ;DIR GPIO.2 out bcf TRISIO,2 ;do SysDoLoop_S1 ; Set GPIO.2 on banksel GPIO bsf GPIO,2 ;wait 500 ms movlw 244 movwf SysWaitTempMS movlw 1 movwf SysWaitTempMS_H call Delay_MS ;Set GPIO.2 off bcf GPIO,2 ;Loop goto SysDoLoop_S1 SysDoLoop_E1 BASPROGRAMEND sleep goto BASPROGRAMEND ;******************************************************************************** Delay_MS incf SysWaitTempMS_H, F DMS_START movlw 142 movwf DELAYTEMP2 DMS_OUTER movlw 1 movwf DELAYTEMP DMS_INNER decfsz DELAYTEMP, F goto DMS_INNER decfsz DELAYTEMP2, F goto DMS_OUTER decfsz SysWaitTempMS, F goto DMS_START decfsz SysWaitTempMS_H, F goto DMS_START return ;******************************************************************************** INITSYS ;SET ADCON0.ADON OFF bcf ADCON0,ADON ;SET ADFM OFF bcf ADCON0,ADFM ;ANSEL = 0 banksel ANSEL clrf ANSEL ;CMCON0 = 7 movlw 7 banksel CMCON0 movwf CMCON0 ;GPIO = 0 clrf GPIO ;PORTA = 0 clrf PORTA return ;******************************************************************************** END
Log in to post a comment.
I get an error when compiling: Error: GCASM: Symbol RP0 has not been defined
The code was two lines long:
;Chip Settings
#chip 12F617,8
if I change by add the RPO instruction. The error is resolved but the memory management may not be working.
;Chip Settings
#chip 12F617,8
set RP0 = 0
How can I correct the memory management?
I returned to this chip today.
I have made not progress. I can program using an ASM file from another source but still no luck with GCB.
Working ASM from another source. This proves the software and hardware is ok.
GCB Code - do not work