Author Topic: dsPIC33 as DDS?  (Read 6829 times)

0 Members and 1 Guest are viewing this topic.

Offline permababyTopic starter

  • Newbie
  • Posts: 2
dsPIC33 as DDS?
« on: December 23, 2014, 02:52:01 pm »
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
 

Offline awallin

  • Frequent Contributor
  • **
  • Posts: 694
Re: dsPIC33 as DDS?
« Reply #1 on: December 23, 2014, 03:17:18 pm »
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.

CERN 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 LX45
http://www.ohwr.org/projects/fmc-dac-600m-12b-1cha-dds/wiki
schematics, 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.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: dsPIC33 as DDS?
« Reply #2 on: December 23, 2014, 03:45:15 pm »
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.
... and a "good" DAC!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5534
  • Country: gb
Re: dsPIC33 as DDS?
« Reply #3 on: December 23, 2014, 04:36:33 pm »
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.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: dsPIC33 as DDS?
« Reply #4 on: December 23, 2014, 09:29:56 pm »
Depending on what you want out of your DDS.

As a matter of fact, there is no relation between DDS and DSP.
================================
https://dannyelectronics.wordpress.com/
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 7761
  • Country: nl
Re: dsPIC33 as DDS?
« Reply #5 on: December 23, 2014, 11:28:35 pm »
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).
« Last Edit: December 23, 2014, 11:32:35 pm by Marco »
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5534
  • Country: gb
Re: dsPIC33 as DDS?
« Reply #6 on: December 24, 2014, 08:17:16 pm »
Depending on what you want out of your DDS.

As a matter of fact, there is no relation between DDS and DSP.

Nope, reread that a few times and non comprende I'm afraid!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: dsPIC33 as DDS?
« Reply #7 on: December 25, 2014, 01:53:59 am »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2174
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: dsPIC33 as DDS?
« Reply #8 on: December 25, 2014, 06:58:58 pm »
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.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->