avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what are the correct high/low maximums for _delay_ms()/_delay_us()


From: Joerg Wunsch
Subject: Re: what are the correct high/low maximums for _delay_ms()/_delay_us()
Date: Thu, 23 Jan 2020 23:25:23 +0100

As Britton Kerin wrote:

> I guess the high-res maximums are 262.14 ms / F_CPU in MH for
> _delay_ms() and 768 us / F_CPU in MHz for _dalay_us() regardless of
> the availability of __builtin_avr_delay_cycles(), but
> the way the _delay_ms() and _delay_us() descriptions are written this
> is not entirely clear.  Am I correct?

I think you are.  They work beyond that now (has not always been the
case) but lose a bit of accuracy/resolution.

However, for the usual LED "I want 1 Hz" flasher, it's OK to have two
_delay_ms(500) calls between turning the LED on and off.

-- 
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]