PDA

View Full Version : Timer on 16F84



matth
- 28th April 2005, 00:14
Is it possible to use the Timer0 module on the 16F84 with Picbasic or is that only an assembler thing?

Matt

mister_e
- 28th April 2005, 02:04
everything is possible. If you tell us what you want to do with, we can give you some idea.

matth
- 28th April 2005, 05:27
I want the timer to keep track of my 1 second interval. I want to generate a ~120 microsecond pulse precisely every second or pretty close. The 1 second is pretty critical while the 120 microsecond is not that critical. I am thinking using the built in timer would keep it accurate despite any other minor overhead I have. I would like to use the 16F84 since I have a handful of them anyway. Perhaps its timers are not up to this task. I do not see much reference to using the timers in the Picbasic manual. I only have Picbasic standard. Perhaps I need Pro.

Matt

mister_e
- 28th April 2005, 05:32
hi matt, wwhat else the PIC will do. By using Timer and/or Timer interrupts you'll have to ensure that other statement will not take to much time to be executed to be sure to get every timer interupts.

Is the project is battery powered or you can acces to an AC signal line?

matth
- 28th April 2005, 05:47
It will need to be battery backed so no AC. It will not likely be working very hard. I almost think if the timer could free run in background and I just looked at it every so often that would likely work. My thinking is the timer is setup to roll over at 1 second and start over and I just watch it from my code. Just keep reading and recording its value and when I notice it rolled back to zero or past I need to do my pulse thing. I just have no idea how to work with the timers.

Matt