dear friends
i have written following programm
for delay why it is not working.
my clock speed is 4Mz and and want use it for LCD display delays
void waitMS(unsigned long ulMS)
{
CLI(); // disable all interrupts
ulTick = ulMS;
SEI(); // re-enable interrupts
while (ulTick>0);
}
void timer1_init(void)
{
TCCR1B = 0x00; //stop
TCNT1H = 0xC6; //setup
TCNT1L = 0x67;
OCR1AH = 0x39;
OCR1AL = 0x99;
OCR1BH = 0x39;
OCR1BL = 0x99;
ICR1H = 0x39;
ICR1L = 0x99;
TCCR1A = 0x00;
TCCR1B = 0x01; //start Timer
}
// TIMER1 has overflowed
#pragma interrupt_handler timer1_ovf_isr:10
void timer1_ovf_isr(void)
{
TCNT1H = 0xC6;
TCNT1L = 0x67;
if (ulTick > 0)
ulTick--;
}
On Fri, 24 Feb 2006 Zack Widup wrote :
>There should be enough data in the AVR data sheet to do that. And there
>should be examples at the AVRFreaks website, if not at the Atmel website
>itself, on doing that.
>Zack
>On Fri, 24 Feb 2006, kishorbande wrote:
>> dear freinds
>>
>> i am using this controller from last 6 months.
>> i am want to generate accurate 1 sec and 1milisec delay routines.
>> i am using imagecraft c cross compiler.
>> please help me.
>>
>> regards
>> kishor
>>
>SPONSORED LINKS
>Atmel avr
>Microcontrollers
>Intel microprocessors
>Pic microcontrollers
>YAHOO! GROUPS LINKS
> Visit your group "
>AVR-Chat
>" on the web.
>
> To unsubscribe from this group, send an email to:
>
>AVR-Chat-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the
>Yahoo! Terms of Service
>.
Message
Re: Re: [AVR-Chat] Help needed on ATMEGA128 AND TIMER0
2006-02-25 by kishor lalu bande
Attachments
- No local attachments were found for this message.