CS42448 board ( 6 audio inputs / 8 outputs ) ?

I know you're aware of the multi-channel USB thread, because you posted on it. Unfortunately, at the moment this is the only game in town (that I'm aware of) that supports 8-channel USB. I say "unfortunately", because as it stands it's pretty tricky to make use of, as you have to hand-edit your Teensyduino installation in three places, and get it just right, to have this working.

Your design above is just right, except of course (as you spotted) you need the 8-wide USB input (AudioInputUSBOct) that the new code provides.

If you review that whole thread, and the repository, and want to give it a go, crack on. If you need support for that, that thread is probably the best place to ask.
 
Hi Rich, The standard USB input object is only 2 channel. There is some experimental work for multi channel - check out this link if interested. Cheers, Paul
Thank you for the response @houtson . It's very helpful to receive guidance from experienced members, to confirm I'm not completely off the rails. :) Much appreciated.

I will focus on the thread you referenced, and try to implement the changes to support 8-wide USB input that @h4yn0nnym0u5e pointed me to.
 
I know you're aware of the multi-channel USB thread, because you posted on it. Unfortunately, at the moment this is the only game in town (that I'm aware of) that supports 8-channel USB. I say "unfortunately", because as it stands it's pretty tricky to make use of, as you have to hand-edit your Teensyduino installation in three places, and get it just right, to have this working.

Your design above is just right, except of course (as you spotted) you need the 8-wide USB input (AudioInputUSBOct) that the new code provides.

If you review that whole thread, and the repository, and want to give it a go, crack on. If you need support for that, that thread is probably the best place to ask.
Thank you for the response @h4yn0nnym0u5e . Guidance from experienced members like yourself is much appreciated.

I will focus on the thread you referenced and check out the repo to implement the 8-wide USB input.
 
I know you're aware of the multi-channel USB thread, because you posted on it. Unfortunately, at the moment this is the only game in town (that I'm aware of) that supports 8-channel USB. I say "unfortunately", because as it stands it's pretty tricky to make use of, as you have to hand-edit your Teensyduino installation in three places, and get it just right, to have this working.

Your design above is just right, except of course (as you spotted) you need the 8-wide USB input (AudioInputUSBOct) that the new code provides.

If you review that whole thread, and the repository, and want to give it a go, crack on. If you need support for that, that thread is probably the best place to ask.
@h4yn0nnym0u5e I have reviewed the entire thread and the repo. I noticed that the readme in the repo states:
"In order to use it, copy the files of 'changedCorefiles' into cores/Teensy4 and replace the original files."

I also noticed that you stated "as it stands it's pretty tricky to make use of, as you have to hand-edit your Teensyduino installation in three places, and get it just right, to have this working"

Not sure if these agree or not. Is the readme incorrect?

I will continue to look at the diff between my teensyduino install and the repo.
 
The ReadMe could do with an update … the edit to cores enables the multi-channel USB. The file in changedGUI updates the Design Tool with objects you can place in your audio processing design, e.g. your post #24. The files in changedConfigfiles add options to the Tools menu to allow you to select the sample rate, block size and number of USB channels, without having to edit core or library files.
 
The ReadMe could do with an update … the edit to cores enables the multi-channel USB. The file in changedGUI updates the Design Tool with objects you can place in your audio processing design, e.g. your post #24. The files in changedConfigfiles add options to the Tools menu to allow you to select the sample rate, block size and number of USB channels, without having to edit core or library files.
@h4yn0nnym0u5e Thank you. That is very helpful.
 
Hi, @houtson, I've tried to connect to the CS42448 board with and without pull-up resistors (two 9.7k ohm, I don't have 4.7k atm) between 3.3v and SDA, 3.3V and SCL, still couldn't talk to the CS42448, any idea why? thank you so much.
 

Attachments

  • IMG_1561.jpg
    IMG_1561.jpg
    402.2 KB · Views: 41
Last edited:
9.7K is too high, 3k3 will be fine with 3.3V. The CS42448 shows 2k resistors, but that caters for voltages down to 1.8V.
Now I don't have 4.7k or 3.3k at my hand, tried 1k, also didn't work.... but why I don't see people use pull-up resistor here and it still works? I thought there's inbuilt pull-up resistors.
 
The inbuilt pull up resistors are in the order of 10k.
That is too high and the code has to turn them on.
1K is likely too low.
Try 2 (or 3) 9.7k resistors in parallel (=4.85k (or =3.23k)).
 
Please don't post the same question on multiple threads.

As far as I can see you've missed setting the CS42448 address by wiring the address setting pins AD0 and AD1. There's a long discussion, with relevant information starting at this post. My solution was to wire them on the bare pads left by IC1 not being fitted; I also put a link / zero-ohm resistor on R20 which gives you 3.3V to IC1 pad 2 - you don't need this if you're only going to wire the pins to ground for a single board.

