Hi,
I will be diving down the rabbit hole of DSP on an MEGA644A. I see it has fractional multiplication capabilities, but can I use them in C? Or do I have to do it in assembly? Are there any examples of how to do this?
Thanks!
Hi,
I will be diving down the rabbit hole of DSP on an MEGA644A. I see it has fractional multiplication capabilities, but can I use them in C? Or do I have to do it in assembly? Are there any examples of how to do this?
Thanks!
I forget when it was added exactly but sometime from about avr-gcc 4.8 onwards it gained fixed point:
https://gcc.gnu.org/wiki/avr-gcc...
So if you have 4.8, 4.9 or 5.0 then you should find this supported and "under the hood" I think you are going to find it is implemented using FMUL.
I should add that I am using Studio 6 for coding. It would be nice if the compiler supported fixed point variables and operations.
--tr
According to Cliff, it does support fixed point.
Jim
Yup, as Jim says I just told you thta 4.8 onwards has fixed point support. Studio 6.2 has GCC 4.8.1 so you have it.
See:
https://gcc.gnu.org/onlinedocs/g...
You may want to inspect the asm that generates to verify that FMUL etc are in use.