TLV320AIC3104 can`t get it working

Hi.

I made a custom pcb with a presoldered TLV320AIC3104 but I can`t get any sound out of it and I don`t know what is wrong.

1781898059152.png

Its probably a bit messy, but thats how I have it connected. Also for DVDD I made sure it gets 1.8V. I had to fix that manually later on.
my teensy connection:

WCLK-Pin20
BCLK-Pin21
MCLK-Pin23
DIN-Pin7
DOU-PIN8

Overall it recognizes the actual chip on i2c. But there seems to be a timing issue.
The codec correctly detects the clocks (Reg 94 = 0xC0),
but I am stuck with a persistent DAC Overflow (Reg 3 = 0x10).

Any ideas what I can do about that? Or any more information I can provide regarding this?
 
You might want to read through this thread. Lots of information there, and the final boards work well.

Your issue may well be the requirement for an inverted BCLK. @palmerr elected to take the hardware option, but it’s possible to flip a register bit to achieve it, too.
 
Thanks a lot for this thread. I am already happy that it should work :)

I had a brief look through it, and the only thing I noticed is that there seem to be 100 Ω resistors on BCLK, MCLK, and WCLK. Are those really so important that I wouldn't be able to get the audio codec working without them?
Also my schematic uses a single shared GND plane for both DGND and AGND, would that be a big issue as well?

The thing is, I've already had my PCB manufactured and didn't include those resistors. I would need to manufacture again, but also want to make sure there are not other important issues.

Also, I was wondering if anyone has some sort of teensy test script I could use, just to make sure I'm not doing anything wrong on the software side.
 
Last edited:
The existing driver can be made to work without the I2C multiplexer used to allow 4 devices on a TDM bus. You need to edit this line. And the associated examples should give you a starting point for a simple test, though obviously they’re aimed at the 8x8 board so will need tweaking.

I‘d say the BCLK inversion is the single most important thing to fix.

You may get away with no series resistors, depending on your layout; but the PJRC audio adaptor has had one in MCLK since 2019, so I wouldn’t advise risking it. Easy enough to add in to test, unless you’ve done something seriously weird.

Sharing the ground planes may work to some extent, but for reasonable audio quality you should split them. I usually enforce that by giving them different names and join them at a single “star point” using a 0R link.

Welcome to the world of hardware development, where Rule 1 is “you’ll always need to make a second version“. No matter how much research you do, poring over datasheets, application notes and prior art, something will always be wrong! With luck, you’ll be able to get the first spin working by hacking the PCB, then “all you have to do” is ensure every modification you made is transferred to version 2. Plus all the things you know are needed but couldn’t test, like split ground planes...
 
100 Ω resistors on BCLK, MCLK, and WCLK. Are those really so important that I wouldn't be able to get the audio codec working without them?

I can't say for TLV320AIC3104, but I can tell you with certainty the SGTL5000 chip on the audio shield does not work with Teensy 4.0 if MCLK is connected directly. A resistor is absolutely required.

When this was discovered in the beta test (mid-2019) I recall testing many different resistors. A pretty wide range all worked. Also the on resistance of a 74LVC1G3157 analog switch worked. I had used those switches on the first breakout board, which is the reason we didn't discover the hard requirement for MCLK resistor until later in beta testing. The second breakout board didn't have the switches, where were present on the first breakout because so much about the RT1052 / RT1062 was unfamiliar and NXP's early documentation left a lot of questions to be resolved by experimentation.

100 ohms was roughly in the middle of the range resistors I tested, so we started with Rev C (pinout still for the Teensy 3.x boards) putting it on all the audio shields.
 
Thanks a lot, both of you. That's all very helpful and gives me hope again. 🙂

It would have been a miracle if it had worked straight away, but I would love to make sure my second version is definitely working. :))

But yeah, it looks like the only thing left is to get the resistor for MCLK onto my PCB somehow, at least for testing. It's basically the only thing I haven't done so far. Thanks again. I`ll try that next.
 
When we discovered the during beta testing, I modified the no-resistor PCB by just cutting the MCLK trace with an Exacto knife and scraped away the solder mask on both ends, applied solder to bare copper, and then soldered a SMT resistor to bridge the gap. Worked fine.
 
I modified my pcb as you described and got the resistor working, also I finally got some sound out of it, but it's still far from ideal.
It's hitting the correct frequency and a sine wave sounds good, but everything else, like square or sawtooth waves, sounds broken.

I feel like experimenting with the actual driver is far beyond my competence. I have to confess that I'm using Gemini right now just to get something working, but the result is still far from ideal.

I was wondering if anyone could take a look at the Teensy code I'm currently using. Are there any fundamental issues with it? Is there anything I'm doing that is obviously wrong?

I tried both AudioStream_F32 and AudioOutputI2S, but I have to admit I'm not even sure what the difference is or which one I actually need.

I've attached both files.

Also I was wondering in general if it would make my life easier if I would use the TLV320AIC3206(3204?) or CS42448 instead?
 

Attachments

  • AudioOutputI2S.ino
    3.9 KB · Views: 13
  • audioStream_F32.ino
    2.6 KB · Views: 11
Last edited:
Back
Top