cancel
Showing results for 
Search instead for 
Did you mean: 

How to drive STA350BW (X-NUCLEO-CCA01M1) from Raspberry Pi (or other) SBC

BStra.1
Associate

Hi,

I'm trying to attach a RaspberryPi-like SBC to the STA350BW dev board. I have I2C working (bit-banged), and have also connected the I2S LRCLK, BCLK and DATA signals.

However, looking at the documentation, it appears that a master clock (MCLK) is also required. Is this the case? I'm not sure I can generate a suitably fast MCLK from the SBC. If I'm able to obtain a suitable crystal oscillator, is this likely to work even if the BCLK and MCLK may not be *exactly* accurate?

Reading the status register returns 0xFF, which suggests that the PLL is not locked. I'm guessing this is why I'm not getting any audio at all (despite disabling the IDE bit).

Grateful for any advice.

Edit:

I've hooked up a clock source, and the PLL is now showing as locked. But I'm still not getting a peep out of the amp. The status register shows 0x7f (127) - suggesting that there are no other faults.

I've played with master volume, channel volume, as well as disabling IDE, BCLE, and bypassing most of the DSP functionality - still silence. Can anyone provide a good set of register configs that *ought* to make some sound? I'm sending 16-bit stereo at 44.1 right now.

Thanks,

Ben

1 REPLY 1
BStra.1
Associate

Well, I figured it out.

Yes, the STA350 needs an external master clock - would have been nice if the were a couple of oscillators on the dev board itself, but I guess that under normal circumstances they are driven by the other Nucleo board (which I don't have).

I'm generating Master, LR and Bit clocks with a uC. All of these go to the STA350, LR and Bit go to the SBC, which is configured to run as a clock slave. The SBC data output goes to the STA350, obviously.

The only registers that need to be initialized (for 44100Hz 16-bit stereo) are: CONFA (0x63 for MCLK=256*fs), CONFB (0x80), CONFF (0xd0) and the master volume.

The problem I had was that I was missing the EAPD bit, so the external amp part was totally powered down :(

Maybe this'll help someone else.

Cheers,

Ben