Hi Melanie
Thanks for your reply,
Yes my led blinks ok.
Cheers
Dave...
Hi Melanie
Thanks for your reply,
Yes my led blinks ok.
Cheers
Dave...
Hi Melanie
Just an addon to the above test, which worked fine,,,
Last year you very kindly drafted me a piece of code for a project that has been working flawlessly,
I am having problems adding an led command to it, if I add an low led command to it, it locks up when its triggered.
Any ideas,
Cheers
Dave..
'G7JIQ MICRO LINK REPEATER
'PIC 12F675
'Internal RC clock
'
' PIC Defines
' -----------
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
' System Clock Options (Internal)
@ DEVICE pic12F675, WDT_ON
' Watchdog Timer
@ DEVICE pic12F675, PWRT_ON
' Power-On Timer
@ DEVICE pic12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic12F675, BOD_ON
' Brown-Out Detect
@ DEVICE pic12F675, CPD_OFF
' Data Memory Code Protect
@ DEVICE pic12F675, PROTECT_OFF
' Program Code Protection
'
' Define Hardware
' ---------------
InputTrigger var GPIO.5 ' Input normally HIGH, goes LOW to Trigger
InputReset var GPIO.2 ' Input normally HIGH, goes LOW to RESET
OutputLine var GPIO.0 ' Normally HIGH, goes LOW when triggered
Led var GPIO.1
'
' Define Variables
' ----------------
DelayTick var Byte ' 100mS Tick Counter
'
' Initialise PIC
' --------------
Reset:
TRISIO=%00100100 ' Preset I/O
CMCON=%00000111 ' Disable Comparators
ANSEL=%00000000 ' Disable ADC
DelayTick=0 ' Reset Counter
high OutputLine ' Everything RESET
pause 2000
' Main Program Loop
' -----------------
Loop:
'
' Test for RESET
' --------------
While InputReset=0 ' Just wait here if RESET
DelayTick=0 ' Reset Counter
high OutputLine ' Reset Output
Wend
'
' Test for Trigger
' ----------------
If InputTrigger=0 then ' Test for Trigger
low OutputLine ' Enable Output
DelayTick=1 ' Arm Counter
'Goto Loop
endif
'
' Timeout Counter
' ---------------
If DelayTick>0 then
DelayTick=DelayTick+1 ' Count Time
Pause 60 ' Waste 100mS
If DelayTick>50 then goto Reset
' 50 = 5 sec
' 100 = 10 sec
' origanly set at 201 Reset at 20 Seconds
endif
Goto Loop
'
End
Bookmarks