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
Bookmarks