← Back to context

Comment by stavros

5 days ago

This is great! I never understood how people learn how to make solid PCBs, I've made a few things but I think I must be missing some decoupling capacitors or resistors or whatever, because my microcontrollers aren't very stable. How do you all just know what stuff to put on the PCB? Do you read the datasheet for the component and add whatever is there?

Checking the datasheet is essential, they usually show the “must-have” parts around a chip. Beyond that, good habits are adding decoupling caps close to the pins, keeping ground solid, and following the reference layout. I also learned a lot just by listening to experienced designers explain their choices, like here: https://www.youtube.com/watch?v=aVUqaB0IMh4

  • Thanks, I'll read more datasheets, as I've kind of just been winging it (with terrible results, as you saw).

    • If you're pulling the datasheet from the vendor website, you can also skim the list of documentation and see if there are any application notes available for the part.

      For more "complicated" parts (e.g. lots of signals, high frequency, high power, etc.), integrating the part into a board design isn't necessarily straightforward. Rather than putting a ton of detail in the datasheet, the vendor will sometimes have an entirely separate document with design guidelines for the part.

basically every part will provide a minimal schematic in the datasheet or have a reference design you can copy from

some stuff may be somewhat glossed over, like usage of ground planes or which traces you're supposed to keep short, but when those are important they'll usually be mentioned, or even spelled out in a application note

Yeah, you have to read the data sheets. Beyond that, use decoupling caps for all power pins, as close to the chip as you can, and make one side of the PCB a ground plane. These 2 things should solve most of your issues.

  • Excellent, thank you. I already do the plane, but not the caps. Thanks!

    • Based on seeing lots of beginners (me, too, at one time) do ground planes wrong, this video may help:

      https://www.youtube.com/watch?v=EEb_0dja8tE&t=746s

      Hans Rosenburg explains some tricky concepts very clearly. The upshot is

      a) 4 layer boards are much easier to get right

      b) you really need an unbroken ground plane for return currents. This is often incompatible with having just two layers.

      c) putting the ground plane much closer to the protected signals is a really good thing. Again, that means 4 layer boards.

For an MCU: find a development board with schematics available, and use that as a reference/starting point.