Final time, I defined every thing you may need to know in the event you needed to place an M.2 socket in your board. Right this moment, let’s construct M.2 playing cards! There are a myriad of M.2 sockets on the market that simply ask for a particular card to be inserted into them, and possibly, will probably be your creation that may match.
Why create playing cards?
Laptops and different x86 motherboards usually include M.2 slots. Do you could have a free B key slot? You may put an RP2040 and a bunch of sensors on a B-key PCB as an experimental platform that’s carried safely inside your laptop computer. Would you love to do some extra superior FPGA experiments? Here is a tiny FPGA board that matches inside your laptop computer and allows you to mess around with PCIe on this very laptop computer – the entire setup takes up little or no area. In search of an additional PCIe hyperlink since you’re repurposing your laptop computer as a house server? Once more, your WiFi slot will give you that. Need to get some PCIe out of a SteamDeck? Constructing an M-key 2230 card appears to be your solely hope!
There’s additionally loads of room for less complicated, much less lively units. Do you solely have a spare M key slot, possibly an A or E key slot? You may change your WiFi adapter with an extra SSD for extra storage, or maybe the opposite approach round, pop a second WiFi card into your second SSD slot for all of your storage wants. Did you simply discover some traces of unused SATA ports in your motherboard? You are able to do what I did and create a twin port M.2 card that splits an SSD socket additional away from its energy rail, to which you’ll join that further SATA port and put an M.2 SATA SSD. Have you ever simply discovered that its chipset can provide you 4 full SATA ports in M-key SSD slot? You are able to do what my good friend did and construct a card that breaks these SATA ports!
Even exterior of x86, fairly just a few ARM SBCs may have the identical points – they’ve an M.2 socket with a particular key, say, B, that will not match some M.2 extender you simply purchased, nicely it seems you are able to do an adapter by your self. What about going past the usual? In fact, there’s the SparkFun MicroMod ecosystem that I discussed earlier. Would you wish to develop a MicroMod CPU board that works with a myriad of different units, or maybe your individual MicroMod sensor? That is an M.2 card proper there; and if you might want to create your individual ecosystem utilizing M.2, nobody is stopping you both.
In fact, you possibly can design playing cards with fully several types of added worth. For instance, you possibly can be extracting cash from audiophiles by design expensive “audio grade” SSDs with fancy electrolytic capacitors in them, you would not need to let all that gold plating get understated, would you? And, in the event you’re an SBC maker utilizing an M.2 socket on your growth slot, when patrons say they need to use your SBC as a router, nobody can cease you from designing a fully extravagant and gigantic card with 4 Ethernet sockets. in that.
outlining card
M.2 playing cards have standardized sizes: 3042 for 30mm width and 42mm top, 2260 for 22mm width and 60mm top; The helpful factor is that these would be the actual dimensions of your PCB. The screw notch is centered not like mPCIe playing cards and is often a single M.2 screw. You will notice individuals saying that the screw is answerable for having a floor connection; it isn’t, even when it seems to be prefer it, the bottom pins on the receptacle itself are enough, though further floor paths are typically good. The truth is, the notch space would not want to reveal the copper, as it might simply be a PCB cutout.
Should you design a card for an present gadget, will probably be 42mm or 80mm lengthy. 30mm is uncommon exterior of SteamDeck and different low-profile units, and 60mm may be very darkish. 22mm is a width for every thing besides WWAN slots, that are usually designed with a 30mm card width in thoughts. It’s not obligatory to place all of the parts on one aspect of the board, though it is going to in fact make it simpler so that you can assemble. Nevertheless, take into account that some units use a flat or mid-mount socket, and tall parts on the underside can develop into a difficulty you did not count on.
M.2 requires a 0.8mm PCB. It’s not essential to have it ENIG, however I like to recommend it. It’s my understanding that solder coating made with HASL would oxidize sooner and worsen contact with card sockets; That mentioned, I’ve by no means tried utilizing HASL. Nevertheless, I am certain HASL would work nicely sufficient for short-term use prototypes! You may assume the gold finger remedy is a should, whether or not it is with thicker gold on the pads or the beveled fringe of the cardboard; in my expertise neither is required, however the thicker gold will improve plug and unplug cycles and a beveled edge will make the cardboard slightly simpler to insert. Personally, I’ve all the time gone with common ENIG with out beveling and had a fantastic expertise.
In fact, you will need a card edge footprint in KiCad. Personally, I’ve been utilizing a KiCad M.2 card edge footprint generator plugin, initially created by @STOP-Pi on GitHub and refactored on my own. Nevertheless, the creator deleted his GitHub account sooner or later and the plugin is not loaded in KiCad6 – all generated footprints had been made in KiCad5. What’s worse is that between my modifications and the time of the removing, they even up to date the plugin’s code, and it may need been that I missed their KiCad 6 compatibility commits earlier than the removing. Welcome, pull requests are welcome! Within the meantime, listed below are the pre-generated A, B, E, M, A+E, and B+M card borders you possibly can already use, and [timonsku] you could have additionally created an Eagle library which ought to have the ability to simply convert to KiCad.
contained in the define
You is likely to be questioning in the event you’d want a four-layer PCB, particularly if you wish to do PCIe: with 4 layers, 90 ohm impedance matching will be achieved, whereas 0.8mm floor clearance on two layers does. unrealistic. Here is my expertise: I have been making small PCIe adapters for some time now they usually’ve labored fairly nicely at layer 2, which is a requirement for me prototyping workflow. Usually, M.2 playing cards signify a really brief distance proportional to the size of all of the PCIe hyperlink you will have, and the offsets most likely will not forestall the PCIe hyperlink from working; it is the longer distances that may trigger you issues till you improve your wiring. I would not be stunned to see a better error charge or the hyperlink being downgraded to a decrease era throughout coaching, however I wager your PCIe will work.
Do you might want to stick to two layers? Do as a lot impedance matching as you possibly can, deal with your differential pairs with respect, and your prototypes will work simply high quality; in spite of everything, PCIe has been mentioned to run on moist chains and we now have seen confirmations one after one other. My differential pairs are usually 0.35mm/0.15mm which is nicely inside the limits of the economical 2 layer course of and leads to an impedance of round 130 ohms which is imperfect however higher than nothing. For issues like PCIe and SATA, M.2 usually retains the entire high-speed differential pairs on the high of the cardboard, and this alone helps rather a lot with issues like an uninterrupted floor layer under its pairs. In case your workflow and funds enable for 4 layers, go for it!
Add a floor fill airplane upkeep airplane within the space the place the golden fingers go; In any other case, you possibly can short-circuit a bunch of vital pins on the host aspect when inserting the cardboard. The usual additionally suggests a airplane of exclusion within the internal layers under the fingers, so maintain that in thoughts in the event you go for 4 layers or extra.
When stenciling, ensure that the solder paste doesn’t come into contact together with your fingers on the M.2 card; clear them nicely earlier than reflowing in the event you do, as a result of it is rather more painful to get them solder free afterwards. 0.8mm PCBs are skinny, and in the event you determine to blow them out with sizzling air, repair them in a approach that does not stress them. warmth gun that was maybe slightly out of calibration.
By way of energy, you solely get 3.3V, at one or two amps. That is each a blessing and a curse – it has loads of energy and often would not want additional regulation, as most chips are high quality with 3.3V, however there are nonetheless some good makes use of for 5V. Producers who want get 5V on an M.2 card, they have an inclination to resort to cursed workarounds: right here it’s the story of a dell adapter making a 2.5″ HDD connector from M.2, which redefines one of many GND pins as a proprietary card detect pin and sends 5V to a gaggle of reserved pins if that pin isn’t linked to GND.
Analysis and proceed
Designing a card for an present gadget and anticipating a sure interface? Be certain it is truly there: As I discussed, you possibly can count on PCIe in sockets A, E, and M, and USB 2.0 in sockets A, E, and B, anything is not a given. If the web would not show you how to right here, in search of traces coming from the socket may work, however it’s not all the time foolproof as a result of the indicators could also be passing by way of vias below the socket. That mentioned, in the event you can detect traces or sequence capacitors of differential pairs, that can be indication, or maybe, utilizing a multimeter for an IC inside diode check on USB2 or single ended indicators like PERST/PEWAKE/CLKREQ could be in. order. In spite of everything, fairly just a few laptops have B-key slots that solely have USB 3.0 (ThinkPad T460s), and even simply USB 2.0 (ThinkPad T470S), although SATA and PCIe are sometimes accessible.
This concludes the “M.2 for Hackers” sequence. Some issues about M.2 could appear unusual while you first see it, however I hope I can make clear what is going on on and how one can get in on the motion. The M.2 ecosystem is not going away any time quickly, and it helps if we all know adapt it to our will the place obligatory!