Teensy 3.6 + Propshield to play MP3

Status
Not open for further replies.
Hi,

I have been trying to get my Teensy 3.6 and Propshield to play mp3 files from the onboard sd card.

It isn't working at all and guidance would be much appreciated.

I have connected the following pins:

Teensy 3.6 ----------------> Propshield

DA0 ----------------> DAC

Analog GND ----------------> Agnd

VIN -----------------> 5V

GND -----------------> GND

I have connected the boards directly to each other and so there are other pins connected - but nothing that shouldn't be. The DAC0 pin is connected to DAC via a cable. I am not using any external power other than USB. I have tried the EXTERNAL option and connected 5V and GND to a 5v supply alongside the speaker terminals but this never worked either (I assume that is power for the amp?).

The SD card told me it was playing the file and I have also tried using the sinewave option to generating sound but nothing.

I have been using code I found on the forum as following any help is much apreciated.


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

// from: https://forum.pjrc.com/threads/33328-Prop-Shield-Beta-Test?p=99236&viewfull=1#post99236
// modified by Michael Meissner

// GUItool: begin automatically generated code
AudioSynthWaveformSine   sine1;          //xy=180,469
AudioOutputAnalog        dac1;           //xy=380,468
AudioConnection          patchCord1(sine1, dac1);
// GUItool: end automatically generated code

int freq = 1000;

void setup() {
  Serial.begin(115200);
  while (!Serial)
    ;
  Serial.println("Setting up");
  pinMode(5, OUTPUT);
  digitalWrite(5, 1);      // Enable Amplified.
  AudioMemory(12);
  sine1.amplitude(1.0);
  sine1.frequency(freq);
  Serial.println("Send + to increase freq, - to decrease freq, a to turn off amp, A to turn on amp, or num for freq.");
}

void loop()
{
  if (Serial.available()) {
    int ch = Serial.read();
    switch (ch)
      {
      case '+':
   freq += 100;
   sine1.frequency(freq);
   Serial.print ("New frequency ");
   Serial.println (freq);
   break;

      case '-':
   freq -= 100;
   sine1.frequency(freq);
   Serial.print ("New frequency ");
   Serial.println (freq);
   break;

      case 'a':
   digitalWrite (5, 0);
   Serial.println ("Amp off");
   break;

      case 'A':
   digitalWrite (5, 1);
   Serial.println ("Amp on");
   break;

      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
   {
     bool looping = true;
     freq = ch - '0';
     do
       {
         if (Serial.available ())
      {
        ch = Serial.read ();
        if (ch >= '0' && ch <= '9')
          freq = (freq * 10) + (ch - '0');
        else
          looping = false;
      }
       }
     while (looping);
   }

   Serial.print ("New frequency ");
   Serial.println (freq);
   sine1.frequency(freq);
   break;

      case ' ':
      case '\n':
      case '\t':
      case '\r':
   break;

      default:
   Serial.print ("Unknown character '");
   Serial.print ((char) ch);
   Serial.print ("'");
      }
  }
}
 
What I sometimes do is try out some other library to see if it works.

Example: Try using one of the examples for Talkie library, like Vocab_US_Large, it is already setup to use pin 5 to turn on the amp...
Does it say something? If so you know your hardware is working.
 
Thanks - still nothing - is DAC0 alright or should it be connected to DAC1? Does the amp need a seperate power supply or should it be ok.
 
I am pretty sure DAC0 is the correct one. Next up I would verify the voltage going into VIN of the propshield. Also I don't see any place it needs the 3.3v for the amplifier, I would probably make sure it is connected as well and verify that it is correct.

Also in your first post you did not mention pin 5 connected, but your second post implies that it is.

Might help to know what the output of the amplifier is hooked up to.... Pictures?
 
5v is on vin I have run the propshield motion sensors and they are working.

Pin 5 is connected.

I have tested the speaker separately and it is working.

Speaker is conencted on - and +.

I will send a picture shortly.
 
if you have all of the edge pins of shield going to T3.6 pins, then the only other wires you need are speaker + - and jumper from AudioIn to teensy DAC0
 
Last edited:
On Talkie - T_3.6/3.5 is set up for DAC0 on A21::
#if defined(__MKL26Z64__)
analogWrite(A12, nextPwm);
#elif defined(__MK20DX128__) || defined(__MK20DX256__)
analogWrite(A14, nextPwm);
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
analogWrite(A21, nextPwm);
#else
 
Status
Not open for further replies.
Back
Top