need help with direct digital synthesizer
IanM
Posts: 40
I'm looking to cut just one instruction from the following code to get down to 7 so that it can run on 7 cogs and have a free cog for control. The code implements a pipelined DDS with an equivalent clock of 20MHz:
If I dispense with "test" as a means of exiting gracefully, then there are 7 instructions but i'll need to stop the cogs manually. That might not be a problem but I'm planning on driving the clock input of another prop and it might not like a big change in phase on it's clock input! So i'm looking for a gracefull way of exiting in 7 (or fewer) instructions.
Cheers, Ian
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ian Mitchell
www.research.utas.edu.au
.ddsloop movs tabi,tmp add acc,phase mov tmp,acc shr tmp,#24 'get the high byte .tabi mov outa,0-0 mov outa,#0 'allow other cogs access test ina,mask wz 'time to exit? ifz jmp #ddsloop .mask long $10000000 'bit to exit on .acc long 0 'set up at init .phase long 0 'set up at init .tmp long 0
If I dispense with "test" as a means of exiting gracefully, then there are 7 instructions but i'll need to stop the cogs manually. That might not be a problem but I'm planning on driving the clock input of another prop and it might not like a big change in phase on it's clock input! So i'm looking for a gracefull way of exiting in 7 (or fewer) instructions.
Cheers, Ian
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ian Mitchell
www.research.utas.edu.au
Comments
So:
.ddsloop movs tabi,tmp
add acc,phase
mov tmp,acc
shr tmp,#24 'get the high byte
.tabi mov outa,0-0
mov outa,#0 'allow other cogs access
test ina,mask wz 'time to exit?
movs tabi2,tmp
add acc,phase
mov tmp,acc
shr tmp,#24 'get the high byte
.tabi2 mov outa,0-0
mov outa,#0 'allow other cogs access
ifz jmp #ddsloop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ian Mitchell
www.research.utas.edu.au
How many bits of OUTA (and which ones) are you actually using for your synth output?
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ian Mitchell
www.research.utas.edu.au
-Phil
Nico
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ian Mitchell
www.research.utas.edu.au