8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
matlark
Sun Jun 01 2008, 05:02AM
 User Offline
Registered Member #8184
Joined: Sun Jun 01 2008, 04:53AM

Posts: 3
Thanked 0 times in 0 posts
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

Back to top


Ajay
Sun Jun 01 2008, 08:11PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3303
Thanked 611 times in 578 posts
use Timers with prescaler for dividing the clock.

Its easy to make a stop watch with approximate accuracy in PIC.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


matlark
Sun Jun 01 2008, 10:50PM
 User Offline
Registered Member #8184
Joined: Sun Jun 01 2008, 04:53AM

Posts: 3
Thanked 0 times in 0 posts
Would it be best to use Timer1 over Timer0 or does it not matter which timer I use? Any other advice?
thanks
Back to top


Ajay
Sun Jun 01 2008, 10:59PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3303
Thanked 611 times in 578 posts
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..

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


matlark
Sun Jun 01 2008, 11:12PM
 User Offline
Registered Member #8184
Joined: Sun Jun 01 2008, 04:53AM

Posts: 3
Thanked 0 times in 0 posts
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
Back to top


Ajay
Sun Jun 01 2008, 11:48PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3303
Thanked 611 times in 578 posts
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.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems