Placing a crystal below a DIP socket

This is my first attempt at pcb design. I’m designing a board for a microcontroller.
I want to place an HC49_U crystal inside a forty pin socket since the crystal is only 3.5mm tall. On a perfboard placing the crystal inside the socket and two decoupling caps outside the socket works nicely. The problem appears to be that the 3D rendering of crystal #39 in the library is too tall.
The safest thing to do is place the crystal on the outside of the socket so that if I got the footprint wrong I could still bend the pins. What should I do?

Placing Crystals under DIP IC’s can be a bit finicky, and therefore not recommended for high volume production, but I assume this is for a small number of boards.

If you did a test fit on perfboard and it fits, then it will also fit on a PCB.
THT crystals are also quite forgiving and flexible because of their long leads.
If you still have doubts, then you can leave a bit of room free on the outside of the IC, at the location of the crystal pins. Goal is that if you @#$%^&* your crystal position / footprin for some unforseen reasont, you can drill 2 holes through the PCB and solder the crystal directly to the uC pins.

1 Like

Not just finiky i would say a bad idea with regards to EMC. One should place the crystal near the pins that connect it, with a nice guarding around. Nothing on the bottom side (No traces, nothing unless it is a two layer board then a separate GND area there.)

A good application note that details this: https://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD00221665.pdf/files/CD00221665.pdf/jcr:content/translations/en.CD00221665.pdf

In general: It is not worth trying to make a board too small. If you have the space use it. (With if you have space i mean if there is no mechanical constraint given by something that is already there. saving a few cents per board does not fall under “i have no space”.) Makes debugging easier. Makes it more likely that you can make your board follow EMC guidelines, …

With a socketed DIP 40 there is plenty of room under it for a crystal, and track length and guarding do not have to be different from placing the crystal on the “outside”.

Quote: “Placing Crystals under DIP IC’s can be a bit finicky, and therefore not recommended for high volume production, but I assume this is for a small number of boards.”
:grinning: This is why I love forums. I’m a hobbyist but now I know that if I ever shared my board I would place parts outside the socket.

I was thinking about the finicky part…
My main experience is with socket AVR’s in SDIP28.
These have 2 rows of holes under the IC, while for easy placement you want to leave 1 row empty between the crystal and the pins, which you can not do on perf board. When designing a PCB you can put it a bit further from the side and the fit will be a lot better.

With a wide DIP40 there is plenty of room to do this. A lot of the DIP40 sockets do have a plastic bridge in the middle which can interfere with the crystal placement. For a few boards you can easily cut this out, but this is not a good “design for manufacture” practice of course.

The DIP 40 micro is more rugged than the SMD version. I fry micro-controllers on occasion but it’s part of my education. My second board will probably feature optocouplers because I also like to drive motors.
I love forums because I can have a global dialogue with people who have more experience than I do.
I ‘promise’ I will still screw up. It’s part of the fun. Jigsaw puzzles don’t excite me.
Thank you for your feedback.

Using DIP is bad idea with regards to EMC. Using DIP in socket is even worse. So I think this board is not designed to be in accordance with EMC. So I think this criterion in respect to crystal is not important for OP.

By EMC do you mean electromagnetic compatibility?
I’ve been using that DIP/crystal combination without issue since 2008.
I ‘did’ destroy three SMD micros in a relatively short time period and decided to avoid that version for the time being. To be honest I ‘think’ I destroyed them because they shared a ground with motors. The damage I caused was less severe with the DIP version. At any rate I’ve ruined enough of them to have a preference for socketed micros.

I’d say the real world test over-rides the models :wink:

It’s fine to place a Xtal under the DIP40 socket, and we did that back when HC49/U xtals were the volume/price leaders. The leads are naturally very short doing this.
You can check the pin-spacing by doing a print image and poking the pins thru the paper.

Yes

I prefere to design as good as I can regarding EMC.
Standard DIP40 (as I remember from our first project from 1988) had VCC at pin 40 and GND at pin 20. If chip gets current puse during state switching imagine the circle that pulses goes from blocking capacitor. See (in 3D) how big is its area, how highly is chip over GND surface (specially if you use socket). That area is antenna, the bigger the better.
I use SMD microcontrollers. They have pin pairs VCC/GND at each side. At each VCC/GND pair I put the blocking capacitor. From each capacitor the supply pulses has a circle with very small area (think about wires inside IC case).
See in standard digital ICs (like HC serie) catalog. For slew rate they don’t specify the minimum time. I have read that if HC bought in 1990 could have for example 5ns, then the same IC bought nowadays can have 1ns or less. It is because the smaller technology allows to put more chips on one wafer and so IC is chipper.
We got into that trap once. In 1993 we designed an education board and 10 adapters to be connected to it. One of them was serial EEPROM programmer. It worked well with EEPROM bought in 1995. But in 2006 we bough the same type EEPROMs and they didn’t worked. The reason was that these new EEPROMs had few times higher dU/dt at their output and in our connection cable it crosstolked to CLK line. There were very short pulses but EEPROM got them. The old one (we had few to compare) didn’t generated that pulses, and I suppose was not fast enough to notice them (if they even were there).

In 1987 we (me and my brother) were doing our first experiments with 8748 programming. We didn’t got the programmer, we build it ourselves. And there was a mistake in it - each try of programming damaged the IC. We had bought 10 pcs of 8748. One costed more then half of my month salary (those time working as academic teacher my salary was $13 per month). From order to delivery we had to wait three months. And using our programmer we damaged 5 of them before we got what is the problem :frowning:

Edit: I’m not sure of these three months. May be it was faster. But sending DM from Poland to West Germany and sending parcel back was certainly not so fast as nowadays.

I think it is only a half of reason. The second half is how were the way motor currents travelled through the board regarding the microcontroller and how its pins were protected.
I think it is posiible to share ground with small motors and have no problem.

:grinning: Great tip. Worked beautifully. I printed the board layout and measured the pin traces twenty pins apart. Good match. I then checked the crystal footprint against a crystal from my stock. It didn’t match.
I told myself I wouldn’t try to create custom footprint for my first design but I am going to create one now. Thank you.

I have three motor projects on my work desk that I had to stop working on because I realized I was destroying my i/o pins. It was just a few months ago I got an inexpensive scope that allowed me to see that I could not get a clean 20 Khz square wave from micros that I had driven motors with. I should know better than to be so careless with an inductive load. The best solution I can think of at the moment is to use optocouplers. I expect to learn a lot about pcb design from this forum.
I take note of everything I read on this forum. Some of it is still too advanced for me but I am paying attention.

I think you will learn here a lot about PCB design using KiCad, but about PCB design for EMC I suggest to read:








2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.