As BriComp states, you do of course need the pull-ups as well.
 
Hello,Weiweiweiwear
It seems you flip the SCL and SDA on the teensy,the red wire should be on the right on teensy,if i'm not :unsure: wrong
 
Hey! so sorry I found this thread is more related to my question but i couldn't delete my post in another thread. (I also just realized I post it to a wrong page).

I did some reading and I think it's I didn't wiring the address. (yes I found I swapped the SDA and SCL on Teensy but it still didn't work after I flip it back). So, for single CS42448 board with teensy 4.1, I guess I need to define my board by any of the 4 cases below:

AD0 to Gnd and AD1 to Gnd => address 0x48
AD0 to Gnd and AD1 to 3.3V => address 0x4A
AD0 to 3.3V and AD1 to Gnd => address 0x49
AD0 to 3.3V and AD1 to 3.3V => address 0x4B

but how do I declare the address in the arduino code? :D
 
Hi @Weiweiweiwea,

The AudioControlCS42448 control object set the address as 0x48 as default. If you want to change this use .setAddress.
I didn't use pull ups on SDA/SCL in my tests. Can you post the code you're using to test.

cheers, Paul
 
Hi Paul, thank you to clarify this!

I took exactly the same code as you posted in the earlier post in this thread, just I didn't wire the AD0 and AD1 to GND, should I solder them manually? I didn't because I didn't see you solder or wire the AD0 and AD1 to GND on the CS42448 board in the picture you posted, or did you put jumpers somewhere else?
 
Last edited:
Hey Weiweiweiwear,
from my experience return,when only one cs42448 is used,don't need pullups resistors,nor AD0 & AD1 setup,just leave it free
and don't need :
//cs42448_1.setAddress(0x48);
//cs42448_1.enable();
I use the setAddress only when there is more than one cs42448 on the I2C line,you only need the cs42448_1.enable() return
on the monitor,you can also make a I2C scan and see if your wiring is ok.
Here is a simple sketch with a sine generator on each output,to test the cs42448:

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


// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=112,2475.333251953125
AudioSynthWaveformSine   sine1;          //xy=309,2370.333251953125
AudioSynthWaveformSine   sine2;          //xy=312,2424
AudioSynthWaveformSine   sine3;          //xy=316,2476
AudioSynthWaveformSine   sine4;          //xy=316,2531
AudioOutputTDM           tdm2;           //xy=608,2478.333251953125

AudioConnection          patchCord1(sine1, 0, tdm2, 0);
AudioConnection          patchCord2(sine1, 0, tdm2, 2);
AudioConnection          patchCord3(sine2, 0, tdm2, 4);
AudioConnection          patchCord4(sine2, 0, tdm2, 6);
AudioConnection          patchCord5(sine3, 0, tdm2, 8);
AudioConnection          patchCord6(sine3, 0, tdm2, 10);
AudioConnection          patchCord7(sine4, 0, tdm2, 12);
AudioConnection          patchCord8(sine4, 0, tdm2, 14);

AudioControlCS42448      cs42448_1;      //xy=152,2708.333251953125
// GUItool: end automatically generated code




void setup() {
 
  Serial.begin(38400);
//cs42448_1.setAddress(0x48);
//cs42448_1.enable();
 
 
  AudioMemory(1000);
sine1.amplitude(0.3);
sine1.frequency(800);

sine2.amplitude(0.2);
sine2.frequency(1000);

sine3.amplitude(0.2);
sine3.frequency(1200);

sine4.amplitude(0.2);
sine4.frequency(1500);

//amp1.gain(15);
//amp2.gain(15);
  //mixer1.gain(0,8);
  //mixer1.gain(1,8);
   //cs42448_1.enable();
   //cs42448_1.volume(0.7);
 
  if (cs42448_1.enable() && cs42448_1.volume(0.8)) {
    Serial.println("configured CS42448");
  } else {
    Serial.println("failed to config CS42448");
  }

cs42448_1.inputLevel(1.0);// very sensitive
 
    
}



void loop() {
 
  
}

This is working for me,maybe for you...
 
Please please please can everyone stop parroting that pull-ups are not needed on SCL and SDA. They are. You may possibly get away with it in a lash-up, or if it so happens there are other things connected which provide the pull-ups and you have omitted to tell us about. But giving incorrect advice to the inexperienced, and on a forum that will be read for years, is just a recipe for causing people to waste a lot of time in the future wondering why their hardware isn't working.

Pull-ups are part of the I²C specification. Fit them.
 
Also, specifically for the CS42448, you must wire AD0/AD1 - the data sheet tells you to do so. If you don't you risk a glitch on AD0 putting the CS42448 into SPI mode rather than I²C, and you will not be able to set it up.
 
Please please please can everyone stop parroting that pull-ups are not needed on SCL and SDA. They are. You may possibly get away with it in a lash-up, or if it so happens there are other things connected which provide the pull-ups and you have omitted to tell us about. But giving incorrect advice to the inexperienced, and on a forum that will be read for years, is just a recipe for causing people to waste a lot of time in the future wondering why their hardware isn't working.

Pull-ups are part of the I²C specification. Fit them.

You're absolutely right that i2c pull-ups are good practice for any design but the OP has already confirmed they don't have the parts for external pull-ups and we're just trying to get a basic result from their breadboard lash-up.

I've used this board in the same situation and the T4.0 internal pull-ups worked fine for i2c. I'm interested in resolving this particular issue, which I don't think is due to missing pull-ups. Peace!

Cheers, Paul
 
I think all answers should be appreciated, one of the greatest thing about open source is the collective troubleshooting, but of course I will try to reduce my newbie attempts here as much as i can.... its a great forum!

Ok, so I think I've tried both ways and they all didn't work, and since I am only debugging the I2C scanner, now I only leave I2C cables connected (btw i found my CS42448 chip is cold now, before it's pretty hot with other wires connected):

1. Bare board (AD0 and AD1 are not connected to GND, no pull-up resistors).
2. Wired board (AD0 and AD1 are connected to GND, two 2.2k resistors in between 3.3V/SCL, 3.3V/SDA).

The "configured CS42448" texts were only shown when I unplug the VCC wire from 5V pin to 3.3V pin of Teensy 4.1, but there's no sinwave heard in my earphone so I guess it's just a glitch. I bought these board with like 15 dollars from Taobao.

Maybe it's a more reliable option to buy Paul Stoffregen's board here for further test, although I am on 4.1 not 4.0. But I can find a 4.0 board no problems.

My goal is to design a customized DAC card which generate DC coupled differential outputs for laser ILDA protocol with USB. -> TDM communication, I think I need to study this post eventually? just now I couldn't even deal with the basic. I am not engineer, I just learn all this online, I program with max/msp and MOTU to drive laser for large cyanotype exposure on garments. For example I found this post did exact same approach just it's obsoleted.
 

Attachments

  • IMG_1624.jpg
    IMG_1624.jpg
    428.3 KB · Views: 44
  • IMG_1625.jpg
    IMG_1625.jpg
    421.2 KB · Views: 39
  • IMG_1626.jpg
    IMG_1626.jpg
    175.6 KB · Views: 36
Last edited:
Do you switch off and on, the teensy,to see really if the cs42448 is configured or not in the monitor?
I do that two or three times,to be sure of the stable situation.
So if the cs42448 is configured it's ok with the I2C,now the trouble can come from the TDM wiring,
The wiring of this is very delicate,i see you only use male headers into the teensy breadboard and it's dupont wiring,
I only use for now female-female or male-female headers wiring that i build myself and i can use them eternally with a tight contact.
Look at that:
Code:
//cs42448_1.enable();
//cs42448_1.volume(0.7);
try to uncomment those lines,sure that the volume has to be set,for the enabling i think the enabling function is enough
Code:
if (cs42448_1.enable() && cs42448_1.volume(0.8)) {
    Serial.println("configured CS42448");
  } else {
    Serial.println("failed to config CS42448");
  }

EDIT:
You wrote: "but there's no sinwave heard in my earphone so I guess it's just a glitch"
I don't think the output can feed an earphone,it's a line output,unless you wired it on a preamp for earphone :unsure:
 
Last edited:
My bad: This remark from me was silly:

Code:
Look at that:    

//cs42448_1.enable();

//cs42448_1.volume(0.7);


try to uncomment those lines,sure that the volume has to be set,for the enabling i think the enabling function is enough

All of this is of course in the enabling function :)
 
It got configured well after I added two 2.2k pull-up resistors to 3.3V as @h4yn0nnym0u52 suggested here. I will go to the related thread for the rest of the work, sorry for the noise & thanks for all the helps!
 
I spent all Sunday trying to get that board working, read all related threads on that forum and and CS42448 datasheet.
3.6k resistors on I2c
10k resistors on AD0, AD1 to GND

and what was wrong? I was not opening monitor :)

I was just

Bash:
pio run --target=upload

that fixes for me. According to datasheet there has to be delay before and after RST but it seems nobody is wiring RST. May be it will work without blinking but I feel more confident when it blinks after upload.

C++:
  // while (!Serial)
  //   ;
  pinMode(LED_BUILTIN, OUTPUT);
  for (int i = 0; i < 5; i++) {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(100);
    digitalWrite(LED_BUILTIN, LOW);
    delay(100);
  }
 
Back
Top