[sdiy] STM32 (or other) audio DSP learning recommendations

Eric Brombaugh ebrombaugh1 at cox.net
Sat Jul 7 00:59:44 CEST 2018


On Fri, 2018-07-06 at 08:21 -0700, Scott Gravenhorst wrote:
> Eric Brombaugh <ebrombaugh1 at cox.net> wrote:
> > On 07/06/2018 07:34 AM, Scott Gravenhorst wrote:
> > > 
> > > One of the odd things about the WM8731 is the "SPI compatible" 
> > 
> > control port. I would have > expected I2c, but that is not the 
> > case. 
> > 
> > The WM8731 can work in either I2C or SPI modes, depending on the
> > state 
> > of the MODE pin (21). When it's held at logic 0 the device uses
> > I2C 
> > protocol and when it's pulled up to logic 1 then it operates in
> > SPI 
> > mode. I used I2C mode in my STM32F4 Codec board and it works fine.
> > 
> > One thing to be very careful of is that Wolfson in their wisdom
> > located 
> > the serial clock pin and the main oscillator input pin right next
> > to 
> > each other. This makes the serial clock extremely susceptible to 
> > interference from the main oscillator when building prototypes on 
> > solderless breadboads or with flying hookup wire. If you find you
> > can't 
> > talk to the device double check that the serial clock line is not
> > being 
> > contaminated.
> > 
> > Eric
> 
> Thanks Eric, that is good to know.  I probably glanced over the I2C
> stuff in the
> datasheet.  The two examples I've seen both used the SPI mode, but
> good to know that
> I2C can work too.  Can I assume that regardless of I2C or SPI, the
> CSB line still
> needs to be set low and set high to latch the data?  I was unaware of
> the clocking
> issues and as it turns out, I'll be working with a fly-wire
> prototype.  Perhaps
> shield would be a better way to connect it to my Nucleo.

In I2C mode the CSB pin is used to select one of two possible I2C
addresses. The datasheet will tell you what the two options are.

With flying wires between a Nucleo and a WM8731 breakout board you
should be fine as long as you don't tightly bundle the MCLK and SCL
lines together for long runs. In some of my early experiments I put a
weak lowpass filter on the MCLK pin to reduce the hf harmonics which
were leaking onto the SCL line and preventing the I2C interface from
receiving properly.

Eric




More information about the Synth-diy mailing list