I am using pbc to try to read a shaft frequency. I have a working counter, but I need to be able to time this. How do I access the wdt? I though that I would use the following...
symbol tmr, 1 'set tmr as variable for register 1 (wdt)
symbol seconds
poke tmr, 0 'set the timer at zero
start:
if trm >= 100 then increment 'maybe not 100, but at a set value
goto start
increment:
second = second + 1 'increment the seconds
poke tmr, 0 'set timer back to zero
goto start 'repeat
end
symbol tmr, 1 'set tmr as variable for register 1 (wdt)
symbol seconds
poke tmr, 0 'set the timer at zero
start:
if trm >= 100 then increment 'maybe not 100, but at a set value
goto start
increment:
second = second + 1 'increment the seconds
poke tmr, 0 'set timer back to zero
goto start 'repeat
end