0

My TDA7318 audio mixer chip still makes some trouble: It seems to ignore all commands I send to it. On pages 9–11 of the datasheet, eight different commands are described, one byte per command. A command of "N bytes" + a stop byte at the end must be sent to the chip, but there is no mention of how much N must be:

command sequence

The device seems not to have the usual registers. Here is an overview of the corresponding commands:

list of commands

Now here is my question: Do I have to send all eight command bytes to the chip every time I'd like to change something?

4
  • 3
    The Pi is irrelevant to this question.
    – joan
    Jun 6, 2021 at 16:24
  • 1
    The TDA is controlled by the Pi's I²C port.
    – Neppomuk
    Jun 6, 2021 at 16:59
  • 2
    The answer will be the same regardless of the type of computer or microprocessor connected to the I2C device, i.e. the question is a general one, not Pi specific.
    – joan
    Jun 6, 2021 at 17:06
  • 1
    OK, where shall I repost the question then?
    – Neppomuk
    Jun 6, 2021 at 17:11

1 Answer 1

1

Qeustion

Rpi I2C audio mixer TDA7318 communication question: Should all command bytes sent each time?


Answer

Short Answer

The short answer is NO. You only need to send the command bytes needed.


Long Answer

  1. TDA7318 uses standard I2C to interface with Rpi. The only constraint is that the highest I2C bus speed is 100kHz.

  2. Datasheet Page 5 of datasheet specifies the following:

    2.1 VIL Input Low Voltage = max 1 V

    2.2 VIH Input High Voltage = min 3 V

    Rpi GPIO High is usually above 3V, Low below 1V, so no 3V3 to 5V0 logical level converter is required.

    WARNING: Datasheet specifies that pull up resistor must be used for SCL and SDA wires. It is important not to connect pullup resistors to 5V, or 6~9V Vcc, otherwise the Rpi GPIO pins might be latched up and fried. The correct way is to pull up 3V3 (Rpi 3V3 rail, external 3V3 PSU, or 3V3 divided down from 5~9V).

  3. The interface protocol (Page 9 of datasheet) comprises:

    a. A start condition (s)

    b. A chip address byte, ...

    c. A sequence of data (N-bytes + acknowledge)

    d. A stop condition (P)

  4. These are the command bytes you can send:

    4.1 Speaker ATT RR

    4.2 Speaker ATT LF

    4.3 Speaker ATT RF

    4.4 Audio switch

    4.5 Bass control

    4.6 Treble control

  5. In other words, you can send a least 1 command, at most 6 commands at a time.


References

(1) TDA7318 Digital Controlled Stero Audio Processor (I2C) Datasheet - ST 1999nov


Appendices

Appendix A - TDA7318 I2C Protocol

tda7318 protocol


2
  • 1
    OK, 100 kHz is the standard frequency of the Pi's I²C bus. And yes, after I had already ruined the I²C bus of one oy my Pis, I'm now using a level shifter (3.3 V → 9 V, which is the operating voltage of the mixer).
    – Neppomuk
    Jun 8, 2021 at 19:54
  • 1
    @Neppomuk, yes, (1) Using a 3V3 to 9V0 level shifter is the safest approach. (2) If you are using Rpi's standard built in on board I2C pins, there are by default, strong built in 1k8 pullups (50k or other pins). so there is a high chance that Rpi 3V3 GPIO can direct interface to TDA7318 (without any pull up resistors on TDA7138 side) Good luck and have a great audio project. Cheers.
    – tlfong01
    Jun 9, 2021 at 2:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.