Tutorial: How to Design Your Own Custom Microcontroller Board — Part 2

Part 2 of the tutorial on how to design your own custom microcontroller board.

John Teel
6 years ago

In this second tutorial you’re going to continue learning how to design your own custom 32-bit microcontroller board based on an Arm Cortex-M0 STM32 from ST Microelectronics.

In the first part this tutorial we covered how to design the system level block diagram, select all of the critical components, design the full schematic circuit diagram, and run schematic verifications.

Now, you’re going to learn how to turn the schematic diagram into a real-world PCB layout which can then be sent to a manufacturer for prototyping or mass production.

This is a short introduction to a free tutorial from PredictableDesigns.com. See the complete and most up-to-date version of this tutorial here [includes tutorial video].

Once the schematic design is completed, it’s time to design the printed circuit board.

Let’s begin by inserting all of the components into the PCB layout. In DipTrace, you can use the “Convert to PCB” function in the schematic to automatically create the PCB with all of the components inserted.

NOTE: For more in-depth training check out my PCB design course which includes over 3 hours of video where I design a more complex STM32 board.

Component Placement

Although all of the components have been inserted, it’s your job to determine exactly where each component is placed on the PCB.

Most PCB design software packages include an auto-placement feature that places components with the goal of minimizing routing lengths. But I never use it, and it’s almost necessary to manually place the components in the best layout.

For our initial tutorial circuit, the component placement is pretty simple. Place the microUSB connector next to the linear regulator with its output as close as possible to the input supply pins (VDD) on the microcontroller. Finally, place the programming connector anywhere that is convenient.

Once all of the core components are properly placed, your next step is placing all of the passive components (resistors, capacitors, and inductors). For this initial design the only passive components are capacitors.

One key aspect of designing electronics that you need to learn is the concept of parasitics. Parasitics are passive components (resistors, capacitors, and inductors) that you don’t intentionally design into your circuit. But, nonetheless, they are there and impact performance.

For example, although a signal trace is intended to be a perfect short, it in fact has some finite resistance, capacitance, and inductance all of which become more significant as the trace length increases, and as the number of bends and vias increase.

So this means that if a voltage source is located far away from the load, which is the STM32 microcontroller in this case, there is essentially a resistor between the load and the source (neglecting any capacitance and inductance).

If the microcontroller all of a sudden requires a fast spike of current then it will cause a voltage drop across this trace resistor.

So even though the voltage regulator’s output may be a perfect 3.30V, the voltage at the microcontroller pin will be lower during this current surge. Decoupling capacitors are used to solve this problem.

Remember, capacitors are like little batteries that store electrical charge. Placing them right at the microcontroller’s supply pins allows them to supply any fast, transient current needs of the microcontroller.

Once the transient load disappears the capacitors are recharged by the power supply so they are ready for the next transient increase in load current.

PCB Layer Stack

A printed circuit board is made up of stacked layers. Conducting layers are separated by insulating layers. The minimum number of conducting layers is two. This means the top layer and the bottom layer can be used for routing signals, and these two layers are separated by an internal insulating layer.

For this tutorial we’ll start with a 2-layer board to keep things simple. But as the circuit complexity increases you’ll find it necessary to add additional layers.

The number of conducting layers is always an even number, so you can have a board with 2,4,6,8,10,12 conducting layers. Most designs will require 4–6 layers, and more advanced designs may require 8 or more layers.

Routing

Once all of the components have been properly placed it’s now time to perform the necessary routing. There are two options for routing: manual and automatic.

For auto-routing in DipTrace you simply select Route -> Run Autorouter and the software will automatically do all of the routing.

Unfortunately, auto-routers in general do a horrible job, and in almost all cases you will need to manually do all of the routing. For this tutorial we will be doing all of the routing manually.

When routing on a PCB you want to minimize the length of each trace as much as possible. You also want to minimize the number of vias and avoid any 90 degree bends in the traces. These recommendations are especially critical for high power traces and high speed signals.

A via is a hole between layers with conducting material that allows you to connect together two traces on different layers. Most vias are what are known as through vias which means the via tunnels through all layers of the board.

Through vias are the simplest type to manufacture because they can be drilled after the entire PCB layer stack-up is assembled.

Read the rest of this article here.

P.S. Download your free cheat sheet 15 Steps to Develop Your New Electronic Hardware Product.

John Teel
I'm an electronics design engineer, entrepreneur, and founder of Predictable Designs.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles