I agree.
I think that in uC without pll main sources of harmonics are all internal registers switching at xtal frequency. But I suspect xtal layout because it is much bigger than what is inside and even through crystal mostly sinus goes I’m not sure of generator output signal (voltage or current) shape.
I would move GND via near pin 4 to the right to make OSC_IN shorter.
I would connect top GND track to uC GND pin.
I would finish down GND track with via to GND as close to Reset track as possible.
I have in all my footprints Courtyard such defined that I then position elements with just touching their courtyard lines (I’m speaking about C1 na C3 and Y1).
I would shift all crystal circuitry ac close to uC as possible to make all these connections as short as possible.
Connecting C3 to GND track going from crystal pin 2 will allow to route OSC_IN under crystal making it shorter.
Better, but you can still scoot it down and to the right a bit. And you can extend the ground stubs a bit more. Then, when you add a top ground plane (you should, and it is easy) it will snuggle up to the stubs. You already have a bottom ground plane – it is easy to add the top: select your bottom plane, press E, and add a checkbox to the top layer (and inner if applicable and desired). Tweak the clearance to your liking, thermals… You can remove islands (and should if they will be floating) or allow them and add some gnd stictching vias to connect them to the main plane:
I have no idea what Bigtechtree is using for a crystal (and just because you find some circuit online, does not mean it is optimum or correct), but typical 8MHz xtals are about 20pF parallel mode so 10pF caps are kinda small. I am currently using these xtals:
Mouser 520-80-20-33-JEN-TR3 – Crystal, 3.2x2.5mm, 8.000MHz, 20pF, 20/50ppm, 400-ohm
JLC/LCSC C648987 – Crystal, 3.2x2.5mm, 8.000MHz, 20pF, 20ppm, 200-ohm
The resistor is optional. I always include it but it will work without it.
The ground plane can be as simple as a big sloppy trapezoidal polygon that is outside the edge-cuts – you set copper-to-edge clearance to something like 0.5mm and it fills properly. I usually draw the polygon on the bottom layer, then select it, press E (properties) and add the check box on top and inners. Then it fills nicely on all layers. Here is a little board (I drew a fancy polygon for a bit more control, but the sloppy polygon also works). Unfill the zones (Ctrl-B) and peek at bottom only:
For my PCB, I’ll need to use nearly all the available I/O pins. Is a layout like this acceptable, or should I switch to a 4-layer PCB? This routing doesn’t cut my back ground plane.
The layout looks pretty good. Would work pretty well with 2-layers, though 4 layers does not cost that much more and gives you a lot of flexibility for routing. One thing is that the signal-to-inner plane distance is typically about 8 or 10 mils apart on a 4-layer and not 63 mils like a 2-layer – this lowers impedance on the signals (better for emi). But it depends on your application whether you need to worry about emi. For your learning board(s), 2-layer is a good choice.
I am not a fan of the LD1117 pinout with output on tab. For the same sot223 package, I much prefer the MCP1825 (or similar parts in the ground-on-tab. The grounded tab will connect to the top ground plane for heatsinking (ignore that this is 5V vs 3.3V comparison):
Not sure if anyone has mentioned about your decoupling cap . . . you feed 3.3V to the MCU then the cap . . . it should be the other way round so the cap can feed to the MCU in preference to the 3.3V . . . after all that is what it is for.
Many years ago, I designed in an smt-only usb-micro jack like you are using. It didn’t take long until they started falling off due to, well, normal use. It does not take much vertical torque or shearing pressure to break the solder. It was a warranty repair nightmare.
I re-designed with a jack that had throughole shield pins for a solid mount. Here is a board that can use either a horiz or vert micro-B jack:
J98 is USB-micro-B horiz (hand-solderable smt/th) (mouser 656-DX4R005JJ2R1800)
J99 is USB-micro vert (hand-solderable th) (mouser 710-614105150721)
But, even better, is a really, really nice throughole USB-C jack that can run 2.0 speeds and can even snuggle inside the footprint of a standard usb-B so you can install either:
J99 is big-o-but-still-handy USB-B (hand-solderable th) (mouser 649-61729-1011BLF)
J11 is nice USB-C (2.0 speed) (hand-solderable th) (mouser 179-UJ20CHGSMTTR)
I’m not sure what RaptorUK exactly had in mind but I would prefer connecting 3V3 to uC pin and then to 100nF capacitor over breaking bottom GND zone to route there this 3V3 track.
I think track impedance is what decides where from currents are taken. So if 100n is connected to uC 3V3 and GND pins with the shortest possible tracks the current pulses taken by uC are mainly taken from this 100nF.
What I would change is that I would position C10 on the way from U2 output to uC so the lower frequency parts of uC supply pulses will be taken from this capacitor (the highest frequency parts are taken via short tracks from 100nF).
Ignore the DNI on the 5.11k – this jack was optional on the default build of this board. For usb-c jack you need them.
Yes, AMS1117 and LD1117 are basically same part with vout on tab, which is means you need to add a zone polygon for heatsinking, whereas the gnd-on-tab parts connect to the top gnd plane which will provide heatsinking. You may not even need the heatsinking, as you are not drawing much current (unless you feed 3.3 out the board for other stuff). I usually use a tc1015 or similar which is a little sot23, and with a 100 mA draw, the power dissipated by the reg is only (5-3.3)(0.1) = 0.17 watts, which is quite low.
Caps though – as @RaptorUK and others have mentioned. I always place a 10uf/0.1uf at input to reg pin, 10uf/0.1uf at reg outputs, and of course 10uf/0.1uf at micro pins.
Options you may want to add: a couple of 22 or 24 ohm resistors in series with the d+/d- pins. You should ground the usb shield. TVS protection is always a good idea.
Side note, I’m working on adding a buck converter circuit for DC24V. I found the TPS56637RPAR, and its datasheet has a sample schematic that does exactly what I want (DC24V → DC5V). Can I just replicate this schematic in KiCAD?
That buck looks way more complicated than you likely need. I like to use dc-dc converter modules when I can. Peek at something like this:
mouser 919-R-78E5.0-1.0
8-28V in, 5V @ 1A out, sip-3 module
easy-peasy
This is drifting out of the scope of a kicad question (and I say that as someone who tends to push the boundaries of kicad questions a bit, much to the chagrin of the mods )
You need to research buck chips based on needed parameters. Mouser and digikey have decent search tools to narrow down your needs (Vout of 5V, Vin of say 30V min, current, packages…). That LM2596 only switches at 150kHz, so the caps and inductors are larger than more-modern chips that switch at higher freqs. Then see if they are available at jlc/lcsc.