Continue to Site

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.

Precise Delay AVR ATmega8535

Status
Not open for further replies.

Don_dody

Full Member level 1
Full Member level 1
Joined
Nov 4, 2012
Messages
96
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Indonesia
Visit site
Activity points
1,921
How to make a precise and accurate delay by using timer instead of using
#include <delay.h> ??

Is there any example of codes as simple as blinking LED with precise delay maybe ?

Thank you...
 

For 'precise' you could consider using a crystal oscillator or better.
There are in-built timer modules on many microcontrollers, where you can program them to cause an interrupt
once the timer has overrun or reached a value.
However, if you think about it, using a 'delay loop' is just as precise too, assuming you have figured out how many clock cycles
each instruction will take. Why should it be less precise?
Given that you just want to blink an LED, it hardly matters if you're using a crystal, or a ceramic
resonator or an in-built oscillator. You won't be able to visually spot any change in value due to
temperature, aging, etc.
 

I'm using 12 MHz crystal. Well do you have any example of codes related with delay using timer/counter?

I just read some articles and I prefer to use timer. I already know how to activate it but somehow I cannot implement it to generate a delay, let say 5 seconds. Do you know how?

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top