[sdiy] Digital delay - whine from serial RAM access

Tom Wiltshire tom at electricdruid.net
Mon May 9 14:25:54 CEST 2016


Thanks for all the suggestions everyone. This morning I changed a few things around, including swapping the SPI pin assignments on the dsPIC, and shortening all the SPI traces as a much as possible as suggested. This seems to have cured the noise. I'll be sure to take all of the mentioned factors into consideration if/when I get to designing a PCB for this.

I've put a short post on my website about what I've got so far, and some of my ideas for stuff still to do - mostly firmware things. The nice thing about delays is that the hardware is simple.

http://electricdruid.net/diy-digital-delay/

The photo shows my stripboard prototype, with the In/Out jacks and two dual op-amps on the left. That's the analog section, with a buffer, filters, and an output mixer. The middle of the board has the dsPIC and the two 8-pin SRAM chips. The two voltage regulators for the analog and digital 3.3V supplies are on the front edge. There are two separate sets of power/ground running down the board.

Thanks again,
Tom


On 9 May 2016, at 02:18, Vinicius Brazil <brazil.v at gmail.com> wrote:

> Hi Tom,
> I use dsPIC33FJ128GP802 for the last 4 or 5 years in my most demanding projects, audio and non-audio. 
> I made many tests with his DAC (including delay and flanger using the internal memory) and the results were not very satisfactory.
> I consulted the support from Microchip and some forums and spoke something in the  72 dB S / N ratio.
> I love this chip but has not yet reached a good result with the DAC.
> 
> Vinicius Brazil
> www.vbrazilsystems.com
> 
> On Sun, May 8, 2016 at 7:49 PM, <rsdio at audiobanshee.com> wrote:
> Although you cannot create a ground plane with a strip board, you can maintain separate paths for analog ground and digital ground. The key is that all current flowing out of the power supply has to return to the same power supply via some ground path. Thus, you need separate ground nodes to avoid interference. Any digital return current that flows over analog ground paths will create a voltage drop due to non-zero resistance, adding noise to the analog signals (which are all referenced to analog ground).
> 
> First off, if your strip board has multiple rails along each side, then you should be able to dedicate one to analog ground and one to digital ground.
> 
> Second, if you cannot dedicate a rail to analog ground, then you can still run a star ground for analog that doesn't share ground paths with digital. Strip boards are particularly bad because each contact adds a small resistance that shifts the ground reference for everything upstream.
> 
> The DAC inside a CPU like the dsPIC can be noisier than a standalone DAC chip. However, most CPU chips have separate analog ground pins dedicated to the DAC so that you can connect analog separately. If that's an option on your chip, then be sure to take advantage of it. The internal DAC should also have separate digital supply and reference pins.
> 
> Also, when measuring noise, it's incredibly important where you take the ground reference. Because "ground" is not the same voltage at all points along the node, you'll get different readings at different points. The best way to evaluate the dsPIC DAC noise is to ground your scope probe at the dedicated analog DAC ground pin on the dsPIC. I've seen false noise readings when I left the ground connected to a convenient point in the circuit, only to see them reduce or even go away when moving the ground reference closer to the source.
> 
> Finally, when you make your first PCB, you might want to design for an optional external DAC. If the dsPIC internal DAC is still too noisy with separate ground paths, you'll want to switch to an external (e.g. SPI) DAC.
> 
> Brian Willoughby
> Sound Consulting
> 
> 
> On May 8, 2016, at 3:20 PM, Tom Wiltshire <tom at electricdruid.net> wrote:
> > Well, I'm seeing the noise in the audio output, but I've traced it back as far as the dsPIC's DAC output. It could well be produced internally by the dsPIC when the current spikes when the SPI kicks in.
> >
> > I've done as you suggested to find the noise (scope on AC, low level), and it amounts to about 20mV p-p on the DAC output. Can't believe how annoying it is for a signal at that level, but it's right in the part of the spectrum where you really notice, and where the filters that come after have *no* effect.
> >
> > I'll have a dig through the datasheet and errata to see if there's anything I'm missing, but this (or the 128K version, anyway) is one of my favourite chips, so I'm pretty up on that stuff.
> >
> > The resistors to limit SPI current is an interesting idea. I'll see how I go on, and maybe give it a try.
> >
> >> -----Original Message-----
> >> From: Synth-diy [mailto:synth-diy-bounces at dropmix.xs4all.nl] On Behalf Of Tom Wiltshire
> >> Sent: Sunday, May 08, 2016 11:36 AM
> >>
> >> I'm currently building a digital delay. The prototype is on stripboard (this
> >> may be a significant fact). I'm using a dsPIC 33FJ64GP802, which has a
> >> 12-bit ADC and 16-bit DAC on-chip. I had this working very nicely using the
> >> on-chip RAM for a short delay. This weekend, I've added an external SRAM
> >> (the 23L1024 128KB SRAM that Richie B suggested here a while back) and got
> >> it running with that. This produces a much longer delay, which is great.
> >>
> >> What's not so great is that it also causes a nasty whining sound in the
> >> output. I've checked on the o'scope and the noise coincides perfectly with
> >> the periodic block read/writes to the SRAM chip - so it's coming from the
> >> fast signals of the SPI connection (8MBits in my circuit). I'm using a 32KHz
> >> sample rate and read/writing blocks of 16 samples (the SRAM memory page is
> >> 32 bytes, so it's convenient) which gives me a 2KHz block rate, and a whine
> >> at the same frequency.
> >>
> >> I've got separate analog and digital supplies, and as far as possible I've
> >> got the analog and digital parts of the circuit separated, electrically and
> >> in space. The in/out op-amps and filters are all up one end of my board, and
> >> the uP and SRAM are down at the other, with a line of track breaks dividing
> >> the two in the middle.
> >>
> >> Given that I can't add a ground plane to a stripboard, is there anything
> >> else I can do that will help reduce the whining? Any other suggestions for
> >> reducing digital noise is mixed-signal circuits like this? How does the
> >> noise get from the SPI connection to the output? What techniques could I use
> >> to determine that?
> >>
> >> Thanks,
> >> Tom
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
> 




More information about the Synth-diy mailing list