> The other issue that comes into play is rounding itself.
> For example, there are 3 ways to round cycles.
> - up (delay is always *at least* as long as requested)
> - down (delay is closest as possible without going over but can be worst
> case
> nearly 1 cycle shorter than requested)
> - closest (picks closest cycle which could round up or down)
>

In all of the places that I've used delays, I'd always want them to error on
the side of being a cycle to long, than any amount of to short.

Just for completeness, here is a summary of rounding methods:

http://www.pldesignline.com/showArticle.jhtml?articleID=189600747

    * Round-Toward-Nearest
    * Round-Half-Up (Arithmetic Rounding)
    * Round-Half-Down
    * Round-Half-Even (Banker's Rounding)
    * Round-Half-Odd
    * Round-Ceiling (Positive Infinity)
    * Round-Floor (Negative Infinity)
    * Round-Toward-Zero
    * Round-Away From-Zero
    * Round-Up
    * Round-Down
    * Truncation (Chopping)
    * Round-Alternate
    * Round-Random (Stochastic Rounding)
    * Sign-Magnitude Binary Values
    * Rounding Signed Binary Values

-- 
http://blog.softwaresafety.net/
http://www.designer-iii.com/
http://www.wearablesmartsensors.com/
_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to