Hi,
Am having trouble with the "PAUSE" command in my code. Am not sure what additional registers need to be set to enable this command. When I remove the ,PAUSE, before the goto Lowvoltagecheck the LED lights up and stays on (whether LowVoltage is 1 or 0). If I keep the pause on the program the LED never goes ON. The LED should flash or stay on for 5 seconds but stays on indefinitely meaning my PAUSES are not working.
What more is needed?
;************************************************* *******
CMCON = %00000111 'Port A all digital
CVRCON = %00000000 'CVref turned off
OPTION_REG = %10000111
Main:
low HoldTxON ; Initialize by clearing all the outputs
low LED
Low MotorControl_1
LOW MotorControl_2
pause 5000
goto Lowvoltagecheck
end
;************************************************* ******************************
; Subroutine to check for battery voltage at the beginning and end of
; transmission flashing to signify low voltage or high voltage
LowVoltageCheck:
If lowVoltage = 1 then ; If the battery voltage is OK
high led ; turn on the LED for 5 seconds
pause 5000
LOw LEd
else
for loop = 1 to 10 ; If the battery voltage is low
high led ; Flash the LED 10 times
Pause 500 ; at a rate discernable from the
low led ; transmit LED flash rate
next
endif
return
;************************************************* *******
Thanks,
Nicholas.
Bookmarks