EAGLE Project Directory Structure for Professional PCBs

Do you want to make professional grade PCBs using EAGLE? If so, using a well defined PCB project directory structure is a great place to start. I’ve outlined my preferred directory structure for EAGLE projects in this post.

In my work for clients, I design many PCBs. To ensure a high-quality deliverable for my clients, I consistently use the same PCB project directory structure.

There are probably as many opinions on the optimal directory structure for a PCB project as there are hardware engineers.

I use a variety of PCB design tools. For many clients, EAGLE is the preferred PCB design tool. The PCB project directory structure outlined below has tended to work well for me over the years when using EAGLE.

Not every sub-directory is included in every project but using a consistent structure helps me to maintain quality and makes it obvious if I’ve overlooked something.

I am also an advocate of the “hit by a bus” school of risk management. Despite the morbid name and low likelihood of being hit by a bus, I believe that it is worth maintaining a “what if” mentality.

Over time, it is quite common for project responsibility to be transferred between engineers or even between firms.

A well-defined, intuitive directory structure permits a seamless handover of project ownership between engineers.

Finally, it is worth sparing a thought for your future self. Years may pass between PCB revisions. Even if you are the creator of all the previous PCB revisions, a familiar directory structure with all relevant material available locally will help to ease you back into the design.

PCB Project Directory Structure

Archive
  <Rev 1>
  ...
  <Rev n-1>
Current
  <Rev n>
Zip Files
  <Rev 1>
  ...
  <Rev n>

PCB Revision Directory Structure

<Rev n>
  Application Notes
  Assembly
  Bill of Materials
  Board Model
  Calculations
  Collateral
  Component Datasheets
  Documentation
  Design Rules
  Manufacturing Data
  PDF
    Layout
    Schematic
  Pictures
  Reviews
    Schematic
    Layout
  Simulations
  eagle.epf
  [Project Name].brd
  [Project Name].sch

Directory Contents

Application Notes

Integrated Circuit (IC) vendors regularly provide Application Notes to assist with the integration of their ICs in a user’s design.

If an Application Note is particularly relevant and novel, I will store it in this folder.

Assembly

The “XY files” used to program automated pick and place machines for PCB Assembly are stored in this folder.

Instructions to assist with manual assembly may also be stored in this folder, if appropriate.

Bill of Materials

The PCB Bill of Materials (BOM) files are stored in this folder.

Typically, a Parts List and an Order List are included. These are usually supplied in both CSV and PDF file formats.

Board Model

3D models of PCBs populated with components are becoming increasingly common. This is particularly true in applications where the enclosure form factor is a critical design constraint, e.g. wearables.

Support for 3D models has continued to improve within EAGLE, particularly since the Autodesk acquisition.

If I have generated a 3D model of the PCB, the files are stored in this folder. These files can be shared with an industrial designer, as appropriate.

Calculations

Occasionally, calculations need to be carried out for component selection, e.g. LED series resistor values.

If the calculations are sufficiently complex or novel, I will store them in this folder. Normally, the calculations are stored in an Excel spreadsheet and allow for process, voltage and temperature (PVT) variation in the relevant component parameters.

Collateral

Secondary documentation that is beneficial to the board designer or user is stored in this folder.

For example, if the board is a daughtercard for a main board or development kit, a PDF of the schematic or user guide for the main board may be included in this folder.

Component Datasheets

I maintain a library to store the datasheets for the components in my EAGLE libraries.

Upon project completion, I use a batch file to copy the datasheet for each part listed in the BOM into this folder.

This ensures that documentation for each component is available to the project owner indefinitely. Experience has thought me that this is well worth doing for several reasons.

For example, over time parts will inevitably become obsolete or hard to source. Some vendors are less focused than others on maintaining access to documentation for obsolete parts. Debugging or updating a design many years after it has been created is usually much easier when all relevant documentation is available. Murphy’s Law ensures that the datasheet you can’t source is the one that you’ll need most!

Also, for project activities such as achieving and maintaining a CE marking, having all relevant datasheets easily available greatly helps with the audit trail, technical file generation, etc.

Documentation

End user documentation is crucial for certain types of boards. For example, development kits and evaluation boards often require explanatory documentation in addition to the standard schematics, BOM, etc.

If appropriate, additional documentation such as a user guide is stored in this folder.

Design Rules

EAGLE uses a .dru file to apply design rules to a PCB project. The .dru file for the project is located in this folder.

I maintain a library of .dru files for a variety of board stack-ups and PCB vendors. I copy the appropriate file from this library using a batch file when creating the project.

Manufacturing Data

The Gerber and Drill files for the board are stored in this folder.

Details of the PCB stack-up and instructions for the PCB fabricator are also included in this folder.

PDF

PDF versions of the schematic and layout are stored in this folder (and the associated sub-folders).

The PDF versions of the schematic and layout tend to be very useful. They are convenient for colleagues or partners that don’t have access to the PCB design tool. For example, I regularly share the PDFs with firmware engineers and industrial designers.

Pictures

A picture tells a thousand words and are invaluable for documentation. High resolution photographs of the PCB (both pre and post assembly) are stored in this folder.

PCB fabrication services such as OSH Park may provide illustrations of a PCB before it is fabricated. If these are available, I will include them in this folder also.

Reviews

When developing PCBs for clients, formal schematic and layout reviews are an integral part of the development process.

To be meaningful, these reviews should be documented. The details of these reviews are stored in this folder.

Simulations

In some PCB designs, simulations are quite important to ensure that the design specifications are met. If so, the simulation files are included here.

Typically, I simulate analog circuits using LTSpice. I use tools such as HyperLynx for signal integrity and power integrity simulations.

About EAGLE

EAGLE is an acronym of Easily Applicable Graphical Layout Editor.

EAGLE includes a schematic editor and PCB layout tool.

Though not as powerful as Altium Designer or Mentor Graphics PADS, for example, EAGLE is still widely used by both professional engineers and hobbyists.

About Me

I am the Managing Director of Mixed Signal Systems Limited. I’m an experienced Electronic Engineer focused on Mixed-Signal Electronics, Embedded Systems and the Internet of Things (IoT).

Please contact me if you’d like to discuss how I can help bring your product to market, resolve existing product issues or provide relevant industry insights.

BL652 Over-the-Air (OTA) Updates using VSP Mode

Over-the-Air (OTA) updates are incredibly useful in applications where plugging in a cable is inconvenient or impossible. This is increasingly the case in IoT products with extremely small form factors. I’ve recently used the BL652 BLE Module from Laird in a number of projects. Laird’s SmartBASIC run-time engine supports Over-the-Air (OTA) updating of SmartBASIC applications. Here are my thoughts on getting it to work successfully.

BL652 Module

The BL652 is based on Nordic Semiconductor’s very popular nRF52832 SoC. At the heart of the nRF52832 SoC is an ARM Cortex-M4 32-bit processor. The nRF52832 can be programmed using the two-pin Serial Wire Debug (SWD) interface available on the ARM architecture. For developers with the appropriate knowledge level, hardware and inclination, this allows the BL652 to be operated with entirely custom firmware or with low level control over the Nordic Semiconductor SoftDevice running on the nRF52832.

SmartBASIC Applications and Run-Time Engine (Interpreter)

For many developers working on BLE applications, accelerated product development time and ease of use is more important than low level control. For those reasons, Laird developed the SmartBASIC programming language and associated run-time engine to execute SmartBASIC applications running on modules such as the BL652.

SmartBASIC is derived from the BASIC programming language. It is very easy to use with a simple code syntax. User applications written in SmartBASIC are anticipated to be “event driven”. This reflects the typical use case for BLE modules in embedded systems.

When the BL652 module is shipped by Laird, it comes pre-loaded with a SmartBASIC run-time engine. During module operation, this run-time engine interprets the user’s SmartBASIC code to execute the application.

For SmartBASIC application development and downloading, Laird provide a terminal emulator called UwTerminalX. UxTerminalX will be used to interact with the SmartBASIC run-time engine running in the BL652 module to download the user’s SmartBASIC application.

The SmartBASIC Core Functionality User Guide is a very thorough resource if you are interested in learning more about SmartBASIC.

Downloading SmartBASIC Applications to the BL652

The BL652 ships with the initial Production Release (v28.6.1.2) of its SmartBASIC run-time engine pre-programmed. Obviously, the user’s SmartBASIC application code is not pre-programmed on the module when it arrives. The user’s SmartBASIC application must be downloaded to the module. This can be done in many ways:

  1. Through the UART Interface (Serial Port) on the BL652.
  2. Through the SWD Interface on the BL652.
  3. Wirelessly “Over-the-Air” using the Virtual Serial Port (VSP) on the BL652.

During development (and in some product configurations), it is common to download the user’s SmartBASIC application to the BL652 module over its UART Interface. This is option 1 above. A computer (running UwTerminalX) or an embedded host processor communicates with the BL652 over a UART interface, i.e. through a serial port. This is the approach commonly used when working with the BL652 Development Kit (DVK-BL652).

In a production environment, option 2 in above list may be the most appropriate programming approach. It is possible to rapidly program the latest version of the SmartBASIC run-time engine and a user’s SmartBASIC application on to the BL652 in a single operation over the SWD interface.

Option 3 provides an interesting alternative to the first two options. Unlike the first two options listed above, this method does not require a physical connection between the programmer and the BL652 module to be programmed.

What is the Virtual Serial Port (VSP)?

The BL652 running the SmartBASIC run-time engine has a physical UART interface, i.e. serial port.

In SmartBASIC Interactive/Development Mode, this UART is used to interact with the SmartBASIC run-time engine using AT commands and to download a user’s SmartBASIC applications.

In SmartBASIC Run-Time Mode, this UART is available for use by the user’s SmartBASIC application, e.g. to communicate with a peripheral in the user’s product.

The Virtual Serial Port (VSP) provides similar functionality over BLE.

In VSP Command Mode, AT commands that are sent over BLE to a VSP Service running on the BL652 will be handled by the SmartBASIC run-time engine. The SmartBASIC run-time engine will send back appropriate responses to the AT commands. A SmartBASIC application can be downloaded to the BL652 wirelessly in VSP Command Mode. This is a very useful feature!

In VSP Bridge to UART Mode, data sent over BLE to a VSP Service running on the BL652 will be passed to the physical UART interface. For example, an app running on a smartphone (with a BLE interface) could communicate directly with a peripheral in the user’s product.

Further information on the Virtual Serial Port (VSP) is provided in the BL652 Datasheet and BL652 SmartBASIC Extensions User Guide.

Enabling VSP Command Mode

VSP Command Mode can be enabled at module power-up or reset.

To enable VSP Command Mode, the following conditions must be met:

  1. SIO_02 (Pin 23) must be externally driven or pulled high.
  2. SIO_13/nAutoRun (Pin 28) must be externally driven or pulled low.
  3. There must be no $autorun$ application present in the BL652 filesystem.

Condition 3 is subtle. Condition 2 states that the nAutoRun pin must be pulled low. Under those circumstances, if an $autorun$ file is present in the filesystem, it will load automatically and VSP Command Mode will not be enabled. The ERASEFILESYSTEM function can be used in a SmartBASIC application to erase an $autorun$ application, if required.

Below, using the nRF Connect for mobile app from Nordic Semiconductor, a BL652 is seen advertising in VSP Command Mode.

After the BL652 enters VSP Command Mode (through a module power-up or reset), it will advertise until a BLE connection is made or a timeout period elapses. The timeout period isn’t very long – less than a minute. The Device Name is always “LAIRD BL652”. The 6-byte Device Address (MAC Address) is different for each device.

BL652 Advertising in VSP Command Mode captured on nRF Connect App

For products incorporating the BL652, it is usually a good idea to permit external configuration of the SIO_02 and SIO_13 pins. To keep the required area, BOM cost and access to a minimum, this can be done with test points, jumper links, pull-up/pull-down resistors or miniature push buttons, as appropriate. An example implementation from a recent project that I worked on is shown below.

BL652 - SIO_02 and SIO_13 - Example Configuration

OTA Programming with the BL652 Development Kit

The BL652 Development Kit (DVK-BL652), shown below, can be used to wirelessly download SmartBASIC applications to a target BL652 module.

BL652 Development Kit (DVK-BL652)

Laird provide an explanation of how to use the BL652 Development Kit to program modules wirelessly in the OTA Loading of smartBASIC Applications – BL652 to BL652 Application Note.

Here, I will provide an alternative explanation based on the same approach.

Principle of Operation

When downloading SmartBASIC applications wirelessly between two BL652 devices, Laird’s Virtual Serial Port (VSP) BLE Service is used in both devices.

BL652 - OTA Programming - Principle of Operation

Development Kit BL652

The BL652 on the Development Kit operates in a pass-through mode. This is the use case for the VSP Bridge to UART Mode, described above.

The physical UART interface on this BL652 is connected to a PC running UwTerminalX. The BLE interface is connected to the BLE interface on the target BL652.

It receives data on its physical UART interface (from UwTerminalX) and transmits this data over its BLE interface. Similarly, it receives data over its BLE interface and transmit this data over its physical UART interface (to UwTerminalX).

In effect, AT Commands and Responses pass between UwTerminalX and the BLE interface.

The $autorun$.VSP.UART.bridge.outgoing.sb SmartBASIC application, available in the BL652 Sample Applications Library, implements the required functionality on the Development Kit BL652.

Target BL652

The target BL652 operates in VSP Command Mode (once configured to do so at power-up or reset).

The BLE interface is connected to the BLE interface on the Development Kit BL652. Data received from the BLE interface, typically AT commands, is handled by the SmartBASIC run-time engine. Data transmitted to the BLE interface, typically responses to AT commands, is generated by the SmartBASIC run-time engine.

BLE Interface Connection

For the Development Kit and target BL652 devices to communicate, a BLE connection needs to be established.

In VSP Command Mode, the BL652 behaves as a “server” awaiting connections. As the target device is operating in VSP Command Mode, the Development Kit device will need to act as a “client” and connect to the target device. This is reflected in the file name of the SmartBASIC application mentioned above, $autorun$.VSP.UART.bridge.outgoing.sb.

Connection Parameters

The Development Kit device needs to know what target device to connect to. For this reason, the Device Address (MAC Address) of the target device must be known. The Device Address can be determined in many ways. It may be convenient to use the nRF Connect for mobile app from Nordic Semiconductor to do so.

Before running the $autorun$.VSP.UART.bridge.outgoing.sb SmartBASIC application on the Development Kit, the Device Address of the target device must be updated in the application source code.

This is done in the line beginning with #define BTAddr. A seven-byte value is expected. The first byte indicates the address type and the remaining six bytes indicate the actual Device Address. A value of 0x01 for the first byte indicates a Random, Static Device Address. A value of 0x00 for the first byte indicates a Public (i.e. IEEE defined) Device Address.

For the SmartBASIC application to attempt to connect to the target device automatically, #define CONNECT_ON_STARTUP 0 should be changed to #define CONNECT_ON_STARTUP 1 in the application source code.

SmartBASIC Application Download

Once a connection has been established between the Development Kit and the target device, UwTerminalX can be used to interact with the target device in the usual manner.

The “XCompile + Load” command can be used to download a SmartBASIC application to the target device. The download speed may be slower than with a wired UART connection to the target device but given the convenience, the trade off is well worth it.

BL652 - OTA Programming - UwTerminalX Screenshot

About Me

I’m an experienced Electronic Engineer focused on Mixed-Signal Electronics, Embedded Systems and the Internet of Things (IoT).

Please contact me if you’d like to discuss how I can help bring your product to market, resolve existing product issues or provide relevant industry insights.

Podcasts for Electronic Engineers, Hackers and Makers

Podcasts are a great way of keeping up to date with what is happening in the fields of electronics and embedded systems. They also offer the opportunity to learn from the experiences of others in the wider technical community.

There are three podcasts that I listen to regularly. All three podcasts are well produced and frequently release new episodes. Each podcast has a slightly different focus – based mainly on the background of the hosts.

The Amp Hour

The Amp Hour is co-hosted by Dave Jones (EEVBlog) and Chris Gammell (Contextual Electronics). New episodes are released weekly.

Dave is based in Sydney, Australia and Chris is based in Chicago, USA. Despite having hosted well over 300 episodes together, the two only met in person quite recently when Chris dropped in on Dave down under!

Both Dave and Chris are hardware engineers. Naturally then, some of the most informative episodes have been hardware related.

Dave and Chris regularly interview guests on The Amp Hour. The two co-hosts have different but complementary interview styles, and this generally works quite well.

The guest list is enviable. As the podcast has a technical rather than business focus, the interviews with startup founders, CTOs, etc. are usually more engaging and open than one might expect.

Twitter:
The Amp Hour
Dave Jones
Chris Gammell

My Favourite Episodes:
#77 – An Interview with Dr. Howard Johnson – Winsome Waveform Wizardry
#196 – An Interview with Mike Engelhardt – SPICE Simulator Synteresis

Embedded.fm

As the name suggests, Embedded.fm is a podcast with a focus on Embedded Systems. Elecia White and Christopher White co-host the podcast and release a new episode on a weekly basis.

This podcast tends to have more of a focus (and expertise) on embedded software and algorithms than The Amp Hour. The two podcasts complement each other very well. Occasionally, the two shows hold crossover episodes.

Elecia and Christopher have a light-hearted and jovial interview style, but both can get right to the heart of the most technical matters in a very accessible manner. My ears perk right up any time a Kalman Filter is mentioned!

Elecia and Christopher run Logical Elegance – a California based consulting company.

Elecia is also the author of Making Embedded Systems: Design Patterns for Great Software.

Twitter:
Embedded.fm
Elecia White
Christopher White

My Favourite Episodes:
9: Kidnapped and blindfolded
53: Being a Grownup Engineer (with Jack Ganssle)

The Engineering Commons

The Engineering Commons tends to have a broader focus than either The Amp Hour or Embedded.fm podcasts. With multiple co-hosts and a focus on all aspects of engineering, conversations with multiple perspectives tend to evolve over the course of each show.

Episodes are released less frequently than that the other two podcasts – perhaps once or twice a month on average.

The broad range of topics covered on The Engineering Commons makes this podcast of great interest to anybody wishing to become a well-rounded professional engineer.

Twitter:
The Engineering Commons
Jeff Shelton
Carmen Parisi

Free Software Tools for Electronic Engineers, Hackers and Hobbyists

Here are some of the free software tools that I use daily while working on both professional and personal electronics projects.

Are there any free software tools that are indispensable to you? Please share your thoughts in the comments.

Notepad++

Notepad++ LogoNotepad++ is a versatile source code editor. It probably has as many uses as it has users.

I usually use it to view and edit C, CSV, XML, PHP and HTML files.

It supports a variety of plugins. I find the file comparison and FTP management plugins particularly convenient as they are integrated seamlessly into the editor.

LTSpice

LTSpice LogoLTSpice is a fantastic professional-grade SPICE simulator from Linear Technology. The fact that it is free should not be viewed as a reflection of its quality or versatility.

There is a great interview with Mike Engelhardt, the man behind LTSpice, on The Amp Hour podcast.

SPICE is an acronym of Simulation Program with Integrated Circuit Emphasis. The Computer History Museum recorded a very enlightening panel discussion on how SPICE originally came into being at UC Berkley in the early 1970s. It is available here.

EAGLE

EAGLE LogoLike many hackers and hobbyists, EAGLE is the first PCB design tool that I used. It’s still the one that I use most regularly though Altium is always lurking somewhere in the background.

After the recent acquisition by Autodesk, licensing for EAGLE has switched to a subscription model. There is still a free version available that is attractive to many users. The PCB layer count and area are both limited in the free version but for many users, this is not a problem.

EAGLE is an acronym of Easily Applicable Graphical Layout Editor.

KiCad

KiCad LogoKiCad is both free and open-source. For many hackers and hobbyists, it is an attractive alternative to EAGLE.

I use KiCad occasionally, but it is not my first choice PCB design tool. It is continually being improved by the community of people that support the tool. More recent versions are considerably improved in comparison to the early versions that I used many years ago.

FreeCAD

FreeCAD LogoI’m not an industrial designer so I don’t know how feature rich or easy to use FreeCAD is in comparison to the costlier alternatives available on the market.

I do know that it does everything that I need it to do. I use it to view 3D models of components that I use in my PCB designs. I also use it to view 3D models of enclosures that I receive from industrial designers that I work with.

The interface takes a little bit of getting used to but that is the same for most CAD tools.

Octave

GNU Octave LogoGNU Octave is a free alternative to Matlab.

Octave is a great tool for carrying out numerical computations. For example, Octave can be used to determine the appropriate filter coefficients to be used in a FIR or IIR filter.

Like Matlab, Octave has a variety of packages available to aid numerical computation in a range of fields.

nRF Connect for mobile

nRF Connect for mobile LogoBluetooth Low Energy (BLE) enabled projects are very popular these days. Quite a lot of my current work for clients involves BLE.

If you are working on a BLE project, the nRF Connect for mobile app is incredibly useful.

Nordic Semiconductor manufactures a range of BLE enabled devices including the nRF51822 and the nRF52832.

To support product development and debug, they have released this BLE scanner and logger app. It can be used to connect to BLE devices and supports reading and writing characteristics, etc.

It is available on both Android and iOS though the Android version has many more features.

Audacity

Audacity LogoIf you’re working on an audio electronics project of any description, then Audacity will be high on your list of must-haves.

Audacity is a widely used audio recording, processing and playback tool.

Audacity is both free and open source.

Evernote

Evernote LogoAs the name suggests, Evernote is a note-taking tool.

I find it useful for making quick notes on whatever topic I happen to be working on at the time. There are iOS and Android apps available for Evernote. Being able to make a quick note on my phone and then have it sync to the Evernote app on my laptop is great.

I occasionally use Evernote to record bench measurements on my phone. It’s no substitute for the good old-fashioned lab book but the convenience is sometimes beneficial.

Todoist

Todoist LogoAt any given time, I’m typically working with many different clients. I also tend to have my own projects on the go.

I wanted a simple to-do list app to help me keep on top of things. I didn’t want a complex project management tool. Something little more advanced than pen and paper would do fine and Todoist did the trick for me.

As well as a Windows app, there are also iOS and Android apps available for Todoist. I find it handy to be able to quickly add a task on my phone and know that it won’t be forgotten about down the line.

Todoist isn’t the perfect tool but I think that the perfect task manager has yet to be invented. Todoist certainly helps me keep on top of my to-do lists, both personal and professional.