TPA2016 very low volume

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
denniscj7
 
Posts: 51
Joined: Sun Feb 27, 2011 11:45 am

TPA2016 very low volume

Post by denniscj7 »

I ran the audioamptest example and could only hear a faint volume. I then moved the AGC off code to the end of startup to ensure it was off. NOTE; the input to this amplifier is the output of the FX Sound Card - the one with NO volume control. I then added a 10k pot to A0 and mapped its value 0-1023 to 0-30 db for gain. At min, I hear nothing, at max I hear it faintly. First time using this amp card, what am I missing?

Here's the code -

Code: Select all

#include <Wire.h>
#include "Adafruit_TPA2016.h"

Adafruit_TPA2016 audioamp = Adafruit_TPA2016();
int vol;
void setup() {
 Serial.begin(9600);
 
 
 Serial.println("TPA2016 Audio Test"); 
 audioamp.begin();
 
 // Dump register map, for debugging purposes.
 /*
 for (uint8_t i=1; i<8; i++) {
   Serial.print("Register #"); Serial.print(i); 
   Serial.print(": 0x");
   Serial.println(audioamp.read8(i), HEX);
 }
 */
 
  // Turn off AGC for the gain test
  audioamp.setAGCCompression(TPA2016_AGC_OFF);
  // we also have to turn off the release to really turn off AGC
  audioamp.setReleaseControl(0);
  
  // We can update the gain, from -28dB up to 30dB
  for (int8_t i=-28; i<=30; i++) {
    Serial.print("Gain = "); Serial.println(i); 
    audioamp.setGain(i);
    delay(500);
  }
  
  // Each channel can be individually controlled
  Serial.println("Left off");
  audioamp.enableChannel(true, false);
  delay(1000);
  Serial.println("Left On, Right off");
  audioamp.enableChannel(false, true);
  delay(1000);
  Serial.println("Left On, Right On");
  audioamp.enableChannel(true, true);
  delay(1000);

  // OK now we'll turn the AGC back on and mess with the settings :)
  
  // AGC can be TPA2016_AGC_OFF (no AGC) or
  //  TPA2016_AGC_2 (1:2 compression)
  //  TPA2016_AGC_4 (1:4 compression)
  //  TPA2016_AGC_8 (1:8 compression)
  Serial.println("Setting AGC Compression");
  audioamp.setAGCCompression(TPA2016_AGC_2);

  // See Datasheet page 22 for value -> dBV conversion table
  Serial.println("Setting Limit Level");
  audioamp.setLimitLevelOn();
  // or turn off with setLimitLevelOff()
  audioamp.setLimitLevel(25);  // range from 0 (-6.5dBv) to 31 (9dBV)
  
  // See Datasheet page 23 for value -> ms conversion table
  Serial.println("Setting AGC Attack");
  audioamp.setAttackControl(5);
  
  // See Datasheet page 24 for value -> ms conversion table
  Serial.println("Setting AGC Hold");
  audioamp.setHoldControl(0);
  
  // See Datasheet page 24 for value -> ms conversion table
  Serial.println("Setting AGC Release");
  audioamp.setReleaseControl(11);
  
  // Turn off AGC for the gain test
  audioamp.setAGCCompression(TPA2016_AGC_OFF);
  // we also have to turn off the release to really turn off AGC
  audioamp.setReleaseControl(0);
}


void loop() {
	vol=map(analogRead(A0),0,1023,0,30);
	Serial.print("Gain = "); Serial.println(vol); 
    audioamp.setGain(vol);
	delay(400);
}

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TPA2016 very low volume

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

User avatar
denniscj7
 
Posts: 51
Joined: Sun Feb 27, 2011 11:45 am

Re: TPA2016 very low volume

Post by denniscj7 »

File Mar 12, 3 32 20 PM.jpg
File Mar 12, 3 32 20 PM.jpg (249.97 KiB) Viewed 241 times
File Mar 12, 3 31 22 PM.jpg
File Mar 12, 3 31 22 PM.jpg (285.98 KiB) Viewed 241 times
In the first pic notice the green audio plug in lower right. That is taking audio from FX board to a set of amplified PC speakers. This works as expected volume is fine.

The R+ and L+ lines go to the TPA board inputs. The pot controls volume and at low, there is no sound at all, at high there is a very low sound level.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”