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.

Looking for a code for 2 microsecond delay using the interrupt based timer2

Status
Not open for further replies.

tamoor_tariq

Newbie level 4
Joined
Jul 1, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pakistan
Activity points
1,308
Actually i want to get the code for the 2microsecond delay usiing the interrupt based timer2, please do help me, thanks;:cry:
 

Re: 2microsecond delay

waht controller? what clock frequency ?

srizbf
1stjuly2010
 

Re: 2microsecond delay

Actually i want a 2microsecond delay code using interrupt based programming with the 1MHz internal crystal for the atmega32 on the CODEVISION,
I already have the code for the 250ms delay for atmega32 but i am new to atmega32 programming so don't know how to set that code for the 2microsecond delay
regards:|

CODE FOR 250ms DELAY

void set_timer2(){
ASSR = 0x00;
TCCR2 = 0x07;
TIFR = (TIFR | 0xC0);
OCR2 = 1;
while(ASSR & 0x02);
}//set_timer2()




set_timer2();
TIMSK = TIMSK | 0x80;
SREG = SREG | 0x80;
 

Re: 2microsecond delay

from where u got that 250msec delay code??
and guess what?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top