Countdown Timer using AT89S51

Thread Starter


Joined Oct 30, 2008
Hi guys.
Im new to assembly programming.
I want to do a countdown timer using AT89S51.
So,i need u guys help.

Here how the hardware goes:
1)Double 7 segment to show the countdown time.
2)A buzzer that will beep once a second from the countdown starts till ends.
3)A switch to start the timer and a switch to Reset the timer.
4)2 switch to set the duration(A switch for x10 increment and a switch for x1 increment)
5)A switch to select between minutes and seconds.
6)2 outputs to relays.
7)An indicator to show minutes or seconds(LED or 7 segment)

And if possible,i want the timer or the 7 segment to go to the sleep mode after the countdown ends.All switches is push button type.

I dont know how to write the program in ASM.So anyone can help me with the programming?



Last edited:


Joined Feb 17, 2010
You have to refer to the at89s manual for timer functions, as the timer functions (especially programmed with assembly) is to difficult to learn by scratch trough a forum thread. By the way, your ULN transistor array is placed reversed? The digital/low current signal goes from left to right. Also, why use a an array of 8 darlington transistors, when you can use much cheaper 2x regular darlington transistors?

And I don't think your buzzer will buzz by digital signal alone, you should amplify it through one of the 6 free lines on the ULN.