Hi I am new to the 16F88 chip and I am trying to run some code that
previously worked on a 16F628. The code is to simply cause an LED to
blink on/off after a delay period.
>With this code it blinks:
Start
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO Start
BCF PORTA, 2
CLRF r_Clk1_For2HzOutput_ms
a1_Loop2
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO a1_Loop2
BSF PORTA, 2
CLRF r_Clk1_For2HzOutput_ms
GOTO Start
END ; directive 'end of program'
>With this code it does Not blink:
Start
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO Start
MOVLW 0x04
XORWF PORTA, 1 ;<-- Must examine why this is Not working!!!
;OMIT: clrb PORTA.2
CLRF r_Clk1_For2HzOutput_ms
a1_Loop2
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO a1_Loop2
BSF PORTA, 2
CLRF r_Clk1_For2HzOutput_ms
GOTO Start
END ; directive 'end of program'
>With this code it still blinks:
Start
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO Start
MOVLW 0x04
XORWF PORTA, 1 ;<-- Must examine why this is Not working!!!
BCF PORTA, 2
CLRF r_Clk1_For2HzOutput_ms
a1_Loop2
MOVLW D'200'
SUBWF r_Clk1_For2HzOutput_ms, 0
BTFSS 3, 0
GOTO a1_Loop2
BSF PORTA, 2
CLRF r_Clk1_For2HzOutput_ms
GOTO Start
END ; directive 'end of program'
What am I doing wrong?
Note:
(1) I am shutting down the comparator with this statement in the init
procedure:
MOVLW H'07' ; CMCON=7 set comperators off
MOVWF CMCON
(2) This is the config:
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF &
_WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON &
_HS_OSC & _PWRTE_ON & _WDT_OFF
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF &
_WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON &
_HS_OSC & _PWRTE_ON & _WDT_OFF
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
Thanks
Roger

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )