no sound output on tda7439.

Hi,
stil newbie here…
but hope i finish before christmas with my prosject.

I manange to compile my arduino nano and tda7439,
but there is no sound out.
I can see that it responds in i2c scanner, with adress 0x44,
somebody how can se if the code is right, with wire address and so.
i put this in the main sketch.
also has lcd and remote control.

thanks for any ideas ??

//Sound Processor chip library
#include <TDA7439.h>
TDA7439 equ;

and

#ifndef TDA7439_H
#define TDA7439_H

//chip **7 bit** address
// Datasheet says 0x88 but that is the 8 bit
// address. Wire.h automatically appends the 
// extra (lsb write) bit.
#define TDA7439_address 0x44 

//Sub addresses
#define TDA7439_input_sel 0x00
#define TDA7439_input_gain 0x01
#define TDA7439_volume 0x02
#define TDA7439_bass 0x03
#define TDA7439_middle 0x04
#define TDA7439_trebble 0x05

#define TDA7439_ratt 0x06
#define TDA7439_latt 0x07

// Input selection
#define TDA7439_input_1 0x03
#define TDA7439_input_2 0x02
#define TDA7439_input_3 0x01
#define TDA7439_input_4 0x00

//TDA7439 input gain in db (x 2)
//0x00 -> 0x0F 

//TDA7439 volume (-db)
//0x00 -> 0x2F
#define TDA7439_mute 0x38  //Mute main volume

#include <Arduino.h>
class TDA7439
{
  public:
    TDA7439();
	void setInput(int input); // 1 to 4
	void inputGain(int gain); // 0 to 30
	void setVolume(int volume); // 0 to 48 ( 0 is mute)
	void setSnd(int val, int range); //-7 to +7 , 1 - Bass | 2 - Mids | 3 - Trebble
	void mute();
	void spkAtt(int att); // Output attenuation 0 to 79 (db) can be used for balance but not enabled in this code.
  private:
	void writeWire(char a, char b);
};
	
#endif //TDA7439_H

and the .cpp file

#include <Arduino.h>
#include <Wire.h>
#include "TDA7439.h"

TDA7439::TDA7439(){
	Wire.begin();
}

void TDA7439::setInput(int input){
  switch (input) {
    case 1: input = TDA7439_input_1;break;
	case 2: input = TDA7439_input_2;break;
	case 3: input = TDA7439_input_3;break;
	case 4: input = TDA7439_input_4;break;
  }
  writeWire(TDA7439_input_sel,input);	
  } 

void TDA7439::inputGain(int gain){
  writeWire(TDA7439_input_gain,gain);
}

void TDA7439::setVolume(int volume){
  if (volume == 0){
    volume = TDA7439_mute;
	}else{
	  volume = 48 - volume;
  }
  writeWire(TDA7439_volume,volume);
}

void TDA7439::setSnd(int val, int range){
  switch (range){
    case 1:range = TDA7439_bass;break;
	case 2:range = TDA7439_middle;break;
	case 3:range = TDA7439_trebble;break;
  }
  switch (val){
    case -7:val = 0;break;
	case -6:val = 1;break;
	case -5:val = 2;break;
	case -4:val = 3;break;
	case -3:val = 4;break;
	case -2:val = 5;break;
	case -1:val = 6;break;
	case 0 :val = 7;break;
	case 1 :val = 14;break;
	case 2 :val = 13;break;
	case 3 :val = 12;break;
	case 4 :val = 11;break;
	case 5 :val = 10;break;
	case 6 :val = 9;break;
	case 7 :val = 8;break;
  }
	  
writeWire(range,val);
}

void TDA7439::mute(){
  writeWire(TDA7439_volume,TDA7439_mute);
}

void TDA7439::spkAtt(int att){
  // Mainly used to override the default attenuation of mute at power up
  // can be used for balance with some simple code changes here.
  writeWire(TDA7439_ratt,att);
  writeWire(TDA7439_latt,att);
}

void TDA7439::writeWire(char a, char b){
  Wire.beginTransmission(TDA7439_address);
  Wire.write (a);
  Wire.write (b);
  Wire.endTransmission();
}

So how have you got this wired up?

The data sheet says:-

Pull-up resistors to the positive supply voltage must be used (there are no internal pull-ups).

and also a supply of typically 9V but a minimum of 6.

This means it can't be connected to the arduino without level shifting circuits.

Hi.
I got i wired as the picture a attach here,
Im positive that all got it all wired upp right,
the clock works, on the sda, scl line,
and all seems right on the curcuit board.
but You never know…
I got the tda to answer with i2c scan with 0x44,
so thats good.
I belive thats a code somewhere whos off,
but i dont really know now…

i attach link to website where i have the layout

http://niklas51.wix.com/nikotronic

the layout of the board.

Actually the layout is of very limited use, it is a schematic that tell the tale. Have you a link to the libary as well?

sorry, dont have the whole scematics on this board, but its based on the test curcuit from its datasheet, link to it.

i have as the board shows pullopp resistors with 4,7k ohm connected to 5v.

hope that make it more clear.

hope that make it more clear.

Sorry but no.

