The time to run a loop in the microcontroller

Status
Not open for further replies.

grassflying

Newbie level 5
Joined
Apr 21, 2007
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,334
I am programming a delay function using ARM7. I simply use a while loop to waste the time. Which clock speed determines the time to run a loop in the microcontroller? Thanks!
 

its the system clock determines duration, for accurate delays use timer interrupt and put your mcu in halt mode or execute other routine
 
Yes,
Interrupts are better since you can perform other operation while waiting. It is also permit to reduce the power consumed while doing nothing.
 
Hi,
You can also write this delay in assambler. There you have exact timings (you should find how much cycles takes execution of each command in the documantation).
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…