[sdiy] STM32 vs WM8731

Richie Burnett rburnett at richieburnett.co.uk
Tue Feb 16 16:47:31 CET 2016


I would second Eric's comments about checking signal integrity, and in 
particular recommend keeping serial interface wire lengths *really* short!

I've always hated I2C as a protocol.  The weak pull-up nature of the bus 
makes it very susceptible to interference and capacitive loading, and it's a 
pain trying to work out which data bits came from the master and which came 
from a particular slave when looking at the single data line on a scope. 
SPI and I2S seem so much more civilised for the cost of an extra couple of 
pins.

-Richie,

-----Original Message----- 
From: Eric Brombaugh
Sent: Tuesday, February 16, 2016 3:17 PM
To: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] STM32 vs WM8731

I've brought up a *lot* of systems with the WM8731 over the years.
Getting the I2C control interface working can be a pain.

Your HAL I2C command looks right at first glance and the schematic seems
OK too, so it's probably something else. One thing that you haven't
described is what the physical construction approach is. On the WM8731,
you'll notice that the MCLK input pin is right next to the I2C SCL pin -
I've found that the I2C SCL input is *extremely* sensitive to crosstalk
from the MCLK signal and if you built this on a solderless breadboard,
or with flying wires from the MCU to codec then you can easily swamp it
out to the point where you get no ACKs.

If you have a scope with high impedance probes, look at the SCL input
pin - if you see MCLK there at a low level, it's a good bet your WM8731
can't hear the I2C bus due to the crosstalk. Reroute the signals or put
a simple RC lowpass filter on the MCLK to mitigate that.

Eric


On 02/16/2016 01:37 AM, Rob wrote:
> Just continuing on the STM32 discussions…
>
> I’ve been trying to get a Nucleo-F411RE talking to a WM8731, but not
> having much luck getting it to communicate over I2C
>
> I send the following from the STM32:
>
>                  WM8731Status[0] = HAL_I2C_Master_Transmit(&hi2c1, 0x34,
> WM8731PowerOn1, 1, 10000);
>
> But I don’t get an Ack from the WM8731:
>
> https://www.dropbox.com/s/yhen98n17pyrqgr/Screenshot%202016-02-16%2008.22.15.png?dl=0
>
> Here’s the schematic for the WM8731 setup:
>
> https://www.dropbox.com/s/e6fkerkmf95ldzf/Screenshot%202016-02-16%2008.20.29.png?dl=0
>
> I’m pretty sure everything on the STM32 side is setup correctly, and I’m
> working on the assumption that there’s not a lot to do with the WM8731.
> Once all the power is connected and the I2C mode and address pins are
> set low it should just receive I2C messages. I think the issue might be
> around the address, but I’ve tried all combinations I can think of.
>
> Any help would be much appreciated as my wife is getting tired of me
> shouting at the darn thing!
>
> Many thanks in advance
>
> Rob
>
> gmsn.co.uk
>
>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>

_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7442 / Virus Database: 4530/11636 - Release Date: 02/16/16




More information about the Synth-diy mailing list