AVRfix: Fixed Point Math on the AVR Platform
When applications need sophisticate mathematical operations on microcontrollers which only support integer arithmetics, floating point emulation is often too expensive and unnecessary. A fixed point library features faster operation than floating point emulation while being more accurate than integer arithmetics. This work is especially designated for use with the TTP/A protocol respectively an implementation of it for Atmel 8-bit microcontrollers which needs exclusive access to several registers. Because of that, precompiled libraries which normally would be used, are not sufficient. In this work, we cover general fixed point arithmetics as well as the specific implementation of basic and advanced arithmetic operations in reference to the ISO/IEC paper DTR 18037. Because microcontrollers do not offer huge amounts of neither space nor clock rate, small code size and short runtime is a main concern of this work.
It is shown that hardware limits complexity of the library and optimization for specific hardware is necessary, even if the library implements only essential mathematical functions. Further it is shown, that on the given platform, values bigger than 32 bits raise the effort of management and calculations in a disproportionate manner.
This project is the result of a Bachelor's Thesis by Maximilian Rosenblattl and Andreas Wolf, done at the Insitute of Technical IT, Real-Time Systems Group of the Vienna University of Technology. The thesis is available at the project's download section, where you can find the library too.