change I2S BCK ratio ?

Status
Not open for further replies.
Since you have a scope, I'd recommend using it to watch LRCLK, BCLK and DATA. Set your scope to trigger on LRCLK.

My guess is you'll see the bits immediately after LRCLK flickering wildly. If there isn't a consistent logic low for 1 BCLK cycle after LRCLK changes, that's a sure sign the PCM1802 is transmitting left justified data rather than I2S.

is2.png

It should look like that waveform above, with always logic low for 7 cycles before LRCLK changes (the yellow part) and 1 cycle after LRCLK changes (the green part).
 
My recommendation: try to spend a little more time on digesting and reading than on replying to posts.
here is the requested connection of the PCM1808 that works with the T4:
https://forum.pjrc.com/threads/57167-Teensy-4-0-I2S-Support?p=212640&viewfull=1#post212640
Try to go through all the connections and compare them with the connections of your PCM1802
Most important: be aware that the T4 has aggressive signals on MCLK and other relevant pins which means zhat it is impossible to use long wires for wiring and even if you use short (< 3cm) wires without a good ground plane, this can ruin your audio.
I had the T4 set up with 2cm wires connected to the audio shield and this did not work properly because of a missing ground plane!
 
sorry mate, I admit I have a negative attitude, but I wrote a game engine, once, well in the end, after 2 years of hard work, I still had no game

I don't want to dig in something I bought, who's supposed to help me and do the work for me

it's like asking a concept artist to debug photoshop, it's not his job, he already have a lot to achieve

I misunderstood the DS ? Ia m not the only one apprently, and at least I tried, as I said [bold] I am not an english person [/bold], and I have zero XP with I2S

I am not even supposed to deal with this

sorry you guys dont get it, I gave all the infos I could put on this forum to get help

sorry I am not as mature and open minded as Frank B
 
My recommendation: try to spend a little more time on digesting and reading than on replying to posts.
here is the requested connection of the PCM1808 that works with the T4:
https://forum.pjrc.com/threads/57167-Teensy-4-0-I2S-Support?p=212640&viewfull=1#post212640
Try to go through all the connections and compare them with the connections of your PCM1802
Most important: be aware that the T4 has aggressive signals on MCLK and other relevant pins which means zhat it is impossible to use long wires for wiring and even if you use short (< 3cm) wires without a good ground plane, this can ruin your audio.
I had the T4 set up with 2cm wires connected to the audio shield and this did not work properly because of a missing ground plane!

yeah I thought about doing that too
thanks
 
sorry you guys dont get it, I gave all the infos I could put on this forum to get help

Use your scope to view LRCLK, BCLK and DATA, as I tried to explain in msg #26. If you need more help to do that, just ask.

I have a hunch the waveforms are going to turn out to be left justified format, because the wrong analog waveforms on msg #15 look pretty much like too much non-clipping gain applied, causing integer overflow.
 
Look, this isn't the first time. Over and over this same conversation has come up on this forum, where someone misreads the datasheet and believes their chip expects exactly 24 BCLK clocks per phase of LRCLK. It's a common misunderstanding, because these parts of the diagrams (highlighted yellow and green) aren't always clearly explained.
And, it seems like every manufacturer that makes an I2S device puts that same picture in their datasheet, many times with no further explanation. It would be so much easier if they just put in tabular form all possible combinations of:
  • Sample Rate
  • Number of (significant) bits per sample
  • MCLK Freq
  • BCLK Freq

Be that as it may, it doesn't excuse a bad attitude and hostility directed at those providing correct information.

If you don't like working on this project, stop whining about it and find something else to work on.
 
Last edited:
I ordered one of these PCM1802 boards. But it's coming from China. Estimate is 30 to 50 days for delivery!

If @phil123456 returns, and I hope he does so we can fully resolve this issue, I'd like to ask everyone to please remain focused on the technical problem at hand. These sorts of problems can be really frustrating. Sometimes human reactions only make things harder rather than better. Let's work to get this problem figured out.
 
Teensy 4 - Using the PCM1802 and the CJMCU-4344. Not sure if this is still relevant any more, or helpful to anyone but, this appears to be working fine. Good audio, though a little hissy, but that’s probably my setup!

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


// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=401,622
AudioEffectFreeverb freeverb1; //xy=648,538
AudioEffectFreeverb freeverb2; //xy=656,665
AudioMixer4 mixer2; //xy=682,808
AudioMixer4 mixer1; //xy=839,612
AudioOutputI2S i2s2; //xy=1049,623
AudioConnection patchCord1(i2s1, 0, freeverb1, 0);
AudioConnection patchCord2(i2s1, 0, mixer1, 1);
AudioConnection patchCord3(i2s1, 1, freeverb2, 0);
AudioConnection patchCord4(i2s1, 1, mixer2, 1);
AudioConnection patchCord5(freeverb1, 0, mixer1, 0);
AudioConnection patchCord6(freeverb2, 0, mixer2, 0);
AudioConnection patchCord7(mixer2, 0, i2s2, 1);
AudioConnection patchCord8(mixer1, 0, i2s2, 0);
//AudioControlCS4272 cs4272_1; //xy=404,816
AudioControlSGTL5000 cs4272_1; //xy=404,816
// GUItool: end automatically generated code




