First STM32 schematic, Did I mess anything up? - Page 1
Forum section: electronics / projects

author: warpigs330
author_rank: Contributor
timestamp: May 07, 2021, 07:18:23 am
content: So I am designing my first stm32 board (I know perfect timing), moving from the teensy 4.0. Before I start routing traces I was hoping someone could look over my schematic and make sure I didn't make any obvious mistakes. To give an idea of the goal for this is a modular synthesizer module. It has four outputs that come from a DAC through amplifiers to get them to 0-5v. It also has 5 gate inputs. there is also 7 buttons which have leds as well as multiple other leds. I have tested the buttons, gate inputs, leds, and dac with the teensy, I am just trying to move my project to an STM32. Ultimately my goal is to be able to program it through USB via a bootloader.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 07, 2021, 10:50:37 am
content: Your schematic is hard to view. Not enough pixels to make text readable.I have a strong dislike for all those blue lines to separate circuit parts. Those lines are annoying to maintain during revisions of a schematic, and they do not add useful information. Instead I prefer to use a bigger font (at least double size) for naming the sections.12pf is a bit smaller then usual for the crystal, but it could be right.You have a few LC filters. It could be a good idea to add a series resistor of a few ohms to lower the Q and suppress any oscillation tendency.You can also compare your schematics with a few of the many on Internet, Look at a few "Blue Pill" schematics or the "Maple Mini" or "Black Pill" WeAct STM32F411CEU6You've drawn a wire right through header H1. Is this intentional? It's still bad practice though.TL072 is not suitable for a single power rails. It needs a few volts of headroom from both power rails to work properly (Except inputs, they work from as high as the postive input rails).

author: poorchava
author_rank: Super Contributor
timestamp: May 07, 2021, 05:54:48 pm
content: I would add ferrite bead, like 1k@100Mhz (i usually use BLM18RK102SN1D, but that just me). It will keep noose from uC from propagating through your power supply. Not really sure about that 39nH inductor. With 1uF cap it results in fc of about 800kHz. If you want kill noise from uC (VDDA pin powers the PLL block) probably a ferrite bead makes more sense. If you want to clean up VDDA supply, probably lower fc is in order, since a 50...500kHz noise may theoretically interfere with PLL. That being said I've done probably like 20 STM32 designs that went to market (ie. passed EMC emissions and immunity) and I've never used anything else than 2 ferrite beads:one VDD, another one on VDDA + all capacitors required by the hardware design guideline. You can make all bigger MLCC (VCAP and bulk caps the same -4.7 or 10u). This way you reduce 3 different components to one.I generally use 18pF for crystal load caps. This comes from formulas given in some document.

author: warpigs330
author_rank: Contributor
timestamp: May 07, 2021, 06:36:59 pm
content: Thanks a ton for the feedback y'all. I was mainly just wanting to make sure I didn't make any egregious errors. I have made a couple changes to the VDDA and clock based on your suggestions, but it sounds like I am on the right track. Thanks again.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: May 07, 2021, 07:40:25 pm
content: Do I spy a Eurorack module?

author: pigrew
author_rank: Frequent Contributor
timestamp: May 07, 2021, 08:05:12 pm
content: Things mostly look right.Since you are using USB-C, you'll want a pair of 5.1k pull-down resistors from the CC1 and CC2 pins to GND.If you are using self-powered USB, you need a way to detect if Vbus is connected, and only enable the pull-up on D+ while Vbus is connected.I'd normally have an an always-connected resistor for BOOT0 to GND, since you'll very rarely (if ever) need to actually pull it high, and you probably never want it floating.

author: warpigs330
author_rank: Contributor
timestamp: May 07, 2021, 08:08:53 pm
content: I'm not sure I know what you mean by by self powered usb. This will be connected to a separate power supply in normal operation, though I would like to be able to program it over USB without the other power supply. The USB would only be necessary for firmware updates. I would probably program it with SWD.And it is totally a eurorack module!

author: pigrew
author_rank: Frequent Contributor
timestamp: May 07, 2021, 08:31:35 pm
content: Quote from: warpigs330 on May 07, 2021, 08:08:53 pmUSB devices are self-powered or bus-powered. Self-powered is when the MCU has an external power supply, bus-powered is when the MCU is powered from the USB bus. The schematic shows your design can be either.The USB spec says you shouldn't apply a voltage on D+ before it detects that Vbus is connected (seethis StackOverflow question). You may run into issues where USB enumeration fails if you connect the host after the MCU starts up.Then again.... maybe it doesn't matter much. If it's only for DFU, then you could instruct the user to always connect the host before entering USB DFU mode (through button presses or setting BOOT0 HIGH and cycling power).

author: warpigs330
author_rank: Contributor
timestamp: May 07, 2021, 08:40:59 pm
content: thanks a lot, that helps.

author: pigrew
author_rank: Frequent Contributor
timestamp: May 07, 2021, 09:03:27 pm
content: Quote from: warpigs330 on May 07, 2021, 08:40:59 pmReading a bit more, it seems that the ROM bootloader USB DFU mode does not detect Vbus (a pin isn't assigned for it), so if your application will never use USB for normal things, maybe you don't need it.