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.

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!
 

penoy_balut

Full Member level 2
Joined
Sep 8, 2007
Messages
148
Helped
26
Reputation
52
Reaction score
10
Trophy points
1,298
Activity points
1,943
its the system clock determines duration, for accurate delays use timer interrupt and put your mcu in halt mode or execute other routine
 
Joined
Sep 3, 2007
Messages
853
Helped
66
Reputation
132
Reaction score
16
Trophy points
1,298
Activity points
0
Yes,
Interrupts are better since you can perform other operation while waiting. It is also permit to reduce the power consumed while doing nothing.
 

ndru_w

Member level 1
Joined
Oct 2, 2007
Messages
39
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,288
Activity points
1,490
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top