;Program compiled by Great Cow BASIC (0.9 29/11/2009)
;Need help? See the GCBASIC forums at http://sourceforge.net/forum/?group_id=169286,
;check the documentation or email w_cholmondeley@users.sourceforge.net.
;********************************************************************************
;Set up the assembler options (Chip type, clock source, other bits and pieces)
LIST p=16F1934, r=DEC
#include <P16F1934.inc>
__CONFIG _CONFIG1, _MCLRE_OFF & _WDTE_OFF & _FOSC_INTOSC
__CONFIG _CONFIG2, _LVP_OFF & _PLLEN_OFF
;********************************************************************************
;Set aside memory locations for variables
DELAYTEMP EQU 112
DELAYTEMP2 EQU 113
SysWaitTempMS EQU 114
SysWaitTempMS_H EQU 115
SysWaitTempS EQU 116
;********************************************************************************
;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
banksel TRISB
bcf TRISB,0
START
banksel PORTB
bsf PORTB,0
movlw 1
movwf SysWaitTempS
call Delay_S
bcf PORTB,0
movlw 1
movwf SysWaitTempS
call Delay_S
goto START
BASPROGRAMEND
sleep
goto $
;********************************************************************************
Delay_MS
incf SysWaitTempMS_H, F
DMS_START
movlw 4
movwf DELAYTEMP2
DMS_OUTER
movlw 165
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
;********************************************************************************
Delay_S
DS_START
movlw 232
movwf SysWaitTempMS
movlw 3
movwf SysWaitTempMS_H
call Delay_MS
decfsz SysWaitTempS, F
goto DS_START
return
;********************************************************************************
INITSYS
movlw 135
banksel OSCCON
andwf OSCCON,F
movlw 112
iorwf OSCCON,F
bcf ADCON0,ADON
bcf ADCON1,ADFM
banksel ANSELA
clrf ANSELA
clrf ANSELB
banksel CM2CON0
bcf CM2CON0,C2ON
bcf CM1CON0,C1ON
banksel PORTA
clrf PORTA
clrf PORTB
clrf PORTC
clrf PORTD
clrf PORTE
return
;********************************************************************************
;Start of program memory page 1
ORG 2048
END