In previous projects I have manged to do multiplication and division wiith 31bit numbers as described elsewhere on this site. However I now have a requirement to calculate the data string required to be sent via SPI to a DDS synthesiser. The frequency control data is a 32 bit string (4 bytes) calculated from the required frequency in MHz. The number to be sent is calculated from
f = n X 180 / 2^32
or
n = f * 2^32 /180
where f can be anything up to 70.000000 MHz in 1Hz (0.000001 MHz) steps.
The numbers look huge, particularly when in integer form! What is likely to be the best approach to this calculation (using a 20X2)?
Thanks
Dick
f = n X 180 / 2^32
or
n = f * 2^32 /180
where f can be anything up to 70.000000 MHz in 1Hz (0.000001 MHz) steps.
The numbers look huge, particularly when in integer form! What is likely to be the best approach to this calculation (using a 20X2)?
Thanks
Dick