Newbie with SGTL5000 CODEC - no response on 12C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Newbie with SGTL5000 CODEC - no response on 12C

659 Views
MarcDraco
Contributor I

I'm a little confused why this hasn't asked me to register, but hey-ho.

I knocked off  little SGTL5000 breakout for a project (my first attempt at self-designed I2C) and it's failed in the most spectacular fashion. The board appears to deliver the correct power and signals but I don't get any response from the CODEC which is like a brick wall.

I'm using the Arduino framework with an ESP32 (WROOM) and the Wire library to address a slave on 0xA.

Even an i2C scanner can't find anything. I've looked a signals on the scope and they appear to make sense without going into the detail of analyzing the actual signal. Doesn't seem a lot of point since the code is known to work with working boards.

Maybe I've missed something but this doesn't appear to be a particularly difficult chip to configure. I'm using "old" stock from JLCPCB so it's one of the early ones but (in case it matters) I've routed 1v8 power via a regulator to the VDDD pin per the datasheet. With 3v3 on VDDA and VDDIO - which I think is correct.

I couldn't find the line capacitance so I've used 4k7 pullups on the board.

I assume someone here has a clue. I've dropped some huge bollocks over the last year so this could be another where I can't see the wood for the trees. My last one was using a 68k resistor where the design (my OWN) called for a 3k3 -> 6k8 and didn't notice until I got the simulator working in KiCAD. All for the sake of missing floating point... I sent myself to the back of the class and gave myself a good thrashing for that.

EDIT:

I think I might have found the issue. If I understand this correctly, I need to put down the crack pipe. The shame I feel now is palpable.

Why? I'd failed to read the clocking section of the datasheet (I know, RTFM!) but I have trouble reading. Don't ask, complicated story and while I wasn't aware, all the other little breakouts I've used have self-clocked.

And of course, "Yours Truly, Doofus" just figured the i2C, having it's own clock, didn't need other timing signals. I come from very simple logic and I've been out of the game for over four decades so things have changed a bit! 

Obviously I'll report back when I find a way to clock the chip (MCLK) using the hardware I have. Hopefully there's a library I can use so I don't have to reinvent the wheel, but I'm dead excited to use this device as it's low cost makes it an ideal expansion for a shedload of ESP32 and similar devices. I had assumed that the I2S clock signal was to drive the digital sound features and keep it all in sync. It simply never occurred to me that it was used to drive the communications bus. I had assumed (and you know what "assume" did) that the I2C clock was just setting registers.

If you'll all excuse me, I will now go to the back of the class and put my dunce's cap on while I sit on a red-hot spike.*

I'm from Yorkshire, England guys. That's a reference to some English comedy - but we really had dunce's caps in my first school. I'm that old!

0 Kudos
Reply
2 Replies

627 Views
JozefKozon
NXP TechSupport
NXP TechSupport

Dear Marc,

there is a known issue with the VDDD internal regulator. It is recommended to use an external power supply for the VDDD. Please refer to the errata attached for a workaround. 

Regarding the JLCPCB, this is not our authorized distributor. There is a chance that the SGTL5000 is not genuine. Please see this link for a list of our authorized distributors.

With Best Regards,

Jozef

622 Views
MarcDraco
Contributor I

Thank you Jozef, that actually cleared a couple of things up for me. China definitely copies all sorts of stuff, I've been helping some people out with the THAT corp.'s 1510/1512 chips. A few people have been getting them from Ali and finding (to their surprise) that they don't work. God only knows what they were - presumably some sort of op-amp re-marked as a THAT?

I found this with a classic function generator from my youth, which is "cheap" now, the XR2206. But a lot of the cheaper ones are poor-quality clones.

I followed the instructions on the datasheet for the 1.8 regulation so that should be OK. My issue right now is that I need to find a decent library for the ESP32 devkits to drive the master clock. The best library by Paul Stofferegen (I hope I spelled that right) uses some specialised instructions to to the DSP work but Paul has already done a HAT for his own (Teensy) boards which are quite costly compared to the ubiquitous ESPs.

EDIT:

I should add (not just to say thank you for your time) but also I'll leave this discussion open in case anyone has some better ideas on how to "power" the SGTL5000 from the ESP32 under Arduino.

I know Arduino isn't really ideal but it's more friendly for the sort of people I'm aiming this project at if that makes sense. I see the chip as an ideal solution for high-performance (consumer) audio in something we can fit into very small package. This is very exciting stuff for keen amateurs like me.

Seems part of the issue is to do with using GPIO 0 for the MClk and not all boards expose it. As a result I'm diving into a small diversion with the ESP32 and coming back to this in a couple of weeks.