Microcontroller › 8051 › Stopwatch using 8051 microcontroller (AT89C51)
- This topic has 6 replies, 2 voices, and was last updated 13 years, 9 months ago by G Thomas.
-
AuthorPosts
-
March 1, 2011 at 10:08 am #765G ThomasParticipant
RE: http://www.engineersgarage.com/microcontroller/8051projects/stopwatch-AT89C51-circuit
Dear guys,
I have built this circuit (with AT89S52) but have the following problems:
Problem 1.
when I press the start and stop button…. the time jumps an extra second on the LED display.
Problem 2.
when i compare the time measurement to an actual stopwatch it seems to lag a few seconds behind (as in just press start on both at same time and compare time without stopping)
Problem 3.
When powering up the circuit I have to switch the power supply on and off numerous times before I sucessfully get “000” diplayed on led. Other wise i get random displays, no display, etc. any ideas why?
Question 1.
Is this because I’m using a slightly different microcontroller?
Question 2.
I would also like to display max 9 seconds and rest miliseconds accurately instead of current setup. any help on coding will be great!
Question 3.
How would I go about interfacing this cuircuit with my computer ( i need the recorded times displayed on comp too)
Question 4.
Can i connect 2 microcontrollers recording two sperate times to one parralle port? If os how do I do that?
Question 5.
Possible to have 1. start button, two sperate stops (with 2 separate led displays) on ONE mircocontroller?
THANK YOU SOO MUCH….
time and help greatly appreciated to any of help/ questions….
Look forward to hearing from you.
Thank you!
March 2, 2011 at 11:02 am #5651AnonymousGuestI studied your problems and concluded that……
the problems you are facing are not due to controller you are using but due to polling used in the code, the timedelay used are not exactly of one sec.
when you press the start and stop button…. the time jumps an extra second on the LED display because there in no interrupt used so condition to stop is checked every after one second eg if at time 1.2 sec you press the stop button it will complete 2 sec and then display the time.
Instead of again and again switching the power supply on and off numerous times before you sucessfully get “000” diplayed on led you can use reset to reset the controller through 9th pin of controller(make it high to reset).
you can configure timer to get excat time for your stopwatch. through u will even get precise time in msec.
you can interface your circuit to computer by serial port or usb, but serial port is preferred as it is easy to configure and use.
you can connect two controller directly connecting the ports and connecting start pin of both controller to one switch you can have one switch for start
use interrupt pin for start and stop button.
links for timer:-
http://www.engineersgarage.com/tutorials/timers-8051-timer-programming-tutorial
http://www.engineersgarage.com/microcontroller/8051projects/countdown-timer-using-AT89C51-circuit
link for serial port:-
March 2, 2011 at 3:01 pm #5653G ThomasParticipantThank you very much for your time and reply. I will work on your point and see how it goes.
Once again, Thank you!!!
March 9, 2011 at 9:47 am #5688G ThomasParticipantThanks for reply.
Quick question how would I go about doing this?:
“ Instead of again and again switching the power supply on and off numerous times before you sucessfully get “000” diplayed on led you can use reset to reset the controller through 9th pin of controller(make it high to reset).”
Sorry just a novice at this!
March 9, 2011 at 3:46 pm #5690AnonymousGuestwell we know that 9th pin of controller is reset pin when we do it high controllerget reset…..
so connect a switch to that pinMarch 14, 2011 at 7:00 am #5735G ThomasParticipantthank you for your time.
would appreciate help on how to do this:
you can configure timer to get excat time for your stopwatch. through u will even get precise time in msec.
use interrupt pin for start and stop button.
March 14, 2011 at 7:49 am #5738G ThomasParticipantthanks for you time. sorry but i am newbie at all this. thanks
-
AuthorPosts
- You must be logged in to reply to this topic.