Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] 2 7-segment display in proteus

Status
Not open for further replies.

fawadbutt

Member level 3
Joined
Oct 29, 2010
Messages
61
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Lahore, Pakistan, Pakistan
Activity points
1,754
hi i write the code 2 seven segment code in C,
i test on proteus 6.9,
fluctuating in display,
i m use
for(a=0;a<1275;a++)for(b=0;b<5;b++);
timing.
plz solve my proble.
 

hi!

i do not understand what you mean! if you need a delay use delay_ms(miliseconds) function!
 

i m use keil ,
i m using for loop for delay,
i mean that what i use proper function to 2 digit can be still display?
and thanx for replay!
 

For delay in Keil you can use for functions for the delay sub routine.
Here is an eg:

char i;
for(i = 0;i< 1000;i++);

The no: of time you increase the value of 'i',the delay will be that much longer.
Regards,
Jerin. ;-)
 

hi !

char i; is not good because is 8 bits values (max 255) ! you need to use a integer type !
 

If you are using MikroC compiler,
then write the code,
Delay_ms(1000); to get 1 sec delay.
Else you'll have to calculate the no: of times the for loop have to be executed to get a period of 1 sec as explained above.
Regards,
Jerin. ;-)
 

Hi fawadbutt,
In mikroC, it'd go like:
Code:
   delay_ms(1000);
In keil, I don't know about the library functions.
As for for...loop,
With XTAL freq=10MHz,
Code:
void MSDelay(unsigned int itime)
{
   unsigned int i; unsigned char j;
   for(i=0;i<itime;i++)
      for(j=0;j<165;j++);
}

Now just call MSDelay(1000);

Hope this helps.
Tahmid.
 

The no: of times you call a for loop depend on the instruction speed of the controller i.e how much time it takes to execute 1 instruction. It may be in most probably us to ns range. So to get 1 second delay we have execute that much times the for loop instruction which is to found out by us. Tahmid has shown you one example of how to generate 1 sec delay with for loop.
Regards,
Jerin. ;-)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top