cross-posted from: https://lemmy.world/post/6104468

On the other community, I have a post (https://lemmy.world/post/5214451) where I rough out 5 tiers of skill.

  • Tier 0: Wires and Connectors

  • Tier 1: Breadboarding

  • Tier 2: Simple low-speed PCB Design

  • Tier 3: Beyond 20MHz PCB Design and Leadless chips

  • Tier 4: Transmission Lines and BGAs

This PCB Design Tutorial from Phil’s Lab covers the big step between Tier1 and Tier2, perhaps the most intimidating step for most EEs. You’re spending real money every “attempt” after all, as there are very few repair mechanisms you can make to a finished PCB. (though with enough skill with Xacto-knives and some “deadbug” style soldering, you can probably repair more PCBs than you thought was possible).

Phil is obviously talking about this design/layout problem from a “Tier3” perspective though, thinking carefully about the (unused) analog-lines with a Pi-Filter (capacitor - ferrite bead - capacitor), and trying to use high-speed layout techniques wherever possible. But the fundamental problem is actually Tier2 or beginner level, despite all the caution that Phil does here.

So this is a great video, not only for tackling a beginner friendly problem, but also for doing it from an “expert’s eye / mindset”. A beginner probably can solve this problem without as much thought/effort as Phil put here, but its good to build habits and your higher-tier skill levels even on this simpler problem.

Below is my original post from [email protected]:

While this 1-hour / 40 minute talk may seem intimidating at first, its a complete beginning-to-end of building a custom STM32F1 PCB. This is probably best for someone trying to make the leap into PCB-design.

The STM32F1 is overall a beginner friendly chip, relatively low power and robust with a large community of people to ask for help on. I’ve never personally used this chip, but its got a solid reputation as beginner friendly.

Decoupling and Crystal-Oscillators are the hardest part of this particular schematic / pcb design. Electricity moves slower than a beginner expects: when a fast circuit (such as a 16MHz Microcontroller) takes in power, there is a “local power outage” as electrons “near” the chip gets sucked out, lowering voltage and potentially blacking out the chip, before the electricity begins to flow.

A decoupling capacitor provides a source of electrons during this brief, nanosecond-level blackout, improving reliability in your design. Its good practice to just scatter 100nF capacitors around Vcc/Gnd pins “just in case” (why bother running analysis when capacitors are a penny each?). This overall analysis is called PDN (power distribution network), but at Tier2 / just graduating off of breadboards level, let’s keep the analysis simple and crude. You can make a masters degree out of this subject alone after all.

At Tier2 / low speed designs, it’s as simple as throwing 100nF capacitors at each Vcc pin. This video makes things a bit more complex with a Ferrite Bead + 1uF Pi-network but beginners can completely ignore this aspect of the video (or even remove it from their circuit) and everything will still work (albeit the ADC will have slightly higher noise levels, but work nonetheless). I’d rather this advice that Phil gives at roughly Tier3 skill level. (Which is good for those who want to be a stronger PCB designer, but the absolute beginner can ignore this aspect).

Now Crystal-Oscillators are famously tricky to start and debug. Without measuring, your “16MHz clock” might be closer to 15.999927 MHz instead (~83ppm or worse) off. I think beginners “don’t care” about this, but EEs are very peculiar about getting clock timing correct… aiming for +/- 20ppm at all temperatures and voltage conditions. If a crystal problem happens, I don’t think the beginner has any ability to debug it (it requires a very low capacitance oscilloscope and other fancy equipment to properly debug a misbehaving XTAL), but modern chips are pretty robust in general.

Despite the potential hassles and roadblocks… I think beginners should try laying out the Crystal-Oscillator. If there’s a problem, you can configure the STM32F1 to use its internal clock (which is only 1% accurate, or could be as far off as 15.8 MHz). So its a win if you lay it out successfully, and maybe just a minor-inconvenience if you fail at it. A good potential learning experience in any case.

The key here is that the beginner needs to be aware of potential clock problems and have a plan to test if something goes wrong. IMO, Phil here is aiming this video at maybe Tier3 or higher skill levels and assumes that the watcher can instantly make a plan (like I did in the previous paragraph), so it went unsaid in the video.

Things will go wrong in electronics. But we engineers figure out contingencies and learn to plan by doing things. Not much we can do aside from experience the failures (or successes) on our own to gain experience.