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:
 

srizbf

Advanced Member level 5
Joined
Apr 3, 2010
Messages
1,995
Helped
417
Reputation
840
Reaction score
328
Trophy points
1,363
Activity points
10,985
Re: 2microsecond delay

waht controller? what clock frequency ?

srizbf
1stjuly2010
 

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
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;
 

hameeds01

Advanced Member level 2
Joined
Aug 23, 2005
Messages
599
Helped
75
Reputation
156
Reaction score
41
Trophy points
1,308
Location
Islamabad Pakistan
Activity points
4,540
Re: 2microsecond delay

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

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top