无意中从网上看到AVRminiDDS。是一个外国人做的用AVR模拟DDS原理做的1-100K的信号发生器。
以下是他的资料
The software is written in assembler, as it is very short and it need the speed in the main loop.
This is the heart of the synth. To be precise, it's in the 7 lines of assembler that makes up the main loop.
The rest of the code is the wavetables and the communication code.
The phase accumulator uses 24 bits, which determines the resolution of the output frequency. Maximum available frequency and resolution is also dependent on your crystal frequency :
Resolution = fCPU/150994944 and
fOut = Accumulator * Resolution
In my case with a 11.059200 MHz crystal, the resolution is 0.073242188 Hz.
To get an output frequency of 1 kHz, we need to use a phase accumulator value of 0x003556 (13654 decimal).
This gives an output frequency of 1000.048835 Hz. Good enough for most hobby work !.
文章评论(0条评论)
登录后参与讨论