Im tring to program my first chip. but going noware.
What im i doing wrong?
Im using Proton Plus
Device 12f629
CONFIG INTRC_OSC,WDT_OFF,MCLRE_OFF,CP_OFF
Symbol PIR = GPIO.3
Symbol RELAY = GPIO.2
Symbol TOCS = OPTION_REG.5
TRISIO = %00001000 ' Make GPIO.3 an input
TOCS = 0 'clock source internal
DELAYMS 60000 'wait 60 seconds
DELAYMS 60000 'wait 60 seconds
DELAYMS 30000 'wait 30 seconds
CHECKIT:
IF PIR = 1 THEN 'check sensor
DELAYMS 1000 'wait 1 second
RELAY = 1 'turn on relay
DELAYMS 1000 'wait a second
RELAY = 0 'turn off relay
ENDIF
DELAYMS 30000 'pause 30 seconds
GOTO CHECKIT 'do it again
END
What im i doing wrong?
Im using Proton Plus
Device 12f629
CONFIG INTRC_OSC,WDT_OFF,MCLRE_OFF,CP_OFF
Symbol PIR = GPIO.3
Symbol RELAY = GPIO.2
Symbol TOCS = OPTION_REG.5
TRISIO = %00001000 ' Make GPIO.3 an input
TOCS = 0 'clock source internal
DELAYMS 60000 'wait 60 seconds
DELAYMS 60000 'wait 60 seconds
DELAYMS 30000 'wait 30 seconds
CHECKIT:
IF PIR = 1 THEN 'check sensor
DELAYMS 1000 'wait 1 second
RELAY = 1 'turn on relay
DELAYMS 1000 'wait a second
RELAY = 0 'turn off relay
ENDIF
DELAYMS 30000 'pause 30 seconds
GOTO CHECKIT 'do it again
END