[sdiy] Re: dsPICs with DACs: linearizing the 12 bit ADCs, external RAM?

Eric Brombaugh ebrombaugh1 at cox.net
Sun Jul 6 05:21:25 CEST 2008


On Jul 5, 2008, at 7:34 PM, Robin Whittle wrote:

> That is great you got the chip and got it going.  I requested some
> samples from Microchip but they were back-ordered and will probably
> arrive in a month or two.

Yes - I'd imagine that these are turning out to be pretty popular with  
the audio/DSP crowd. I bought 2 and sampled one.

> I did some audio work with a dsPIC30 a few years ago and found it to
> be a really good device.  I used the Microchip MPLAB using assembly
> code only, whith the IDC2 debugger/programmer.  The dsPIC33 series
> are faster and have better DMA for peripherals.

About 33% faster than the older parts, and lower power too (about 1/3  
at the same clock rate is what I'm seeing). The DMA is a mixed  
blessing - they've removed local buffering on some peripherals that  
used to have it built-in (like the ADC), so you _have_ to use DMA to  
do channel scanning on the new parts. That takes a little bit of  
brainwork to figure out, but it's pretty easy after you've done it once.

> I am really averse to surface mount and want to do fancy things such
> as ADC, reverb and delay (requiring extra memory, perhaps) with DIP
> components.

Well, you're going to find it harder and harder to get new parts to  
play with until you get used to SMD. It's really not that hard though  
- you can find DIP adapters for most footprints these days that will  
allow you to continue to work with 0.1" perfboard if you like. Once  
you get a little practice with the fine-tip iron and liquid rosin  
you'll wonder why you worried about it so much.

> The 28 pin DIP devices <snip> are the ones I am keen to use.  There  
> are no 40 pin DIP versions,
> and I would be surprised if any emerge.

That's what I'm using now. Works fine. Agree that 40-pin DIP packages  
are unlikely to be produced in the future.

> I am intrigued about the possibility of linearising the 12 bit ADC
> in some way to be used as one or two audio inputs.  There would be
> some basic limits of ADC noise, which might be overcome somewhat by
> oversampling.

<snip big chunk of stuff on linearization & dither >

Wow - that's an intriguing bunch of ideas. It strikes me that you're  
trying to make a silk purse out of a sow's ear though. Why not use the  
SPI or DCI ports to connect a better ADC or codec to the dsPIC  
instead? They're fairly inexpensive these days - you can get an I2S  
codec for < $5 that's a lot easier to use than all the firmware and  
support circuitry you'd need for dither & linearization.

BTW - I do a _lot_ of work with DSP linearization in my day job. Let's  
just say it's a lot harder to do well than you might think...

> I tried to figure out how to connect external RAM to one of these 28
> pin DIP devices -  to do reverb, delays etc. beyond the limits of
> the internal RAM.
>
> My conclusion is that there is no 8 pin RAM chip (SPI interface) in
> existence.  All those chips are for FLASH, EEPROM etc.

This is an unfortunate fact these days. If you're trying to do audio  
effects that rely on massive delays then you either have to use a high- 
pincount device to get sufficient GPIO for talking to a parallel SRAM,  
or you need to move up to a different DSP with a DRAM controller built  
in.

At one time I'd thought about using a CPLD to build a Serial/Parallel  
SRAM interface that would hook a large SRAM to the SPI bus, but doing  
the math on the BOM showed that I was better off just buying a bigger  
dsPIC.

> There seems to be no audio ADCs in a DIP package - and hardly any
> (none?) 16 bit ADCs in a DIP package either.

See above comment about the dearth of new non-SMD parts.

> An external audio ADC and/or DAC can be interfaced neatly to these
> chips via the CODEC interface (Data Converter Interface).  The
> Product Selector chart seems to be erroneous in stating that these
> DAC chips do not have a Data Converter Interface.  These chips have
> no dedicated pins for this function - the CODEC interface pins can
> be made to appear on any of the Remappable Peripheral pins.

The '802 does appear to have a DCI port. I haven't used it, but it  
shows up in the documentation and in the assembly language include  
files. You're right that it's only available through the new  
peripheral pin select matrix. That's a good thing though - you can  
bring it out on almost any pin in the device. It's fairly easy to use  
too. Check Seb Francis' website for details on his 4xD project which  
relies on the DCI.

Good luck with your project - I'm interested in how it turns out.

Eric




More information about the Synth-diy mailing list