/* PCM1802 (ADC)
Pin Signal
23 SCK
3V PDW (to 3V+)
20 LRCK
12 FSY
21 BCK
8 DOUT

Ensure that `FMT0` is soldered (bridged, underneath the board)
*/


/* CJMCU-4344 (DAC)
Pin Signal Direction
7 SDIN Output
21 SCLK Output
20 LRCLK Output
23 MCLK Output
*/


int rvb_value;
int dam_value;

const float DIV10 = (1.0 / 10.0); // 0 to 1.0


#define FSYNC 12 // has to be high on normal usage


void setup() {
// put your setup code here, to run once:
AudioMemory(60);

pinMode(FSYNC,OUTPUT);
digitalWrite(FSYNC,HIGH);


cs4272_1.enable();
cs4272_1.volume(0.9);


mixer1.gain(0, 0.9);
mixer1.gain(1, 1.0);
mixer1.gain(2, 1.0);

mixer2.gain(0, 0.9);
mixer2.gain(1, 1.0);
mixer2.gain(2, 1.0);

rvb_value = 250;
dam_value = 15;
}



void loop() {

// int rvb_value = map(analogRead(A1), 0, 1023, 1, 11);
// int dam_value = map(analogRead(A2), 0, 1023, 1, 11);

freeverb1.roomsize( (rvb_value * DIV10) );
freeverb2.roomsize( (rvb_value * DIV10) );

freeverb1.damping( (dam_value * DIV10) );
freeverb2.damping( (dam_value * DIV10) );

// Serial.println(dam_value);
}
 
Last edited:
Finally, almost 11 months later, I'm finally looking into this problem. I ordered this PCM1802 board back in February, but it took months to arrive. When it did get here, we were in the 1st lockdown of the pandemic, and struggling to get Teensy 4.1 released. So it sat on my workbench until now....

I'm pretty sure the problem all along has been the PCM1802 running in left justified format, but Teensy needs it to use I2S format. The FMT0 pin is supposed to be changed to logic high to put the PCM1802 chip into I2S mode.

Phil's photo on msg #24 does indeed have the FMT0 pads soldered together. So it should work, right?

Turns out the "+" side of those 5 jumper pads isn't connected to 3.3V power, or anything really. It's obviously a PCB design error!

pcberror.jpg

It took me a while to get this macro photo with just the right light so you can see the PCB traces. Clearly the trace connects those five "+" terminals together, but then it doesn't actually route anywhere else. At first I couldn't believe this. But I tested with my ohm meter between those 5 pads and many other places on the PCB. There is absolutely no connection.

So even though Phil correctly configured FMT0 in the msg #24 photo, the chip was still running in left justified mode because those pads don't actually do anything!
 
Yup, it's definitely working.

pcm1802_5.jpg

Running this code:

Code:
#include <Audio.h>

AudioInputI2S            i2s1;           //xy=152,100
AudioOutputAnalogStereo  dacs1;          //xy=316,117
AudioConnection          patchCord1(i2s1, 0, dacs1, 0);
AudioConnection          patchCord2(i2s1, 1, dacs1, 1);

void setup() {
  AudioMemory(10);
}

void loop() {
}

To get it correctly configured, I had to solder a wire from the 3.3V pin to the FMT0 pads.

pcm1802_3.jpg

pcm1802_4.jpg
 
thanks

I remember at the time, the jitter was really random, so let's hope my problem was related to that

-> can you post the link where you ordered the board ?

I suspect mine could have other issues

I'll let you know, when I find some time to get back to this

thanks a lot for your devotion man
 
Oh man, ordered my PCM1802 a few weeks ago and it should arrive in the next couple days. You've probably saved me days of trouble shooting with this. thanks Paul.
 
Turns out the "+" side of those 5 jumper pads isn't connected to 3.3V power, or anything really. It's obviously a PCB design error!

View attachment 23094

LOL! And I do mean LOL!!!

So many times I've see this kind of stupidity from Chinese "module" boards.
I had a ST-Link dongle arrive one time with the metal sleeve with a diagram of where DIO/CLK pins were.
It NEVER WORKED. Then I slipped the sleeve off and noticed DIO and CLK pins ON THE BOARD were marked differently.
Hooked it up as THE BOARD was marked and it works just fine now.

But that 1802 board is just too funny with traces going NOWHERE!
 
Status
Not open for further replies.
Back
Top