dom87
Newbie level 6
Hi,
I was wondering if anyone was able to help me with some code.
I'm building a frequency activated relay using a 12C508, which triggers when the input frequency is between 4-15KHz (square wave).
Any suggestions or guidance would be greatly appreciated.
I was given this code as an example, but I'm not quite sure how to tailor it to my requirements.
So I would like the relay to come on to a signal like this....
I was wondering if anyone was able to help me with some code.
I'm building a frequency activated relay using a 12C508, which triggers when the input frequency is between 4-15KHz (square wave).
Any suggestions or guidance would be greatly appreciated.
I was given this code as an example, but I'm not quite sure how to tailor it to my requirements.
Code:
test
clrwdt
clrf TMR0
clrf pulse_count
wait3
movlw d'200'
subwf TMR0, W
btfsc STATUS, C
goto time_up
btfsc GPIO, 3
goto wait3
wait4
movlw d'200'
subwf TMR0, W
btfsc STATUS, C
goto time_up
btfss GPIO, 3
goto wait4
incf pulse_count, F
goto wait3
time_up
movlw d'3'
subwf pulse_count, W
btfss STATUS, C
goto test
movlw d'9'
subwf pulse_count, W
btfsc STATUS, C
goto test
So I would like the relay to come on to a signal like this....
Last edited: