Infineon MA12070 Class D

You need to make sure that the MCLK is a correct multiple of the LRCLK as per p.23 of the datasheet.

Alternatively, don't use the MCLK from the Bluetooth board. Connect it to the LRCLK instead.

Bluetooth LRCLK >> MA12070 LRCLK & MCLK
Not sure I follow. I would not use MCLK from the Bluetooth board. Connect BCLK from the Bluetooth board to MA12070P BCLK and MCLK.
 
I've made some minor changes to the MA12070 PCB from my experience after building 4 MA12070 digital boards. I've soldered up one analog one, but not tested yet. Here are the gerbers, schematic and BOM if anyone is interested.

Changes are:
  • Break out the AD0/AD1 pins to select i2c address for a microcontroller to handle more than 1 board
  • Spaced out some SMD capacitors which were too close. They were prone to coming together due to capillary action when solder melts.
  • Increased spacing for analog input caps
Building Notes:
  • The board is for both digital and analog versions of the MA12070. Use R2,3,4,5 for digital and C9, 12, 16, 21 for analog input capacitors
  • There are jumpers for MCLK, Mute and Engage. If not providing external source, short them with a solder blob
  • Select Master/Slave and BTL/PBTL accordingly with solder jumpers.
  • The layout of this board is for BTL output. Minor changes required for PBTL, see datasheet
  • 5v is supplied via a Torex X6219 LDO. Max input is 6v. If not using this, short out the 5V solder pad. The pinout of this LDO is generic, substitute what you like that fits.
  • I2c address is selected via the AD0/AD1 solder pad.
  • The SMD components are very large by SMD standards. This was my first SMD project and it was not as difficult as I thought.
  • Use as little solder paste as possible for MA12070. There will be solder bridges. Easily fixed with a soldering iron. Melt solder and pull away from chip. Lot's of videos on YouTube on how to do that.
 

Attachments

  • Gerber_PCB_I2S MA12070 v.2.zip
    155.5 KB · Views: 73
  • Schematic_I2S MA12070 v.2_2023-08-10.pdf
    189 KB · Views: 112
  • M12070 BOM.zip
    9.5 KB · Views: 76
  • Like
Reactions: 2 users
I am giving up on this China Board.
I connected BCLK from the Bluetooth board to the MA12070 BCLK and MCLK.
Still full blast with distortion although music is much more recognisable now.
Slider on zero no sound
Slider on 1of 20 full blast
Android Phone with LDAC Codec.
You should probe the frequency of Bluetooth board's BCLK and MCLK. The DAC of the MA12070 is not as versatile as stand alone DACs. Quite a few things need to be set manually.

Once you know what your Bluetooth board is outputting, we can figure out how to set the MA12070's registers. Since you have already attached the ATTiny, it's a few more lines of code.
 
MCK
IMG_20230810_183123.jpg
 
I've made some minor changes to the MA12070 PCB from my experience after building 4 MA12070 digital boards. I've soldered up one analog one, but not tested yet. Here are the gerbers, schematic and BOM if anyone is interested.
Why don't you want to split the 5V supply line into two lines - one digital and one analog? It is possible to feed both lines with separate linear power supplies. The consumption of MA12070 is very low.

But first we need to see some test of your analog version and compere it with brzhifi and tweaked brzhifi
 
While youtube was running I got LRCK = about 184 khz and BCK = about 6,2 Mhz.
My scope does not go below 1micro second, so no MCK reading.
That's a very high sample rate, but valid.

The accurate sample rate of your LRCK is probably 192khz. Close enough to 184khz. And your BCK is 6.144mhz based on the assumption of a 32bit framesize (192khz x 32 = 6.144mhz). 6.144 mhz is a valid MCLK frequency for the MA12070, so you can use your LRCK output to feed MA12070's MCLK as well.

The issue is probably a framesize mismatch. The default framesize is 64 bits per sample but your Bluetooth is outputting 32bits. You need to tell the MA12070 this by adding the additional lines to your ATTiny code.

//Change input from 64bit framesize (default) to 32bit
Wire.beginTransmission(0x20);// 0x20 = default MA12070 I2C address
Wire.write (0x36); // 0x36 = i2s framesize register
Wire.write (0x11); //Set framesize to 32bit
Wire.endTransmission();

hope this works