Hi Gene,
You arm missing the port settings (TRIS). I haven't touched PBC since 2000 so I'm very rusty but here is an example I pulled from my files taken from this forum. Please note the GPIO and TRISIO settings. They set the port pins as either input or output and whether the pin starts out as high or low. CMCON disables the comparator.
Code:
'PIC: 12F629
' GP0: Turn Something On (relay, FET, alarm, etc)
' GP1: Test Location LED, Buzzer, VOM, nothing?
' GP2:
' GP3: (MCLR Internal)
' GP4: XTAL 4.0000 Hz (w/tolerance = 30 ppm) w/ cap to GND
' GP5: XTAL 4.0000 Hz (w/tolerance = 30 ppm) w/ cap to GND
'
' -_-
' +5V--| |--GND
' Xtal-|12F|--to turn on circuit (relay, FET, alarm, etc)
' Xtal-|629|--test location (LED, buzzer, etc. if required)
' -| |-
' ---
' (Xtal caps to GND not shown)
'
' CONFIGURATION SETUP
' Oscillator: XT
' Watchdog Timer: OFF
' Power up Timer: OFF
' Master Clear Enable: Internal
' Brown Out Detect: OFF
' Code Protect: OFF
' Data EE Read Protect:OFF
'**********************************************************
CMCON=7 'all digital for low power use
GPIO=$00001000
TRISIO=$00001000
OPTION_REG=%10000111 'weak pullups off, TMRO prescale = 256
INTCON=0 'interrupts off
'**********************************************************
HzTimer VAR Word '1/2 second counter (2 Hz)
SS VAR Byte ' Seconds 0-59
col VAR Bit ' colon 1=on, 0=0ff
trip var bit
cnt var byte
HzTimer=$7A12 'for 1/2 Sec
'*********************************************************
I sure hope this helps you out. After thinking about this I think you have to "poke" the values into the GPIO and TRISIO registers. I don't have my PBC manual with me where I live during the week but I will check over some file archives and see if I can find some old files I did years ago. I will get back to you.
BobK
Bookmarks