Teensyduino 1.21 Released

Status
Not open for further replies.
Am I correct that the K20 used in the T3.1 and LC do not have an SDIO interface (such that uSD cards must use SPI)?
 
I still haven't implemented the path traversal stuff. Will do that soon.

You can open files in subdirs using openNextFile(). But normal SD.open() still only works for the root dir, because it's not parsing pathnames yet.
 
Please let me know how it works for you? Don't forget to uncomment USE_TEENSY3_OPTIMIZED_CODE...

ok, I only got back yesterday, so couldn't try until today -- it almost works for me. i've been testing with play_sd_wav, in which case I get pops every now and again.

i've also edited sd_play_wav:: play() along the lines suggested (added AudioStopUsingSPI()); kinetis.h by now already seems to come with "volatile("CPSID i":::"memory");" (I'm on 1.6.4 / teensy 1.23-beta). if i comment out USE_TEENSY3_OPTIMIZED_CODE again / go back to regular SD, the pops disappear, so I assume the file is ok. not sure what might be the problem. here's my test code (i'm triggering with an external pulse on pin 0; note the SGTL5000 init code snippet is missing, as I'm using a different codec).


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


#define CS_MEM 6
#define CS_SD  10
#define CLK_L 0 // left clock input

volatile uint8_t LCLK; // left channel clock

void CLK_ISR_L()
{ 
  LCLK = true; 
}

AudioPlaySdWav     wavL;
//AudioPlaySdWav     wavR;
AudioMixer4        mix;
AudioOutputI2S     codec;

// Create Audio connections between the components
//
AudioConnection c1(wavL, 0, mix, 0);
AudioConnection c2(wavL, 0, mix, 1);
AudioConnection c3(mix, 0, codec, 0);
AudioConnection c4(mix, 0, codec, 1);

// using pcm5102a
// AudioControlSGTL5000 audioShield; 


void setup() {
 
  AudioMemory(15);
  pinMode(CS_SD, OUTPUT);
  pinMode(CS_MEM, OUTPUT);
  digitalWrite(CS_MEM, HIGH);

  pinMode(CLK_L, INPUT_PULLUP);
  
  attachInterrupt(CLK_L, CLK_ISR_L, FALLING);

  SPI.setMOSI(7);
  SPI.setSCK(14);
  if (SD.begin(CS_SD)) Serial.println("ok");

}

void loop() {

 while(1) {
   
     if (LCLK) { 
         LCLK = false;
         wavL.play("ATARI.WAV");
  }
 }
}

edit. similar behaviour with play_sd_raw. in this case no pops, but the audio file sounds chopped up, as if playing from somewhere in the middle of the file and then wrapping around; it sounds perfectly normal when I revert to regular SD. as it seems to be working for others, I'm beginning to wonder whether I haven't missed something ? -- kinetis.h, play_sd_raw:: play() -- anything else that might need editing?
 
Last edited:
Can you send me the files you're playing, like ATARI.WAV? If so, I'll put this on my list of things to test.

ok, where do I send it to? i didn't want to post it because of IP/copyright ... it's a/the official atari "corporate tag" from the early 1980s (suzanne ciani, actually); maddening, but i found voice samples are good for testing.
 
Status
Not open for further replies.
Back
Top