Hi I am very new to the 8pin pics
I need some help using a 12f629 and all I want is for it to sense
a hi or low on GP0 pin 7 and output on GP4 pin 3
I am using an ICD2 programmer
Configuration bits are:
internal RC no clock
Watchdog timer on
power up timer off
mclr enable external
brown out detect on
I have a 8k resistor connected from vdd to pin 4 MCLR
I do not seem to get the pic to read an input condition
my code is as follows
DEFINE OSCCAL_1K 1
DEFINE OSC 4
RELAY VAR GPIO.4
Pswitch VAR GPIO.0
INITIALISE:
CLEAR
TRISIO = %00000001 '0 in rest output
INTCON = %00000000
PIR1 = %00000000
PIE1 = %00000000
WPU = %00000000
CMCON = %11111111 'disable comparators
PAUSE 10
MAIN:
While(pswitch = 1)
relay = 0
wend
relay = 1
GOTO MAIN
end
I would be grateful if anyone could help