That is just a page out of the data sheet, I can read the data sheet.

Look that chip works, there have been thousands of them made and used. You can not get it to work so what we have to do is to find out what you are doing wrong. What have you given us that would point to that?

Well you have posted some code that used a library that is a bit obscure to say the least, and you have not posted a link to it.

Then there is a PCB layout which to be honest is just a mash of links and holes. Did you not have to draw a schematic in order to lay this out?

Unless something is more forthcoming there is little I can do to help.

hi and thanks Grumpy_mike, I been checking the pcb board, and could not find any thing but then I connected a probe to pin 9 on the chip, and got sound,I will figure it out soon, Atleast its not the coding on the arduino.

no I only have to figure out how to get the encoder to work for volume.

best regards and happy holidays over christmas. :) :) :)

HI, i trying to continue here to see if there is someone how has expert skills in programming,
I have tripple checked the board, and the tda7439 is connected right with pullup resistors, everything else works on the sda scl line, I can address the chip on i2c bus line on 0x44, it responds.
I would like to get the sound out, i know there is sound going in to the chip and none out.i thought I solved it but my mistake.
and i think there could be some thing in the sketch, .ino file.
I attach it it here,

i think there is something on the configuration part,
im not expert but it looks odd…

I believe that it could be somewhere around
equ.inputGain config files and so on,
and
this is from the tda7439.h fileon github

#ifndef TDA7439_H
#define TDA7439_H

//chip **7 bit** address
// Datasheet says 0x88 but that is the 8 bit
// address. Wire.h automatically appends the 
// extra (lsb write) bit.
#define TDA7439_address 0x44 

//Sub addresses
#define TDA7439_input_sel 0x00
#define TDA7439_input_gain 0x01
#define TDA7439_volume 0x02
#define TDA7439_bass 0x03
#define TDA7439_middle 0x04
#define TDA7439_trebble 0x05

#define TDA7439_ratt 0x06
#define TDA7439_latt 0x07

// Input selection
#define TDA7439_input_1 0x03
#define TDA7439_input_2 0x02
#define TDA7439_input_3 0x01
#define TDA7439_input_4 0x00

//TDA7439 input gain in db (x 2)
//0x00 -> 0x0F 

//TDA7439 volume (-db)
//0x00 -> 0x2F
#define TDA7439_mute 0x38  //Mute main volume

#include <Arduino.h>
class TDA7439
{
  public:
    TDA7439();
	void setInput(int input); // 1 to 4
	void inputGain(int gain); // 0 to 30
	void setVolume(int volume); // 0 to 48 ( 0 is mute)
	void setSnd(int val, int range); //-7 to +7 , 1 - Bass | 2 - Mids | 3 - Trebble
	void mute();
	void spkAtt(int att); // Output attenuation 0 to 79 (db) can be used for balance but not enabled in this code.
  private:
	void writeWire(char a, char b);
};
	
#endif //TDA7439_H

and this part from the tda7439.cpp from github

#include <Arduino.h>
#include <Wire.h>
#include "TDA7439.h"

TDA7439::TDA7439(){
  Wire.begin();
 }

void TDA7439::setInput(int input){
  switch (input) {
    case 1: input = TDA7439_input_1;break;
  case 2: input = TDA7439_input_2;break;
  case 3: input = TDA7439_input_3;break;
  case 4: input = TDA7439_input_4;break;
  }
  writeWire(TDA7439_input_sel,input); 
  } 

void TDA7439::inputGain(int gain){
  writeWire(TDA7439_input_gain,gain);
}

void TDA7439::setVolume(int volume){
  if (volume == 0){
    volume = TDA7439_mute;
  }else{
    volume = 48 - volume;
  }
  writeWire(TDA7439_volume,volume);
}

void TDA7439::setSnd(int val, int range){
  switch (range){
    case 1:range = TDA7439_bass;break;
  case 2:range = TDA7439_middle;break;
  case 3:range = TDA7439_trebble;break;
  }
  switch (val){
    case -7:val = 0;break;
  case -6:val = 1;break;
  case -5:val = 2;break;
  case -4:val = 3;break;
  case -3:val = 4;break;
  case -2:val = 5;break;
  case -1:val = 6;break;
  case 0 :val = 7;break;
  case 1 :val = 14;break;
  case 2 :val = 13;break;
  case 3 :val = 12;break;
  case 4 :val = 11;break;
  case 5 :val = 10;break;
  case 6 :val = 9;break;
  case 7 :val = 8;break;
  }
    
writeWire(range,val);
}

void TDA7439::mute(){
  writeWire(TDA7439_volume,TDA7439_mute);
}

void TDA7439::spkAtt(int att){
  // Mainly used to override the default attenuation of mute at power up
  // can be used for balance with some simple code changes here.
  writeWire(TDA7439_ratt,att);
  writeWire(TDA7439_latt,att);
}

void TDA7439::writeWire(char a, char b){
  Wire.beginTransmission(TDA7439_address);
  Wire.write (a);
  Wire.write (b);
  Wire.endTransmission();
}

the main file i attach under.
happy new year :slight_smile: :slight_smile: :slight_smile:

knights_stereo.ino (19.9 KB)