Discussion in "Software" started by    vijay    Jan 5, 2012.
Thu Jan 05 2012, 02: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, 04: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

Mon Aug 25 2014, 07:12 AM
Vinod Soni
Hi Sir, How can i make this RFID with ATMega16/32 controller
pavanjain
Sat Aug 23 2014, 05:10 AM
Sir i want to download the hex file in P89v51rd2 microcontroller using max232 IC but we not load the program in IC
Tue Aug 19 2014, 04:51 PM
allen ndumu
please i will like to know if the problem of speed control of dc motor using keypad and l298 was if yes can i have the complete project send it to the address i really need to see it
Tue Aug 19 2014, 10:47 AM
Amit Bisht
sir i want to have some trending projects on which i could work related to ATmega 16 microcontroller
ExperimenterUK
Sat Aug 16 2014, 04:16 PM
@diligent . create a thread
Sat Aug 16 2014, 03:17 PM
diligent
in assembly langauage programming..
Sat Aug 16 2014, 03:14 PM
diligent
will anyone help me?
Thu Aug 14 2014, 10:24 PM
Amirudin Tone
i help, i need liberary IC 4047 in the proteus. thanks
ExperimenterUK
Thu Aug 14 2014, 03:59 PM
@NARAYANA are you getting an error ?
Tue Aug 12 2014, 11:47 PM
NARAYANA
i am not able to get reg please provide me registration link

Downloads

Comments

enisi
Wed Aug 27 2014, 06:08 AM
sadalakshmi
Wed Aug 27 2014, 12:39 AM
Paecake
Sun Aug 24 2014, 04:07 PM
pavanjain
Sat Aug 23 2014, 02:33 AM
samchovatiya
Thu Aug 21 2014, 02:30 PM
hasmukhjain
Wed Aug 20 2014, 06:28 AM
rablo
Tue Aug 19 2014, 10:10 AM
faizhameed
Tue Aug 12 2014, 10:39 PM

Online

Guests: 35, Members: 0 ...

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

Members: 37501
Newest member: enisi
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:59 PM
Your board has two serial ports, are you connectin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:45 PM
In your TX code I see where you set payload width ...
enisi Avatar
Posted By enisi
Wed Aug 27 2014, 07:05 AM
It can be more than one ansawer correctly
enisi Avatar
Posted By enisi
Wed Aug 27 2014, 06:57 AM
Port 0 is connected indicator 7 segments, so that ...
siddique Avatar
Posted By siddique
Wed Aug 27 2014, 01:48 AM
Pls check the Tx and Rx functions have made some c...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Aug 26 2014, 06:03 PM
I assume you have made the changes I suggested to ...
siddique Avatar
Posted By siddique
Tue Aug 26 2014, 03:20 AM
Hi,Tried your suggestions.when i put the device in...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Aug 25 2014, 04:00 PM
This tutorial looks useful.http://www.diyembedded....
siddique Avatar
Posted By siddique
Mon Aug 25 2014, 03:30 AM
Hi,I'm currently working on the nRF24L01+ transcei...
gaurav7577 Avatar
Posted By gaurav7577
Mon Aug 25 2014, 12:38 AM
Code which is already loaded is running fine...but...