can anybody help me in writing delay routine for ARM

Status
Not open for further replies.

tashu

Newbie level 4
Joined
Jul 19, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
delay program for ARM????????????????
 
Last edited by a moderator:

Re: can anybody help me in writing........................................... .......

try this out - with number x to be of your interest in the code

Code:
Void delay( unsigned char x)
{
unsigned char i=0x00;
for(i=0x00;i<x;i++)
{
}

}

Good Luck
 
Reactions: tashu

    tashu

    Points: 2
    Helpful Answer Positive Rating
Re: can anybody help me in writing........................................... .......

Actually the proper way to apply accurate delay is by using timers.
honey 77 has provided an example of that targeted to a CortexM based cpu (he has deleted the post apparently) but the problem is that the OP has not provided enough info on the mcu he intends to use, vendor and model

For a generic delay milind.a.kulkarni routine would work but you can never be sure of the delay you'll get after the code gets compiled.
I would add that a volatile variable should be used for the loop to make sure that the compiler doesn't optimize (remove) the loop
 

Re: can anybody help me in writing........................................... .......

thank you sir.....

- - - Updated - - -

thank you sir.....
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…