TI PCM3168A Audio Control Object

coconuttopdrop

New member
Hi guys,
First time posting so start by thanking Paul for his amazing work.

I'm developing a multitrack DSP solution for academic purposes.
I'm using a Teensy 3.6, and for the project I need at least 8 Out's and TDM so and I'v opted to use the Texas Inst. PCM3168A
http://www.ti.com/product/PCM3168A


I'm coding the audio Audio Control Object for the PCM but i'm finding many roadblocks, mainly because I can't wrap my head around what's happening between the other control files and the audio lib ... So I come to you, ho mighty community, in hope you can shed some light as and help get out of noob lane.
I've set up a repository with what i'v developed this far.
https://github.com/lfpneto/Control_Pcm3168a

I2S control is working (yey!), but i can't get any sound into the thing(PCM3168a)!!
I'm using a white noise object, Teensy 3.6 TXD0 (pin 22) into PCM DIN 1 (pin 37).

The code:
Code:
/* BASED ON TONE SWEEP EXAMPLE
*/

#include <Audio.h>
//#include "Wire.h"
#include <i2c_t3.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "Control_Pcm3168a.h"

// WHITENOISE
// AudioSynthToneSweep  myEffect;
AudioSynthNoiseWhite    myEffect;
AudioOutputI2S          audioOutput;        // audio shield: headphones & line-out

// The WHITENOISE goes to left and right channels
AudioConnection c1(myEffect, 0, audioOutput, 0);
AudioConnection c2(myEffect, 0, audioOutput, 1);

AudioControlPCM3168A  PCM3168A(true);

// when there is a call to function inputSelect(), 
// expected to return do serial port AUDIO_INPUT_LINEIN address
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_MIC;


void setup() {

  Serial.begin(9600);
  while (!Serial) ;
  delay(3000);


  // ******
  // ******
  PCM3168A.TesteSerial();
  //PCM3168A.setSlaveAddress();
  //PCM3168A.readReg(0x41);
  //PCM3168A.readReg(0x51);
  //PCM3168A.disable();
  //PCM3168A.MasterReset();
  //PCM3168A.Resynch();


  // ******
  // ****** BLINK
  pinMode(13, OUTPUT); // initialize the digital pin as an output.
  digitalWrite(13, HIGH);   // set the LED on

  // Audio connections require memory to work.  For more
  // detailed information, see the MemoryAndCpuUsage example
  AudioMemory(12);


  // Enable the audio shield, select input, and enable output
  PCM3168A.enable();
  delay(100);
  PCM3168A.begin(4);
  //Mode 1 - DAC I2S Slave - ADC I2S Slave
  //Mode 2 - DAC I2S Master - ADC I2S Slave
  //Mode 3 - DAC I2S Slave - ADC I2S Master
  //Mode 4 - DAC I2S Master - ADC I2S Master


  PCM3168A.inputSelect(myInput);
  PCM3168A.volume(1);
  //PCM3168A.Resynch();
  delay(100);
  PCM3168A.readAllReg();


myEffect.amplitude(1);

digitalWrite(13, LOW);   // set the LED on
}
void loop() {

  // ******
  // ****** BLINK
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);                  // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);                  // wait for a second
}
 
I've updated the code to include a modified version of the WireKinetis files in the Wire library.
Only compatible with a modified Audio library...
 
Hi,
I'm hoping to migrate from the soon to be obsolete CS42448 CODEX to the PCM3168A for my T4 Laser Synth project, which brought me to your github repo. But, only found your library files.
Have you had any success with getting the PCM3168A up and running?
If so, are you using I2S mode or TDM?
Do you have any schematics?
Thanks!
 
Back
Top