原创 avrminiDDS的研究

2008-9-1 21:00 2705 4 4 分类: MCU/ 嵌入式

无意中从网上看到AVRminiDDS。是一个外国人做的用AVR模拟DDS原理做的1-100K的信号发生器。


以下是他的资料865e331d-fcc4-4bc3-929b-6e330c64d28d.JPG


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 !.






 
 

 



 
 
这个是ATMEL ASM 汇编语言zip 

 


 

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /3 下一条