ok, this works but I donīt know how to adress in and outputs of the 12F629
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 26.09.2007 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
@ DEVICE pic12F629, INTRC_OSC_NOCLKOUT ; System Clock Options
@ DEVICE pic12F629, WDT_ON ; Watchdog Timer
@ DEVICE pic12F629, PWRT_ON ; Power-On Timer
@ DEVICE pic12F629, MCLR_OFF ; Master Clear Options (Internal)
@ DEVICE pic12F629, BOD_OFF ; Brown-Out Detect
@ DEVICE pic12F629, CPD_OFF ; Data Memory Code Protect
@ DEVICE pic12F629, PROTECT_OFF
DEFINE OSCCAL_1K 1' Set OSCCAL for 1k
cmcon = 7
trisio.5 = 1 ' port5 is an input
led1_status var bit
button1 var gpio.5
led1 var gpio.0
main:
if button1 = 0 then ' if the button is pressed
led1_status = 0 ' make it 0
pulsout GPIO.0,10000
pause 50 'debounce
else
led1_status = 1 ' the last state was a 0 so now make it a 1
pulsout GPIO.0,2000
pause 50 'debounce
endif
goto main
there has to be a simple straightforward command to define inputs and outputs
what the heck is it? I know the tris option for the 16F628A which works fine but doesnīt seem to work for me on the 12F629..why? This looks like "I define one port and hope the others work somehow for me" what do I miss? the explanation in the picbasic pro handbook doesnt help a bit because it adresses only the bigger Pics
Bookmarks