Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |    AVR    |    PIC    |    8051    |    Electronic Projects

Stopwatch using 8051 microcontroller (AT89C51)

7 posts / 0 new
Last post
G Thomas
s_g_tom's picture
Offline
Joined: 27/01/2011
Posts: 31
Points: 9650
Stopwatch using 8051 microcontroller (AT89C51)

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!

 

Himanshu Choudhary (not verified)
Himanshu Choudhary's picture

I 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:-

http://www.engineersgarage.com/microcontroller/8051projects/interface-serialport-RS232-AT89C51-circuit 

G Thomas
s_g_tom's picture
Offline
Joined: 27/01/2011
Posts: 31
Points: 9650

Thank you very much for your time and reply. I will work on your point and see how it goes.

 

Once again, Thank you!!!

G Thomas
s_g_tom's picture
Offline
Joined: 27/01/2011
Posts: 31
Points: 9650
Thanks 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!
Himanshu Choudhary (not verified)
Himanshu Choudhary's picture
well we know that 9th pin of controller is reset pin when we do it high controllerget reset.....
so connect a switch to that pin 
G Thomas
s_g_tom's picture
Offline
Joined: 27/01/2011
Posts: 31
Points: 9650

thank 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.


G Thomas
s_g_tom's picture
Offline
Joined: 27/01/2011
Posts: 31
Points: 9650
thanks for you time. sorry but i am newbie at all this. thanks
Login or register to post comments