dsPIC33 as DDS? - Page 1
Forum section: electronics / general

author: permababy
author_rank: Newbie
timestamp: December 23, 2014, 02:52:01 pm
content: Hi, I'm from the AVR world but now I'm looking into a DDS project for sine, triangle, sawtooth, ... wave generation, the frequency as high as I can muster. I've come across the dsPIC33 which seems to have a built-in DSP but - surprisingly - I haven't found much information on how to use the dsPIC33 to generate signals, let alone how to use it as a DDS.For a sanity check I'm dropping this note here. Is a dsPIC33 more suitable for signal generation that a plain vanilla µctrl like any odd ATMega or even a regular PIC? Are there any resources that go into the DSP part of the dsPIC33? Has anybody hooked up a DAC to the dsPIC33's DSP? Any information that can put me on the right track is appreciated.Thanks

author: awallin
author_rank: Frequent Contributor
timestamp: December 23, 2014, 03:17:18 pm
content: Quote from: permababy on December 23, 2014, 02:52:01 pmCERN has developed a 600 MS/s 14-bit DDS based on the MAX5890EGK+D. It uses their SPEC fpga board which is based on Spartan6 LX45http://www.ohwr.org/projects/fmc-dac-600m-12b-1cha-dds/wikischematics, pcb-layout, and code is available.That would be a good starting-point for an OSHW function-generator - depending ofcourse on your needs and time/money budget.AFAIK not that much DSP is required for DDS operation, you just want a fast large enough memory and a fast bus to the DAC.

author: tggzzz
author_rank: Super Contributor
timestamp: December 23, 2014, 03:45:15 pm
content: Quote from: awallin on December 23, 2014, 03:17:18 pm... and a "good" DAC!

author: Howardlong
author_rank: Super Contributor
timestamp: December 23, 2014, 04:36:33 pm
content: Be aware that the higher resolution DACs integrated on some dsPICs are suitable for audio but that's about it. They are delta sigma DACs and speed limited.Agreed with others, in general you don't need much DSP processing to generate signals, but quite the opposite to receive, demodulate and decode them.Also, although it's quite possible to use a micro controller to drive a DAC, take care with how the DAC is driven from a timing perspective. The obvious way is to use DMA, but keep in mind that there may be some jitter due to bus arbitration, so the DAC may need a FIFO somewhere between it and the MCU core. The dsPIC, as well as special DSP instructions, also has multiple busses with dual port RAM, so it may be possible to circumvent the need for a FIFO.

author: dannyf
author_rank: Super Contributor
timestamp: December 23, 2014, 09:29:56 pm
content: Depending on what you want out of your DDS.As a matter of fact, there is no relation between DDS and DSP.

author: Marco
author_rank: Super Contributor
timestamp: December 23, 2014, 11:28:35 pm
content: The algorithms to generate a sine without a LUT are generally lumped in with DSP, that's about it.It would be nice to have a cheap high speed DAC board for one of the Zynq boards for DDS (the connector alone on that CERN board disqualifies it).

author: Howardlong
author_rank: Super Contributor
timestamp: December 24, 2014, 08:17:16 pm
content: Quote from: dannyf on December 23, 2014, 09:29:56 pmNope, reread that a few times and non comprende I'm afraid!

author: dannyf
author_rank: Super Contributor
timestamp: December 25, 2014, 01:53:59 am
content: If I were you, I would go back to your needs: what are you trying to do and how do you want to do it?1st order of business is to decide if you need to use an outboard DDS or make one from the mcu. Outboard DDS typically provides a much wider range for frequency, and greatly simplifies the mcu's job. But it can be more complex.For a mcu-based implementation, you can consider a DDS as a phase accumulator + a look up table for your desired waveform. The accumulator is periodically advanced -> how fast it advances and how much it advances each step determine the frequency of your output. the value indexed by the phase accumulator is then output, via onboard dac, or outboard dac, for any means you so desire.For a mcu that just runs the dds algorithm, using parallel dac, you can get it done in 10 instructions. With a 128 or 256 steps, you are talking about up to 50khz on the top end (no missing steps) on a 70MIPS mcu, or more if you allow fewer points per cycle.Those $5 DDS modules can easily go to 20Mhz, in comparison.

author: fcb
author_rank: Super Contributor
timestamp: December 25, 2014, 06:58:58 pm
content: You need to define what frequency range you want to cover.If it's audio, then the dsPIC33 is fine (i've been using it to do this since 2007) - hook up a cheap DAC (I like wolfson) and it's a piece of cake.One word of warning - if you expect a good saw-tooth (i.e. your building a synth), then don't use DDS techniques.