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;