Hi all
I've done a little programiing of the 16f628/A and can get my way around with the basics, using GCBasic.
Wanting to simplify my circuits so I bought a 10F206 to make 2 led flash, using GP0 and GP1 to drive the LEDs.
I'm using a PICKit 2 prcgrammer with the PICKit 2 software.
But I keep getting a message referring to the "osccal", if tried setting (using the PICKit software) to verious setting, but still nothing
When I add "#OSCCAL 11111110" to the txt file, on compiling it I get a error message "Configuration setting not valid: CAL11111110_OSC"
Please Help
A Copy of the .ASM file
I've done a little programiing of the 16f628/A and can get my way around with the basics, using GCBasic.
Wanting to simplify my circuits so I bought a 10F206 to make 2 led flash, using GP0 and GP1 to drive the LEDs.
I'm using a PICKit 2 prcgrammer with the PICKit 2 software.
But I keep getting a message referring to the "osccal", if tried setting (using the PICKit software) to verious setting, but still nothing
When I add "#OSCCAL 11111110" to the txt file, on compiling it I get a error message "Configuration setting not valid: CAL11111110_OSC"
Please Help
Code:
#chip 10f206,4
#config INTRC_OSC
#DEFINE BLUE PortGP.0
#DEFINE WHT PORTGP.1
Main:
SET WHT ON
WAIT 1 S
SET WHT OFF
WAIT 1 S
SET BLUE ON
WAIT 1 S
SET BLUE OFF
WAIT 1 S
goto main
A Copy of the .ASM file
Code:
;Program compiled by Great Cow BASIC (0.9 10/2/2007)
;Need help? See the GCBASIC forums at http://sourceforge.net/forum/?group_id=169286,
;check the documentation or email hconsidine@bigpond.com.
;********************************************************************************
;Set up the assembler options (Chip type, clock source, other bits and pieces)
LIST p=10F206, r=DEC
#include <P10F206.inc>
__CONFIG _INTRC_OSC & _WDT_OFF & _MCLRE_OFF
;********************************************************************************
;Set aside memory locations for variables
DELAYTEMP equ 8
DELAYTEMP2 equ 9
DELAYTEMP4 equ 10
PORTGP equ 11
SysWaitTempMS equ 12
SysWaitTempS equ 13
;********************************************************************************
;Jump to initialisation code when PIC is reset
ORG 0
call INITSYS
goto SystemInitialise
;********************************************************************************
;Various initialisation routines, automatically called by GCBASIC
SystemInitialise
;********************************************************************************
;Start of the main program
MAIN
bsf PORTGP,1
movlw 1
movwf SysWaitTempS
call Delay_S
bcf PORTGP,1
movlw 1
movwf SysWaitTempS
call Delay_S
bsf PORTGP,0
movlw 1
movwf SysWaitTempS
call Delay_S
bcf PORTGP,0
movlw 1
movwf SysWaitTempS
call Delay_S
goto MAIN
BASPROGRAMEND
sleep
goto $
;********************************************************************************
;Subroutines included in program
;********************************************************************************
DELAY_MS
DMS_START
movlw 10
movwf DELAYTEMP2
DMS_OUTER
movlw 33
movwf DELAYTEMP
DMS_INNER
decfsz DELAYTEMP, F
goto DMS_INNER
decfsz DELAYTEMP2, F
goto DMS_OUTER
decfsz SysWaitTempMS, F
goto DMS_START
retlw 0
;********************************************************************************
Delay_S
DS_START
movlw 10
movwf DELAYTEMP4
DS_OUTER
movlw 100
movwf SysWaitTempMS
call Delay_MS
decfsz DELAYTEMP4, F
goto DS_OUTER
decfsz SysWaitTempS, F
goto DS_START
retlw 0
;********************************************************************************
INITSYS
clrf GPIO
movlw 7
movwf CMCON0
retlw 0
;********************************************************************************
END
Last edited: