Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How do I access a timer in picbasic?

Status
Not open for further replies.

bradle95

New Member
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
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top