Third time's the charm (he says hopefully)

A project log for weeBell - personal central office for POTS phones

weeBell brings the goodness of old telephones into the modern age in a portable package that speaks GUI, Bluetooth and Wifi

dan-julioDan Julio 05/29/2023 at 15:160 Comments

Oh difficult child, you

I received the Rev 2 boards and ES8388 codec chips last week and got a board built up.  It took a day more to finish the codec driver port and then I could start debugging.  After working through the initial compile errors, I was immediately greeted by I2C errors communicating with the ES8388.  Lots of them.  Sometimes the chip simply wouldn't respond and other times it would respond to an address but not let go of SDA at the end of a cycle leading to a timeout.  At least it wasn't f*cking up transactions to the other chips like the SGTL5000 did but I was seriously bummed.

Scope traces looked fine but clearly something was wrong.  Things got slightly better when I removed the second set of pull-ups on the board (leaving only gCore's 10k pull-ups).  I could at least get through the codec initialization sometimes.  Then I would see failures when I2S was running (2.048 MHz MCLK) and the chip was accessed to change volume (but no errors when I2S wasn't running).  I could see some apparently slight indications of cross-talk, but at least on my 200 MHz BW scope, they didn't appear to violate the VIH and VIL levels in the ES8388 spec sheet.  Perhaps, though, the ES8388 was seeing  some ultra-fast glitches as additional clock pulses.

Should have followed through with more research

Then I remembered seeing something on the schematic for the AI-Thinker A1S ESP32 module which has the ES8388 built-in (I used their dev board to play around with the HF demos originally). 

There is what looks like an RC filter on the I2C signals going to the ES8388.  I originally dismissed this circuit when I laid out my board thinking the designers must have been over cautious but in the light of my own failures I had the realization that circuit was probably there for a reason.  Doh'

Some quick digging turned up Espressif's Lyra T dev board schematic complete with a note...

Oh crap.  I shouldn't have been so quick to dismiss what I'd seen.

A quick hack later and my board had a similar filter on the I2C lines.

Look at the top left corner of the image.  You can see 2 15k pull-ups tombstone style and 100 ohm resistors soldered to the cut traces.  22 pF caps are where R1 and R2 used to go completing the filter. 

It worked.  I2C errors were now a thing of the past.  So a note to anyone thinking of using the ES8388 ... remember to include a filter!

I could now finish debugging the ES8388 driver which mostly meant adjusting various gains so the audio sounded right although I included a bit of black magic I found in the Espressif ADF driver that accesses undocumented registers with the comment that it's to make 8 kHz sampling work (which is what I use).

One more round of boards

Let's hope the third time's the charm.  At least the modified Rev 2 board seems fully functional and I am planning to take my proto to visit a friend who collects antique phones for an afternoon of calls making sure this works with a variety of phones.

R1-R4, C1, C2 are the I2C pull-ups and filter.  Rev 3 also got some more warnings and notes.