Author Topic: I2S, match the Lengths of PCB Traces.  (Read 1733 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
I2S, match the Lengths of PCB Traces.
« on: December 21, 2023, 09:09:51 pm »

Hi
I am designing some boards that use I2S, my question is whether it is necessary for the PCB tracks of these signals to all have the same length, whether or not to add meanders in the shorter tracks to equal the same length in all of them.

I have applied the technique of adjusting the length of tracks on PCB using meanders with Eagle for MIPI or RAM memory access signals, since they are very fast, but it is the first time that I use I2S in a PCB design.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7392
  • Country: nl
  • Current job: ATEX product design
Re: I2S, match the Lengths of PCB Traces.
« Reply #1 on: December 21, 2023, 11:03:47 pm »
I2S is a slow digital signal, and it is sampled half a clock cycle away from where it's changed. So no, you don't need to match the length.
Signals like DDR memory needs it, because it has rules, like "this two signal needs to be within 10ps from each other".
 
The following users thanked this post: luiHS

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: I2S, match the Lengths of PCB Traces.
« Reply #2 on: December 21, 2023, 11:53:01 pm »
I2S is some variant of SPI at max a few MHz, matched lengths are not needed here. Really.
 
The following users thanked this post: luiHS

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: fi
Re: I2S, match the Lengths of PCB Traces.
« Reply #3 on: December 28, 2023, 07:30:52 am »
Instead of hand-waving, put it in numbers. Decide the clock speed and calculate period. Because SPI/I2S samples at halfway, half of that period is available for settling. Add some safety margin, google "speed of electricity" and calculate the actual length difference you can handle.

The fact it's "SPI" or "I2S" doesn't matter, let's put it in numbers instead of adjectives. I have done some length matching on SPI, because that SPI ran at 50MHz on a large board with many multiplexers. But sure, it's not about fraction of millimeters.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7392
  • Country: nl
  • Current job: ATEX product design
Re: I2S, match the Lengths of PCB Traces.
« Reply #4 on: December 28, 2023, 11:12:07 am »
Instead of hand-waving, put it in numbers. Decide the clock speed and calculate period. Because SPI/I2S samples at halfway, half of that period is available for settling. Add some safety margin, google "speed of electricity" and calculate the actual length difference you can handle.

The fact it's "SPI" or "I2S" doesn't matter, let's put it in numbers instead of adjectives. I have done some length matching on SPI, because that SPI ran at 50MHz on a large board with many multiplexers. But sure, it's not about fraction of millimeters.
I2S can be anywhere between 16khz mono 16 bit, and 6 channel 24 bit 192khz. Probably even more. And the highest speeds are still even slower than to worry about length matching on the ps levels. I would argue, it would take a lot of deliberate effort to make it not work anymore. Jitter is a bigger issue for such audio signal.
So what do you want us to calculate exactly?
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 3727
  • Country: us
Re: I2S, match the Lengths of PCB Traces.
« Reply #5 on: December 28, 2023, 02:49:35 pm »
I'm assuming that the clock and data lines will be run along the same general path, not something silly like running one clockwise and the other anticlockwise around a very large PCB, or running them in separate board to board cables.  If that's the case then no, you don't have to worry about fine scale length matching.  The timing margin is several nanoseconds or 10s of nanoseconds, which is at least meter propagation in a PCB.

If you have very long traces and high data rates you might need to worry about termination.  I2S does not require impedance control but with long traces reflections could be a problem.  In that case series termination at the source is probably the easiest approach. 
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: fi
Re: I2S, match the Lengths of PCB Traces.
« Reply #6 on: December 28, 2023, 04:54:46 pm »
So what do you want us to calculate exactly?

... just... calculate something that is pretty easy to calculate, instead of always hand-waving. Like, I really and actually calculate series resistor for LED current limiting, instead of always slapping 470 ohms. Isn't this normal? Why is this a bad thing?

I mean, we can babble "no need to length match I2S" until cows come home, but how close of not needing it we actually are? By doing a simple calculation, we can put these adjectives to numbers. It's called engineering.

Example calculation:
I2S clock = 12.288MHz -> period = 80ns
Allow for 5% drift from optimal middle point sampling -> 4ns
Speed of electric signal in copper = 200M m/s
200M m/s * 4ns = 800 millimeters

Look, it took less time than writing a handwaving reply. If you never calculate this, how do you know how close or far you are?
 
The following users thanked this post: ali_asadzadeh, luiHS, mskeete

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7392
  • Country: nl
  • Current job: ATEX product design
Re: I2S, match the Lengths of PCB Traces.
« Reply #7 on: December 29, 2023, 08:14:44 pm »
When you worked with these signals in the past, you have a very good ballpark estimates about them. I also gave a lower estimate for speeds when you have to worry about it. Not every question needs a wall of text to answer.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: fi
Re: I2S, match the Lengths of PCB Traces.
« Reply #8 on: December 30, 2023, 08:52:42 am »
When you worked with these signals in the past, you have a very good ballpark estimates about them.

 |O

And how do you think this experience is first gained? Should I just trust one random guy on the Internet saying something without giving zero proof, no numbers, nothing but fluff, when I can calculate it in 2 minutes and build understanding which lasts for a lifetime?

Quote
Not every question needs a wall of text to answer.

I mean, you have already written more wall of text to rationalize the avoidance of engineering, than the actual engineering job would have been. What a joke.
« Last Edit: December 30, 2023, 08:55:21 am by Siwastaja »
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7392
  • Country: nl
  • Current job: ATEX product design
Re: I2S, match the Lengths of PCB Traces.
« Reply #9 on: December 30, 2023, 11:33:14 am »
When you worked with these signals in the past, you have a very good ballpark estimates about them.

 |O

And how do you think this experience is first gained? Should I just trust one random guy on the Internet saying something without giving zero proof, no numbers, nothing but fluff, when I can calculate it in 2 minutes and build understanding which lasts for a lifetime?

Quote
Not every question needs a wall of text to answer.

I mean, you have already written more wall of text to rationalize the avoidance of engineering, than the actual engineering job would have been. What a joke.
You are being unreasonable, I don't know why, maybe forgot to take your meds. If that's the case, this is the reminder. Let's move on.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: I2S, match the Lengths of PCB Traces.
« Reply #10 on: December 30, 2023, 11:44:47 am »
No real need to do it, but you could still do it just to learn how (if you've never done so before on a PCB).
Also if this is a hobby/DIY project it's good to have PCBs to show others your PCB skills, like in job interviews etc...

Ya never know, having an example of matched length traces to show someone might be the difference between getting a job and not getting it.
« Last Edit: December 30, 2023, 11:48:32 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: fi
Re: I2S, match the Lengths of PCB Traces.
« Reply #11 on: December 30, 2023, 11:45:04 am »
I think the only unreasonable thing is to fight back so hard against such simple napkin calculation. They are normal practice in engineering for me and many others. You can choose to assume instead of calculation, but I'm surprised an engineering calculation gets so much backlash in an engineering forum, to the point of having to go ad hominem. What a weird place.
« Last Edit: December 30, 2023, 11:48:22 am by Siwastaja »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5914
  • Country: es
Re: I2S, match the Lengths of PCB Traces.
« Reply #12 on: December 30, 2023, 01:18:55 pm »
Example calculation:
I2S clock = 12.288MHz -> period = 80ns
Allow for 5% drift from optimal middle point sampling -> 4ns
Speed of electric signal in copper = 200M m/s
200M m/s * 4ns = 800 millimeters

Not every question needs a wall of text to answer.
Maybe you're not very good at reading, do your eyes hurt with anything longer than single-worded answers?

OP was overthinking, probably has little experience with layouts and high speed signals (Or he's too used to DDR routing and now got the habit).

Guys telling "nah it's ok" doesn't show anything, people makes mistakes all the time so it could be wrong.
He actually showed it with simple numbers and you laughted at him.

Are you going to roast the next one calculating the resistor for a led?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Siwastaja

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: I2S, match the Lengths of PCB Traces.
« Reply #13 on: December 30, 2023, 03:35:25 pm »
Thanks for the answers and calculations, it is always interesting to understand why things happen. Until now I had only made track length adjustments in designs with MIPI signals and parallel RAM, as these are high speed.

I had my doubts about I2S, for an audio design of a Raspberry and a TAS5805 amplifier. I have not used I2S before, I looked for information to configure the Raspberry and also for testing I bought a board with a TAS5713, so I could test everything before making my own board.

What made me doubt the need to adjust the length of tracks with I2S is that this board that I bought already assembled with the TAS5713 does have meanders for signal adjustment and they seem to come from the I2S lines of the Raspberry connector to the TAS5713, quite short tracks given the size of the board. I attach images of the board.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5914
  • Country: es
Re: I2S, match the Lengths of PCB Traces.
« Reply #14 on: December 30, 2023, 05:06:22 pm »
It won't cause any harm, but the end result will be the same, thus causing extra effort for nothing.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: luiHS


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf