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

Scott Gravenhorst music.maker at gte.net
Fri Jul 6 16:34:02 CEST 2018


Mutable instruments has posted their code on github.  Several of their modules use the
WM8731.  I don't believe you'll find a CubeMX file there and wouldn't be much good since
they use an F4 CPU.  The code is written in C++ and includes a driver, so perhaps some
clues are in their driver source.

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.  In fact, only the clock and MOSI lines are
connected to the CODEC for serial communications, but the chip also requires a strobe from
a GPIO pin.  When a control word (16 bits) is sent, the serial data is transmitted via SPI,
but after that, the strobe line must be taken low and then high again (see the datasheet
for timing specs) to latch the data.  "SPI Compatible" doesn't mean it works with a simple
SPI connection, it means that the two lines (clock and MOSI) are electrically compatible
with SPI.  You should find a sequence of events by looking at the Mutable code.  I believe
there are some control words sent to fix something known from the WM8731 errata.

I am working on a driver for the same CODEC, but using an H7 on a Nucleo.  I don't yet have
the CODEC chip in my hand, so I've no testable code at this time.

CubeMX is not hard to use, but there's a lot of detail.  Make sure all the needed pins are
selected, then make sure the clock configuration page looks correct and finally, you need
to look at the device configuration tab for each device you've selected.  Therein you can
set things like the control data rate and sample rate (see datasheet for specs).  After
setting, save the project and generate the code for the selected project type.  Note that
this is software for only the STM32 side of things.  You'll find the rest of what you need
in the Mutable code I've mentioned above.
 
HTH


ulfur hansson <ulfurh at gmail.com> wrote:
>im experiencing a lot of head scratchi g setting up my stm32F7 
>board with a WM8731 DAC - i know its a shot in the dark, but i 
>wonder if anyone has a cubeMX setup file that can deal with these 
>two? 
>
>Sent from outer space
>
>> On Jul 5, 2018, at 4:45 PM, Scott Gravenhorst <music.maker at gte.net> wrote:
>> 
>> 
>> music.maker at gte.net wrote:
>>> 
>>> "Jay Schwichtenberg" <jschwich53 at comcast.net> wrote:
>>>> What are you guys using for H7 hardware?
>>> 
>>> There is a very inexpensive Nucleo-144 board I'm working with.
>>> 
>>>> Also what are people using for compilers here, gcc, CubeMX or commercial
>>>> compilers?
>>> 
>>> I use gcc under Fedora 27.
>>> 
>>>> I'd like to find a board that has the processor, a whole lot of SDRAM
>>>> (512Mbytes or more) and USB with the rest of the pins broken out that is
>>>> affordable. I could do a board but I figure that I'd have to do at least 4
>>>> layers and that starts to get expensive for just a few boards and some of
>>>> the parts are BGAs.
>> 
>> Sorry - didn't notice SDRAM as your need. The Nucleo doesn't 
>have SDRAM. There is a Discovery > board that does have SDRAM 
>available from Mouser, but it's priced at $460 with a waiting 
>list. > > -- ScottG > 


-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- http://scott.joviansynth.com/
-- When the going gets tough, the tough use the command line.
-- Matt 21:22




More information about the Synth-diy mailing list