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

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am