Discussion in "PIC Microcontroller Discussion" started by    matlark    Jun 1, 2008.
Sun Jun 01 2008, 05:32 pm
#1
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
Mon Jun 02 2008, 08:41 am
#2
use Timers with prescaler for dividing the clock.

Its easy to make a stop watch with approximate accuracy in PIC.
Mon Jun 02 2008, 11:20 am
#3
Would it be best to use Timer1 over Timer0 or does it not matter which timer I use? Any other advice?
thanks
Mon Jun 02 2008, 11:29 am
#4
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..
Mon Jun 02 2008, 11:42 am
#5
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
Mon Jun 02 2008, 12:18 pm
#6
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.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Richardgar
Sat Apr 20 2024, 11:05 am
AntoniaRoons
Fri Apr 19 2024, 09:59 pm
carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am