Discussion in "Software" started by    vijay    Jan 5, 2012.
Thu Jan 05 2012, 07:56 AM
#1
frnds i type this code for generate 1 second delay but it goes to infinite....why?


#include<reg51.h>
void todelay(void);




void main (void)
// timer for 1 second
{
while(1)

todelay();


}






void todelay()
{
TMOD=0x01;

TL0=0xfc;
TH0=0x4b;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;


}


Thu Jan 05 2012, 09:36 AM
#2
@ vijay.parmar1992
in while(1) loop u only call the delay function that is why it is seems to infinite
u can also use this delay

void delay_ms (unsigned int count)
{
unsigned int i;                          
while(count) 
{
i = 115;
while(i>
0) i--;
count--;
}
}


delay_ms(1000); means 1 sec delay

Get Social

Information

Powered by e107 Forum System

Conversation

ajay_bhargav
Mon Mar 23 2015, 04:22 AM
You can only simulate simple 8051. RD2 support is not there in proteus. However there are similar atmel varient which can be used instead.
Sun Mar 22 2015, 07:24 PM
Aryan Nath
How can i Simulate microcontroller project in Proteus that uses P89V51RD2
Thu Mar 19 2015, 02:45 PM
Peter Mann
I have tried to register on the site, but it keeps saying I've entered two different email adresses - but I haven't!
ajay_bhargav
Sun Mar 15 2015, 08:25 PM
I did not get new message indication.. strange..
ExperimenterUK
Sun Mar 15 2015, 08:18 PM
slight delay, my connection failed
ajay_bhargav
Sun Mar 15 2015, 08:08 PM
Atleast you chat on our website if not anywhere else
ajay_bhargav
Sun Mar 15 2015, 08:08 PM
Hi Phil..
ExperimenterUK
Sun Mar 15 2015, 08:05 PM
Hi Ajay
gsdvprasad
Fri Mar 13 2015, 04:20 PM
Can you help me how to change the text on led display in proteus simulation?
ajay_bhargav
Sat Mar 07 2015, 07:48 AM
@Shoukat, its general purpose PCB board for soldering components

Downloads

Comments

harix
Sun Mar 29 2015, 07:11 PM
marti
Fri Mar 27 2015, 03:07 PM
iamalien
Thu Mar 26 2015, 07:27 AM
Ankit30
Wed Mar 25 2015, 02:35 PM
wai1023
Wed Mar 25 2015, 06:27 AM
StrangerDanger
Tue Mar 24 2015, 12:40 PM
vinayas9
Tue Mar 24 2015, 09:26 AM
ganesh1991
Tue Mar 24 2015, 08:22 AM

Online

Guests: 42, Members: 2 ...
iamalien viewing forum.php
ajay_bhargav viewing download.php

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37611
Newest member: harix
Forum Activity
iamalien Avatar
Posted By iamalien
Sun Mar 29 2015, 07:25 PM
i am using at89s52 i guess it is only isp not iap,...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sun Mar 29 2015, 07:22 PM
Ianalien is right. But you can do this without usi...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sun Mar 29 2015, 07:19 PM
EEPROM can be changed at runtime. Program memory c...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sun Mar 29 2015, 07:11 PM
We have digital clock project with 4 line lcd. It ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sun Mar 29 2015, 07:07 PM
It may be possible that interrupt pin may be used ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Sun Mar 29 2015, 06:58 PM
As per majoka, if you have installed the crack pro...
iamalien Avatar
Posted By iamalien
Sat Mar 28 2015, 04:48 AM
To answer it as vaguely as the question, you just ...
iamalien Avatar
Posted By iamalien
Sat Mar 28 2015, 04:27 AM
i thought that lighting led for more times should ...
mayank058 Avatar
Posted By mayank058
Fri Mar 27 2015, 06:46 AM
Dear Sir, I am working on MCB2300. I...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Mar 26 2015, 09:06 PM
Have a look through the list of projects in our do...