Hi, Russ
THAT Works ( in the real World ...LOL ) ... but, for the moment, I Can't use GPIO.3 !!!
so, it works with GPIO.4 ...
I'm digging for what I've forgotten ...
Code:
'****************************************************************
'* Notes : Power up starts the time and turns on a FET *
'* : switch. After 15 minutes, the FET switch is *
'* : is turned off. If the stop switch is pressed *
'* : while the timer is running, the FET is turned off;*
'* : and the timer goes to sleep. The start switch *
'* : (interrupt) wakes the timer and starts it. *
'************************************************* ***************
REM device = 12F675
'DEVICES------------------------------------------------------------------
@ __Config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF
CMCON = 7 ' SETS DIGITAL MODE
ADCON0 = 0
ANSEL = 0 ' GPIO.0 TO GPIO.3 SET AS DIGITAL
VRCON.7 = 0 ' TURN OFF VOLTAGE REFERENCE
OPTION_REG.7 = 0 ' WEAK PULLUPS ENABLED
WPU = %00011100
GPIO = %00011100
TRISIO = %00011100 ' GPIO.2 AND GPIO.3 SET AS INPUT
INTCON = 0
N VAR WORD ' VARIABLE N DEFINED
'*************************************************************
PAUSE 300 'let's supply stabilize ...
Start:
N = 0
HIGH GPIO.0 'Lit The Light
While ( N < 3126 ) AND GPIO.4 ' Do that while GPIO.4 is High 3126
' AND time not finished
PAUSE 288 'Pause for .288 sec
N = N+1
WEND ' We've read enough !!!
LOW GPIO.0 'Ligts off !!!
INTCON = %00010000 ' INTERRUPT ENABLED ON GPIO.2, but NOT GIE !!!
@ Sleep ;Real ASM sleep
@ nop
INTCON = 0 'Interrupt disabled
GOTO Start
END
Alain
PS : May be GPIO.3 is "locked" by the reset system of my EasyPic5 ???
rePS : YESS ... works fine with GPIO.3 ... when J7 is correctly set !!!
Last edited by Acetronics2; - 12th April 2008 at 18:06.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks