-
Melanie where are you?
I am beating my head against a wall trying to figure out why this program makes GPIO.0 output high for 4ms and low for 12ms. Also, GPIO.1 output is high for 8ms and low for 8ms. I would expect GPIO.1 to be low for 4ms and high for 12ms. GPIO.0 should be high all the time.
REM DEVICE = 12F675 '12F629 CAN ALSO BE USED
REM USE INTERNAL OSCILLATOR, OUTPUT IS ON GP4 (PIN 3)
REM CONFIGURATION: INTOSC CLOCKOUT, WDT DISABLED, PWR UP ENABLED,
'MCLR = OUTPUT PIN, BROWN OUT DISABLED, NO PROTECTION
REM 60 HZ OUTPUT IS ON PINS 7 AND 6
REM OSCILLATOR CHOICE: USE 101, INTOSC, CLKOUT
OPTION_REG.5 = 0 'OTHERWISE GPIO.2 IS AN INPUT
TRISIO = 0 'SETS ALL PORTS TO OUTPUT
ANSEL = 0 'SETS ALL DIGITAL MODE
DEFINE OSCCAL_1K 1 'FOR OSCILLATOR CALIBRATION, DON'T KNOW HOW IT WORKS
high GPIO.0 'INITIAL CONDITIONS
high GPIO.1
START:
low GPIO.1
PAUSEUS 4168 ' ON TIME
high GPIO.1
PAUSEUS 4167 'DEAD TIME, BOTH high
REM low GPIO.0 'SETS PIN 7 low
PAUSEus 4168 'FOR 4.168 MILLISECONDS
high GPIO.0
PAUSEUS 4167 'DEAD TIME
GOTO START '60 HZ FREQUENCY
END
-
Where's the CMCON setting?
-
Yeah, I would've asked for the pretty girl first too. :)
But I think mister_e nailed it. CMCON
<br>
-
Hay, thanks for the replies. If ANSEL = 0, I don't see why CMCON setting would make any difference. I tried CMCON = 0, no difference. Is there some other setting that would make sense?
-
CMCON = 7
(7 = all digital, 0 = one of the analog modes)
-
Try setting CMCON=7. Bits 0,1,2 high in CMCON=Comparator off. GP0 and GP1 pins are multiplexed to the comparator inputs. Something to try...
--John
-
Paul beat me to it... hope it works.
-
CIMCON = 7 works. Thank you. Thank you. Thank you.
Russ
-
Hey !
How come everyone's pencils get sharper when someone calls on Melanie? :)
Oh, and Congratulations Russ, to bad about TJ though, I will miss him.
JS