Changing Chip Select of Audio Adapter?

Status
Not open for further replies.

cosmictea

Member
Hello,

I have a teensy 3.2 and the Audio Adapter sold by pjrc. I accidentally cut through the PCB board of the teensy working on another project and pins 9 and 10 are now not connected to the Teensy chip.

I know that the Audio Adapter's SD chip select is digital pin 10. I am attempting to run the Audio Tutorial Part 2-2 which is below:

// Part 2-2: Mixers & Playing Multiple Sounds


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

// GUItool: begin automatically generated code
AudioPlaySdWav playSdWav2; //xy=93,155
AudioPlaySdWav playSdWav1; //xy=104,80
AudioMixer4 mixer1; //xy=340,144
AudioMixer4 mixer2; //xy=360,231
AudioOutputI2S i2s1; //xy=533,107
AudioConnection patchCord1(playSdWav2, 0, mixer1, 1);
AudioConnection patchCord2(playSdWav2, 1, mixer2, 1);
AudioConnection patchCord3(playSdWav1, 0, mixer1, 0);
AudioConnection patchCord4(playSdWav1, 1, mixer2, 0);
AudioConnection patchCord5(mixer1, 0, i2s1, 0);
AudioConnection patchCord6(mixer2, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=492,312
// GUItool: end automatically generated code

#define SDCARD_CS_PIN 10


void setup() {
Serial.begin(9600);
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
SPI.setMOSI(7);
SPI.setSCK(14);
if (!(SD.begin(SDCARD_CS_PIN))) {
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
pinMode(13, OUTPUT); // LED on pin 13
mixer1.gain(0, 0.5);
mixer1.gain(1, 0.5);
mixer2.gain(0, 0.5);
mixer2.gain(1, 0.5);
delay(1000);
}

void loop() {
if (playSdWav1.isPlaying() == false) {
Serial.println("Start playing 1");
playSdWav1.play("SDTEST1.WAV");
delay(10); // wait for library to parse WAV info
}
if (playSdWav2.isPlaying() == false) {
Serial.println("Start playing 2");
playSdWav2.play("SDTEST4.WAV");
delay(10); // wait for library to parse WAV info
}
}

And of course I get the following error when I run this:

"Unable to access the SD card"

Which I am assuming is being cause by the fact that I sawed off the connection of the Teensy digital pin 10 to the rest of the board. Is this a correct assumption?

Also, is there any way around this that you can see. Can I connect, say, digital pin 21 (which is also a Chip select pin) to the SD chip select pin on the Audio Board and read the card this way?

Thank you
 
Status
Not open for further replies.
Back
Top