• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital Audio Amp I2S no sound

Status
Not open for further replies.

Frozenguy

Member
Hi everyone thanks for looking.

I am working with the TAS6422 Class D digital Amp from TI
http://www.ti.com/lit/ds/symlink/tas6422-q1.pdf

The DIR9001 digital audio interface receiver (optical in) from TI
http://www.ti.com/lit/ds/symlink/dir9001.pdf

I copied this design from TI off of their eval board for the TAS6422 and DIR9001 combo.
http://www.ti.com/lit/ug/slou464a/slou464a.pdf


The problem is this: The WARN pin is immediately asserted, and I have no sound. Open drain, I have an LED tied to it. Datasheet will tell you WARN pin asserts for three reasons: Over temperature, clipping, and power on reset. Scope shows it turning on within 2ms after a 2.2A spike, just as 14.4V begins to ramp up. 14.4V takes about 15ms to ramp up.

PVDD and VBAT are tied together getting 14.4V. VDD gets 3.3V.

On DIR9001, I tied the external oscilator input to ground to force the DIR to use PLL. I also brought CKSEL low to facilitate this.

Thank you for your time. I'll upload a schematic soon but if someone could help out with any ideas in the meantime, I would appreciate it.
 

rjenkinsgb

Well-Known Member
Most Helpful Member
The TAS6422 has an I2C interface and appears to need configuring via this after a power-on reset, to set it up for whatever operation it's supposed to be doing.

That's presumably done by the other device on the evaluation board.

See page 32 on in the 6422 datasheet.
 

Frozenguy

Member
The TAS6422 has an I2C interface and appears to need configuring via this after a power-on reset, to set it up for whatever operation it's supposed to be doing.

That's presumably done by the other device on the evaluation board.

See page 32 on in the 6422 datasheet.
Hey rjenkinsgb thanks for the response.

I'm having trouble with the code to access these registers. More specifically I'm haivng trouble implementing wire.h to use with the TAS6422.

Holding both address pins low on TAS6422 will give it the i2c write address of 0xD4 and read i2c address of 0xD5.
To clear the latched WARN pin, pg 27 says: "The warning bit is sticky and can be cleared by the CLEAR FAULT bit (bit 7) in register 0x21 "

This is the part of the code I'm having trouble with:
Code:
 Wire.beginTransmission(byte(0xD4));  //   device address for writing
    Wire.write(byte(0x21));                                          // register address
    wire.write(byte(1000000));                                  // set bit 7 (clear WARN) high; set bits [6:0] low
    wire.endTransmission();                                       // end transmission
I don't know how to specify a 1 for the 7th bit. Page 43, figure 70 + table 33 says I should write bit 7 high. I'm a newb. Why does it say address = 0x21 but then says default is 0x00? Is that the bit settings 0x00? The other registers have other defaults, but I dont see how they correlate to 1's and 0's in binary.

This is my whole code as of now. It's not done yet. : (I was using LED for debuging while a coworker was using my ftdi cable i was gonna use for serial monitor)
Code:
#include <Wire.h>

#define tas
#define clrWARN 3   // button to clear WARN pin
#define readTAS 2   // button to read TAS6422 registers over i2c
#define led1  8     // LED1
#define led2  9     // LED2

// variables will change:
int clrWARNs = 0;         // State variable for reading the button used to clear latched WARN pin
int readTASs = 0;         // State variable for reading the button used to command i2c read


void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(clrWARN, INPUT);
  pinMode(readTAS, INPUT);
 
  Wire.begin();
  Serial.begin(9600);
  Serial.println("TAS6422 Diagnostics");
 
}


void loop() {
  clrWARNs = digitalRead(clrWARN);
 
  readTASs = digitalRead(readTAS);
 
  if (clrWARNs == HIGH) {
    digitalWrite(led1, HIGH);
    Wire.beginTransmission(byte(0xD4));
    Wire.write(byte(0x21));
    Wire.write(byte(1000000));

  
    delay(500);

  }
  else {
digitalWrite(led1, LOW);
  }

  if (readTASs == HIGH) {
    digitalWrite(led2, HIGH);
    Wire.requestFrom(1, 8);   // Ask slave#1 for 8 bytes

    while (Wire.available()) {
        char c = Wire.read();
        Serial.println(c);
        delay(500);
    }
  }
  else {
    digitalWrite(led2, LOW);
  }


 
}
 

rjenkinsgb

Well-Known Member
Most Helpful Member
Code:
Wire.beginTransmission(byte(0xD4)); // device address for writing
Wire.write(byte(0x21)); // register address
wire.write(byte(1000000)); // set bit 7 (clear WARN) high; set bits [6:0] low
wire.endTransmission(); // end transmission
You are one bit out of step, trying to set bit 7; remember bit numbers start at zero.

Try
wire.write(byte(10000000));
or use hex rather than binary:
wire.write(byte(0x80));

(I don't have time at the moment to go through the data sheet or examine other code, sorry).
 

Frozenguy

Member
You are one bit out of step, trying to set bit 7; remember bit numbers start at zero.

Try
wire.write(byte(10000000));
or use hex rather than binary:
wire.write(byte(0x80));

(I don't have time at the moment to go through the data sheet or examine other code, sorry).
That helps immensely, thank you.
So that is hex. Ok I like that much better and now I know what I’m converting to. This basically clears all my current known road blocks. I should be able to continue on with that.

Thanks!
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top