matlark
Jun 1 2008, 5:02 AM
I need to design a stopwatch that counts to 99.99 using 8 led's in a row (number will be displayed in BCD). I was thinking that I would utilize the OSCCON reg to slow down the clock speed but I am having trouble coming up with how I need to divide the frequency.
Any ideas are welcome. thanks
Any ideas are welcome. thanks
Ajay
Jun 1 2008, 8:11 PM
use Timers with prescaler for dividing the clock.
Its easy to make a stop watch with approximate accuracy in PIC.
Its easy to make a stop watch with approximate accuracy in PIC.
matlark
Jun 1 2008, 10:50 PM
Would it be best to use Timer1 over Timer0 or does it not matter which timer I use? Any other advice?
thanks
thanks
Ajay
Jun 1 2008, 10:59 PM
I really doesn't matter you which timer you are using. but the important thing is... is that timer capable of generating the time delay you need..
matlark
Jun 1 2008, 11:12 PM
I am having trouble coming up with how I need to break the timer up. If I use maximum prescale so that I have approx 3906.25 instructions per second. How do I implement that to the stopwatch? I am thinking I need to utilize a postscale of some value and mayble slow down the internal clock using OSCCON.
thanks
thanks
Ajay
Jun 1 2008, 11:48 PM
I think you are getting me wrong
prescaler will only divide the clock input of timer not the CPU, cpu will execute the instructions normally where as the increment of timer value will be according to the clock frequency you set using prescaler.
Take a close look at the timer chapter of PIC 16F887 datasheet.
prescaler will only divide the clock input of timer not the CPU, cpu will execute the instructions normally where as the increment of timer value will be according to the clock frequency you set using prescaler.
Take a close look at the timer chapter of PIC 16F887 datasheet.