9
\$\begingroup\$

I have recently entered into PCB designing area and after reading about sharp rising edges can generate voltage on other components, I was thinking that, in the following image, will the routing I2C signal lines below crystal (16 MHz) would disturb the crystal's output signal to that extent that my microcontroller would not oscillate at all or oscillate but would glitch.

enter image description here

Rise time for both SCL and SDA is ~300 ns and the clock (for 10 to 400 pF loaded line).

Microcontroller is ATMega328p and I2C is connected to PCF8574A. This board is 2 layer board only.

There is also SCK line, but it's speed will also not exceeding 100 kHz.

Thank you.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ 1) if you're worried about this then move those lines away from the Xtal, there's still space between U35's pins and U26's pins so use that space! 2) Your lines are very narrow so the parasitic capacitance between these and other lines will be very small, too small to influence a circuit like this I would say. So I'm not worried at all about this, I am sure it will work like shown in the picture. 3) study some existing designs and see what others do. As a beginner you tend to worry about everything which is not needed. What is important: having decoupling caps near the IC for example. \$\endgroup\$ Oct 13 at 7:34
  • 2
    \$\begingroup\$ You seem to be focused on the slow rising edges and ignoring the sharp falling edges. The falling edges are even faster as they are simply driven low by the output, so falling edge can be less than 5ns. And it is not the repetition rate of edges (100 kHz) but the speed of the edges that easily get capacitively coupled to high impedance crystal traces. So I can't say for sure whether your design will work or have problems, but it is definitely against suggestions and good practices. \$\endgroup\$
    – Justme
    Oct 13 at 7:39
  • 1
    \$\begingroup\$ @Justme I got you point but the fall time is 250ns as per datasheet. \$\endgroup\$ Oct 13 at 7:44
  • 2
    \$\begingroup\$ @Sanmvegsaini No it isn't. What would make it be 250ns? It is just allowed to be as slow as 250ns maximum, but it must be less than 250ns. It will be more closer to 0ns than 250ns. \$\endgroup\$
    – Justme
    Oct 13 at 7:52
  • 1
    \$\begingroup\$ @Justme you are correct, I just looked at the datasheet and it did mentioned 250ns to be maximum. Thanks for pointing it out, I will be careful next time quoting values from datasheet. \$\endgroup\$ Oct 13 at 8:06
11
\$\begingroup\$

This will very likely not be a problem at all. At these frequencies (100 kHz, 16MHz) the considerations about careful routing and such will mostly be questions of "best practice", and will not meaningfully impact any functional requirements (unless you project is going into space, and you have strict limits on EM emissions or things like that).

To simplify the routing, I would, if possible, place U13 closer to the pins of U35 it is connected to, as this would simplify the routing, and remove the wire-crossings you are asking about. If the overall placement can't be changed, I'd suggest routing the traces from both U13 and U26 into the "end" of U35 (between pins 14 and 15), resulting in less congestion, and more space around pins 9-14 of U35.

Also, as far as "best practice" goes, the load capacitors for the crystal (C49 and C50) would ideally be placed between the crystal and the MCU (see here for more suggestions). (Again, this is a "best-practice" kind of thing, and will not be an issue for your circuit either way.)

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Thank you for the suggestions, I will surely incorporate the changes. \$\endgroup\$ Oct 13 at 7:48
  • 4
    \$\begingroup\$ a 16MHz crystal in my experience is quite strong and difficult to make mis-oscillate. I'd check the oscillator configuration to the correct driving strength and the load capacitances. Also AVR/Microchip has quite extensive application notes on the subject. Start reading AVR186 \$\endgroup\$ Oct 13 at 11:00
  • 5
    \$\begingroup\$ Note that it's not a 100 kHz sine wave; as pointed out in comments and hacktastical's answer, I2C has fast sharp edges, with fall time of 5 ns being not unlikely. It still might not be a problem in practice, but the answer reads like you're recommending that people look at the 100 kHz vs. 16 MHz frequencies without considering the shape of the square-wave edges. \$\endgroup\$ Oct 13 at 20:25
9
\$\begingroup\$

How difficult is it to make some room: -

enter image description here

I think you can finish off the two offending tracks by using your eyes.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Thank you for your suggestion, but I was just curious to know if routing I2C lines would make crystal go crazy. \$\endgroup\$ Oct 13 at 7:46
  • 5
    \$\begingroup\$ Most chips that use xtals will have special notes in their respective data sheets about routing tracks around xtal connections. \$\endgroup\$
    – Andy aka
    Oct 13 at 7:48
  • 1
    \$\begingroup\$ The thing to be concerned about is not that the routing will necessarily make the crystal go crazy, but that on one in a hundred boards, where by chance a poor sample of the crystal comes together with a chip at the edge of its specitication, the oscillator will sometimes stop when the battery is low. That's a hard problem to debug, and the reason for conservative design. Top of your list should be to add those decoupling caps! \$\endgroup\$ Oct 14 at 11:15
8
\$\begingroup\$

The AVR oscillator is pretty tolerant, but nevertheless you don't want anything close to the crystal or its pads. Not only does this ensure minimum disturbance, but also helps keep consistent board capacitance to reduce frequency variation.

I2C has a slow clock rate. It also has square-wave edges, so it's like any other digital signal in that it can couple to adjacent pads and traces. Here, the coupling would be from the trace to the adjacent through-hole pads.

It looks like you have plenty of space to shove the traces over. Might as well do that.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.