Hello Friends,
I've been working on this project for a while, it started with other TI chips I've posted about on this forum. I'm looking for some help, if you don't mind. I have two PCM5242 EVM modules and a PCM1865 module on a (rather large) breadboard.
I have the first PCM5242 connected to USB and the on-board I2C programmer will program the chip using the TI Purepath Console. That software loads up the default parameters to make the chip play. Don't worry about the console or understanding it. What you need to know is that the Purepath Console 2 -> USB -> TAS chip -> PCM5242 to program it via I2C. Then I have the Teensy sending I2S signals to the PCM5242 via that breadboard and jumpers. When I do this, I can play USB audio through to the chip.... It works fine.
Purepath console 2 = Programming the chip (unmuting it)
Teensy = Sending I2S
WORKING...
OK. So now i want to remove the Purepath Console and Program the PCM5242 with the Teensy, NOT via the Purepath Console 2 -> USB....
The second PCM5242 is connected to the teensy with both I2C and I2S (whereas the first one is just I2S on Teensy, and I2C is via the Tas/USB/Purepath programmer). This second PCM5242 is on address 0x4C, an I2C scanner I have verifies this. I need some code to write these values at startup of the application.
This was a essentially a dump from the purepath console...
That's what I believe to be the minimum configuration via I2C to make the card play music coming in via I2S connected only to the Teensy (no purepath). Can someone please help me add some code to my existing code (above) to write those values to the registry at the start of the application? I know this is pretty straightforward code. I'm still learning and I lean on modifying existing code at this point. I figure if I can get some code to write values to the device, I can finish confirming my hardware. Once the hardware setup is confirmed with the PCM5242, I'll use the same code to then configure the PCM1865 and confirm that too with the goal of playing audio coming in from the PCM1865 through to the PCM5242.
Then I'll test it using TDM... and I should be able to get both PCM5242 and all 4 lines of the PCM1865 running on the teensy.
Any help on how to dump those registry values to the I2C lines? Thanks for the help!
Jay
I've been working on this project for a while, it started with other TI chips I've posted about on this forum. I'm looking for some help, if you don't mind. I have two PCM5242 EVM modules and a PCM1865 module on a (rather large) breadboard.
I have the first PCM5242 connected to USB and the on-board I2C programmer will program the chip using the TI Purepath Console. That software loads up the default parameters to make the chip play. Don't worry about the console or understanding it. What you need to know is that the Purepath Console 2 -> USB -> TAS chip -> PCM5242 to program it via I2C. Then I have the Teensy sending I2S signals to the PCM5242 via that breadboard and jumpers. When I do this, I can play USB audio through to the chip.... It works fine.
Purepath console 2 = Programming the chip (unmuting it)
Teensy = Sending I2S
WORKING...
Code:
// Code to pass through USB audio to the I2S on the teensy.... Working when the Purepath Console 2 "pre-configures" the module.
///////////////////////////////////
// copy the Design Tool code here
///////////////////////////////////
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputUSB usb1; //xy=216,230.99999237060547
AudioOutputI2S i2s1; //xy=649,250.99999237060547
AudioConnection patchCord1(usb1, 0, i2s1, 0);
AudioConnection patchCord2(usb1, 1, i2s1, 1);
// GUItool: end automatically generated code
void setup() {
Serial.begin(9600);
AudioMemory(500);
delay(1000);
}
void loop() {
// do nothing
// print a summary of the current & maximum usage
Serial.print("CPU: ");
Serial.print("all=");
Serial.print(AudioProcessorUsage());
Serial.print(",");
Serial.print(AudioProcessorUsageMax());
Serial.print(" ");
Serial.print("Memory: ");
Serial.print(AudioMemoryUsage());
Serial.print(",");
Serial.print(AudioMemoryUsageMax());
Serial.print(" ");
Serial.print("Send: (R)eset, (S)lower, (F)aster");
Serial.println();
// very simple timing :-)
}
OK. So now i want to remove the Purepath Console and Program the PCM5242 with the Teensy, NOT via the Purepath Console 2 -> USB....
The second PCM5242 is connected to the teensy with both I2C and I2S (whereas the first one is just I2S on Teensy, and I2C is via the Tas/USB/Purepath programmer). This second PCM5242 is on address 0x4C, an I2C scanner I have verifies this. I need some code to write these values at startup of the application.
This was a essentially a dump from the purepath console...
Code:
cfg_reg registers[] = {
// Unmute
{ 0x03, 0x00 },
// Configure for I2S, DSP, Etc.
// { 0x28, 0x04 }, // I2S Configuration to "DSP" and set bits to 32 bit.
{ 0x28, 0x02 }, // I2S Configuration to "I2S" and set bits to 32 bit.
// { 0x03, 0x00 }, // I2S Shift to 00000100 aka 0x04
{ 0x3C, 0x01 }, // Tie left to right Volume
{ 0x3D, 0x62 }, // Left Digital Volume
{ 0x3E, 0x62 }, // Right Digital Volume
};
That's what I believe to be the minimum configuration via I2C to make the card play music coming in via I2S connected only to the Teensy (no purepath). Can someone please help me add some code to my existing code (above) to write those values to the registry at the start of the application? I know this is pretty straightforward code. I'm still learning and I lean on modifying existing code at this point. I figure if I can get some code to write values to the device, I can finish confirming my hardware. Once the hardware setup is confirmed with the PCM5242, I'll use the same code to then configure the PCM1865 and confirm that too with the goal of playing audio coming in from the PCM1865 through to the PCM5242.
Then I'll test it using TDM... and I should be able to get both PCM5242 and all 4 lines of the PCM1865 running on the teensy.
Any help on how to dump those registry values to the I2C lines? Thanks for the help!
Jay