Connecting to amp through DAC

Status
Not open for further replies.

snusmumriken

Active member
Please can someone help with this? I have searched this forum and the web, but find very little about using the Teensy audio capability with speakers.

I've got my Teensy 3.2 + audio board happily playing the SDTEST.WAV files, or my own .WAV file, from the SD card, and I can listen via the headphone jack.
However, I can't seem to persuade it to output anything to my amp via the DAC output. There is some hiss from the speaker, but no signal.

Hardware:
Teensy 3.2
Audio board
Adafruit PAM8302A
8ohm Visaton speaker (what I happened to have)

I have connected A+ on the amp to A14/DAC, and A- to GND.
I am powering both from 4AA LiFe batteries via a Polulu step-down 5V regulator.
GND is common throughout.

Code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioPlaySdWav           playWav1;     
AudioOutputAnalog        dac1;           
AudioConnection          patchCord1(playWav1, 0, dac1, 0);
AudioControlSGTL5000     sgtl5000_1;     

#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14

void setup() {
  Serial.begin(9600);

  AudioMemory(8);

  sgtl5000_1.enable();
  sgtl5000_1.volume(0.4);

  SPI.setMOSI(SDCARD_MOSI_PIN);
  SPI.setSCK(SDCARD_SCK_PIN);
  if (!(SD.begin(SDCARD_CS_PIN))) {
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
}

void playFile(const char *filename)
{
//  Serial.print("Playing file: ");
//  Serial.println(filename);

  playWav1.play(filename);

  // A brief delay for the library read WAV info
  delay(5);

  while (playWav1.isPlaying()) {
  }
}

void loop() {
  playFile("LAPWING.WAV");  
  while(true); 
  }
 
Update:
I've moved the GND and A- connections on the AMP to AGND on the Teensy. This made a kind of sense. It has cut out the background hiss, and the speaker still clicks at power up, but still no signal.
 
Why are you connecting to the Teensy if you have an audio board?

Use a line out and ground from the audio connector pins from the audio board.
 
Ahhhh, thanks so much. I misunderstood: I thought the line-out was digital. Working fine now.

This project has a serious conservation potential for engdangered wading birds, so I was keen to get it up and running during the next few days. I hope that is a plus for you too?!
 
Status
Not open for further replies.
Back
Top