The ultimate program.....
thanks Mister_e,
so I could define my ports for the 12F629 and best of all one input and one output covers my needs...
at last I got my ultimate program: counting pulses on GPIO.5 and give a signal if a limit is exedeed:
'************************************************* ***************
'* Name : count12F629_1 *
'* Author : Davidpower *
'* 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
LED var gpio.0
Cnt VAR word ' Cnt is a word variable
Cnt = 0
LED = 0
rpt :
Count gpio.5, 500, CNT
if CNT > 10 then
LED = 1
Else
LED = 0
ENDIF
Goto RPT
END ' End of program
of course it doesnīt work and I dont know why. gets TTL square wave signal to GPIO.5 and recognizes the signal in another program when slow enough, that means it recieves and the voltage etc. is ok. Whats wrong?
please help