On 01/06/2011 08:00, William "Chops" Westfield wrote: >> > why waste my time with 'C' when assembler is just as good. > Well, the current example wants > M =3D (f0 * 232)/fc > Where f0 and fc are 32 bit numbers (some constant, some not.) That's > not particularly a line that I'd like to translate into assembler. (I > suppose it depends on how much access you have to a good set of > libraries...) (And then C will easily go low-level and let you > separate the bytes efficiently (one way or another), supporting my > first statement.) > Olin probably has such an assembler library and can write the entire DDS=20 app inc "GUI" with keypad, rotary encoder and graphic panel in a coffee=20 break. The rest of us would be better using C or JAL on 16F 232/fc is presumably a constant. f0 is the part that changes. fc is 50,000,000 fo is likely less than 150,000,000 232 =3D 4,294,967,296 You don't want to convert to floating or lose any resolution. Pre-calculating a constant 4,294,967,296/50,000,000 =3D 85.89934592, approx 86 as integer, loses too m= uch so it does need 64 bit int maths if you do (f0 * 232)/fc properly. This is= possible in C or JAL However if fo max is 150MHz then that is 1/28.63311530667 of 232 Or if fo =3D 30MHz max 1/ 143.16557653333333333333333333333 There isn't a way to scale to 32bit maths unless the frequency step is=20 integer multiple of scaling.. Minikits in Australia have a PIC kit with DDS chip premounted for this=20 kind of application. It's not very complicated. I've written a similar application in JAL that outputs in packed BCD via=20 serial to a radio rather than a DDS. http://www.minikits.com.au/kits4.html http://www.minikits.com.au/kits5.html#iqdds I'll probably do a PIC based DDS myself for the softrock RX/TX I have. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .