User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 427,225 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,221 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Programming Forums
Views: 1100 | Replies: 8
Reply
Join Date: Jul 2008
Posts: 1
Reputation: cinderella_nez is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cinderella_nez cinderella_nez is offline Offline
Newbie Poster

7 segment countdown from 99 with atmel 89s51??

  #1  
Jul 16th, 2008
HI all, I'm a newbie here. I need your help, does one of you know how is the code to countdown from 99 with 7 segment and atmel 89s51 or 89s52?
plz help me soon..
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2005
Posts: 3,639
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 22
Solved Threads: 418
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: 7 segment countdown from 99 with atmel 89s51??

  #2  
Jul 16th, 2008
I'm sure some of us do, but we're not likely to just give it to you just because you ask.
See the intro threads, we don't give free homework.
Show us what you've managed so far, and then we'll help you with the next step.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,779
Reputation: niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all 
Rep Power: 11
Solved Threads: 185
niek_e's Avatar
niek_e niek_e is offline Offline
Posting Virtuoso

Re: 7 segment countdown from 99 with atmel 89s51??

  #3  
Jul 17th, 2008
Why would you want to program it in assembly? AVR-studio can compile C for the 89s51. So the code would look like:
  1. char i;
  2. for (i=99; i >0; i--)
  3. {
  4. //write 'i' to 7-seg
  5. }
Without knowing how you connected everything, that's all I can tell you
Want better/more replies to your questions? Wrap your code in [code] [/code] tags!
do NOT pm me for help, in the best case, you'll get ignored
Reply With Quote  
Join Date: Sep 2006
Posts: 273
Reputation: Colin Mac is on a distinguished road 
Rep Power: 3
Solved Threads: 17
Colin Mac Colin Mac is offline Offline
Posting Whiz in Training

Re: 7 segment countdown from 99 with atmel 89s51??

  #4  
Jul 17th, 2008
Create a variable for units and a variable for tens.
Decrement the units variable, then pass each to a subroutine which checks its value and sends out the particular code. If the units variable is zero, it becomes nine and decrement the tens variable.
Reply With Quote  
Join Date: Dec 2005
Posts: 3,639
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 22
Solved Threads: 418
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: 7 segment countdown from 99 with atmel 89s51??

  #5  
Jul 17th, 2008
Meh, methinks you're wasting your fingers, since they've probably gone looking for free food elsewhere rather than actually risk learning something.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Aug 2008
Posts: 5
Reputation: binu_ji is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
binu_ji binu_ji is offline Offline
Newbie Poster

Re: 7 segment countdown from 99 with atmel 89s51??

  #6  
Aug 2nd, 2008
Connect 2 seven segment displays on P0 & P2.
Initialize the R0 & R1 registers to 0.
Increment count for every second.
Use this circuit for Count down timer with AT89C2051
count.GIF
For More details visit my website
Reply With Quote  
Join Date: Sep 2006
Posts: 273
Reputation: Colin Mac is on a distinguished road 
Rep Power: 3
Solved Threads: 17
Colin Mac Colin Mac is offline Offline
Posting Whiz in Training

Re: 7 segment countdown from 99 with atmel 89s51??

  #7  
Aug 2nd, 2008
The AT89C2051's output drops to 2.4V when it's output high is only 80uA. The base current of Q2 will never reach 1.9mA. The chip sinks 20mA so PNP transistors should be used.
Last edited by Colin Mac : Aug 2nd, 2008 at 9:00 am.
Reply With Quote  
Join Date: Aug 2008
Posts: 5
Reputation: binu_ji is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
binu_ji binu_ji is offline Offline
Newbie Poster

Re: 7 segment countdown from 99 with atmel 89s51??

  #8  
Aug 2nd, 2008
Thats a Good point, because 8051 micros drive the load only to ground.
In my circuit i have given pull up resistors for the pins which goes to the base of the transistors. So that the transistor works fine for me.
Anyway thanks for your advice, i will implement it and come back.
Reply With Quote  
Join Date: Aug 2008
Posts: 42
Reputation: abhisdm is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
abhisdm abhisdm is offline Offline
Light Poster

Re: 7 segment countdown from 99 with atmel 89s51??

  #9  
Aug 4th, 2008
Prepare a look up table for 7 segment display for numbers 0 to 9.. make use of two 7-seg LED's and , get the count number to be displayed , and display the digits with help of look up table...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Assembly Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Assembly Forum

All times are GMT -4. The time now is 11:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC