Printed Circuit Boards out in the open

Ah, the PCB, the container for an embedded system which will be staring all Engineers in the face during the course of each project (either bare during the early stages or potentially within an enclosure to some extent further down the track).

Note that without a PCB, or hardware more generally, software would be meaningless and this is one of the main reasons why we need to appreciate and understand the hardware world.

One other practical motivation, which also strongly drove the creation of this course, is that more often than not the most complicated bugs in an Embedded System lie at the Software/Hardware interface and without an appreciation of both sides of the equation, they will be extremely difficult to root cause. Even just knowing the basics of hardware goes a very long way, so let's begin the journey!

For Software Engineers coming into the embedded world it will appear as a black box in physical form, some sort of wizardry which magically executes code that you "flashed" over a USB cable or via an SD card typically. Other options exist though of course, updating the software over Ethernet or JTAG are also popular during development. Don't worry if any or all of these terms are making little sense, we will unpack them all throughout this course which assumes zero hardware experience.

Ultra96 V2 Board - Bottom Side
Ultra96 V2 Board - Top Side with heatsink
Ultra96 Board V2 - Top Side without heatsink

As a case study we will be taking a look at an Ultra 96 v2 development board which features a Xilinx Zynq UltraScale MPSoC, a very powerful modern System on Chip which features both FPGA (more on this later) and traditional processor (runs code on cores line by line) components. Shown above are photos taken of the top and bottom sides with and without the heatsink to show the goodness that lies underneath.

PCB Layers

Starting with the basics, what is a circuit? A circuit is a common term used in electronics which refers to an electronic system which consists of a power source and a load where current flows and energy is delivered from the source to the load. More on current and voltage later on within this article.

Now a PCB has two sides visible on the top and bottom known as layers and on this particular board both sides have electronic components on them.

On a PCB we make electrical connections via traces, which are sections of copper that carry electronic signals as required by the electronic system.

In the photo below can you see all of the connections with the white outline between components? I have circled one of them in red to make this clearer, those are traces. On the right hand side are several of them which are making connections to the other side through copper plated holes known as vias which are circled in blue.

PCB with annotated traces, pads, pins and vias

Regions of copper are known as copper pours. Copper pours are typically spread over large areas of the board for routing power connections originating from the power supply. Each component then has connections on the edges, or underneath, for connecting to components around them which are known as pins (circled in green).

Taking the top side of the Ultra96 V2 board as an example, you will see many square components with white looking connections on the edges, those are the pins which connect to the board via pads (circled in orange). Each component then has pads on the board which we can then use to solder the parts to the board.

A bit more terminology while we are at it, the square components with pins on the edges are called Quad Flat Pack, or QFP parts and components which are square which have the pins underneath on balls are known as Ball Grid Array, or BGA parts. Most complex processors, FPGA's or SoC's use a BGA package.

They are called printed circuit boards as during the manufacturing process we print the traces and pads onto the board.

I briefly mentioned that layers exist on the top and bottom, but hidden layers also exist within the PCB to help route all of the connections. There are other reasons for adding these layers too but we will not concern ourselves with them for now, it's enough to know that holes plated with copper exist connecting the outer layers to inner layers which can connect partially through to the inner layers (don't drill all the way down) or all the way from the top to the bottom layer using vias.

One final piece of terminology I would like to introduce are headers. Headers are an indispensable connector that allow us to easily connect components on the board to the outside world. On the bottom side of the board you will see a 4 pin header at the top edge of the board which has the text J1 on the left of it. Any text written on the board is printed on what is called a silkscreen layer and on this board the silkscreen layer is white.

Voltage and Current

The two main quantities of interest that we measure within a circuit are voltage and current.

In electronic circuits, electrons flow through the circuit and electric current quantifies this flow in units of Amperes, [A] or Coulombs per second [C/s] by definition where 1 Coulomb is the total charge of 6.25*1018 electrons! A higher current simply means more electrons are passing a given point in the circuit each second. Expressed mathematically we have:

Where I is current, Q is the charge and t is the time for the charge to pass a point.

It is also worth noting that a current of 1A is quite significant, measurements within orders of mA and uA are for more commonly observed in Embedded Systems. Currents in the A range are more commonly observed in the power supply section of a circuit.

Now for the somewhat confusing part unfortunately, we have the concepts of electron current and conventional current which assume the direction that the current flows through the circuit. Before it was known that electricity was carried by electrons, Benjamin Franklin believed that positive charges were flowing through the circuit from the positive to the negative terminal. Due to this we now have two ways to represent the direction of the current, the path which electrons flow, which is from the negative terminal to the positive terminal and conventional current which flows the other way.

Conventional current flow is the standard conventional direction that Electronic Engineers follow, however, this aspect has no effects on any observed behaviour so it is best to think of current as flowing this way as illustrated below:

A very important point to always remember at this point is that current flows in loops! There is ALWAYS a return path!

Before we dive into Voltage, let's briefly discuss a related concept known as electric potential.

Charges experience a force when placed in an electric field and we can say that this electric force performs work to move the charge between two points.

Electric potential is the work required to move a charge from a reference point to a specified point. Expressed in another way it can be thought of as the potential energy per unit of charge (energy per coulomb).

It is the difference in electric potential between two locations that is of particular interest to Electronic Engineers, and this quantity is known as voltage (or potential difference) which has the units of Volts [V].

Where V is voltage, E is the energy for the total charge Q.

Batteries are a common device we are all familiar with which feature a voltage rating which is the difference in potential energy a charge has when moving from one terminal to the other. There is a chemical reaction inside the battery which converts chemical energy into electrical energy to provide the rated voltage.

Ultra 96 V2 Development Board Anatomy

Okay, so we now have a grasp of what a PCB is, basic electronic quantities and how components connect to each other, as well as the outside world. How can we then view the board at a high level in terms of functional groups?

Typical Embedded System

Shown above is a typical Embedded System. We have a processor which runs instructions fetched from memory, which may be a combination of internal and external memory, a power supply to provide power to the entire system and inputs and outputs connected to the processor. The external memory may also be used for storage, it could be a memory chip or even an SD card for example. In the context of Embedded Systems the processor is typically a Microcontroller which is essentially a microprocessor + internal peripherals for interfacing with the external world.

In terms of the Ultra96 we have the other typical variant of an Embedded System which is an SoC based system as shown below:

FPGA/SoC based Embedded System

For an FPGA/SoC based embedded system the setup looks remarkably similar although the memory serves a different purpose and we now have an FPGA instead of a microcontroller. At a very high level for the moment you can think of an FPGA as a device which contains configurable hardware within it which we configure as needed for our project at hand. The configuration memory then stores the configuration needed on boot up. Shown below is a block diagram of the Ultra96V2 board provided by Avnet:

Ultra96V2 Block Diagram

We will explore each of the peripherals in further detail in time, but for the moment notice we have 2GB of DDR4 memory attached to the MPSoC as well as a microSD slot for additional memory, user LEDs the MPSoC can set, 2 expansion headers, a mini display port video output, wifi and USB. A power supply is also required which isn't shown. Notice that these all fit within our embedded system view of an FPGA attached to a power supply, memory, inputs and outputs.

Summary

  • PCB's function as the host for an Embedded System containing layers to support electrical connections between components
  • Traces/tracks are copper connections which connect components on the PCB which can be routed over multiple layers if required using vias
  • Copper pours are regions of copper typically utilised by the power supply rails (more on this in the next part)
  • Voltage describes the energy available to charges and is always measured relative to another point on the PCB. It is measured Volts [V]
  • Current simply describes the flow of charge. It is measured in Amperes [A]
  • Embedded Systems feature a processing element (FPGA/Microcontroller or even a combination), memory (not always, could just be internal for some Microcontroller based projects), a power supply, inputs and outputs

Coming up next

In the next part of the course we will be taking a more detailed look at the power supply of an Embedded System.