- cross-posted to:
- ece
- cross-posted to:
- ece
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.