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: Markus Hitter
Subject: Re: what are the correct high/low maximums for _delay_ms()/_delay_us()
Date: Mon, 27 Jan 2020 15:13:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Am 23.01.20 um 23:25 schrieb Joerg Wunsch:
> 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.

For a calibrated busyloop see

https://github.com/Traumflug/Teacup_Firmware/blob/master/delay-avr.c

Accuracy is described in comments there.


Markus

-- 
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.jump-ing.de/



reply via email to

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