Electronics Production

Individual assignment:

Basic premises:

Tasks, explained

Now that we have a list of tasks to complete, and a basic understanding of what's what, this is what we will attempt to build this week.

  1. A Master Programmer board1, which I will use to program any other boards over the rest of the course.
    1. And, based on what I've heard... there will be a lot of boards to create over the next few weeks, so the master board better be sturdy, stable, reliable and hard to break (non-functional requirement 😉).
    2. This board will use a SWD SAMD11C14 microcontroller
  2. An ARM based board2 that will be used as the programmer for our target board for this week's assignment.
  3. A target board4 based on the ATTiny XXXX
    1. This board will have 2 interfaces
      1. A UPDI programming interface, so we can load programs into it
      2. An FTDI debugging interface, so we can read values off of it and assess what exactly is going on inside.
      3. When we program it, over UPDI, we will use the adapter board3
      4. When we want to debug it, we can use the ARC SAC D11C2 directly.
  4. An intermediary board3 that will work as an adapter from FTDI to UPDI
    1. This board will have no microcontroller and just acts as a "translator" between protocols
    2. We will only need it to program the target board, if the target board requires UPDI to be programmed.

With this ecosystem, we will have most of the tools we’ll require for the rest of the course.

Wait… how are you going to do this?

By now, if you’ve been paying attention, you will have noticed that there’s a major gap in this documentation.

How are you going to program the first board (the master programmer), if you need a programmer board to load its logic?

Ah, the eternal question: Who programmed the master programmer?

That’s right! We cannot program our master programmer without another programmer. In order to program our master programmer, we will borrow an existing programmer from the FabAcademy instructors, once. Once the first student programs their master programmer, other students can use that students’ master programmer to program their master programmers.

In environments where there is no “FabLab Instructor who has a master programmer on hand”, you should be able to buy a JTAG programmer and use that to program your master programmer.

The microcontroller ecosystem

(as seen by a newbie, for the first time)

The ecosystem seems very complex from the outside, and my head is melting after a short 1h intro to the field, but it seems that this complex topic will be slowly evolving over the next few weeks. Feeling overwhelmed is a normal and reasonable feeling. Don’t fight it! 😉

Choosing the boards

Download the design files from fabcloud

We are going to be building:

Milling the boards

Before we get started milling the SWD-D11C, we need to make some tweaks, because the traces file has a defect.

The black separation is too narrow which could cause problems when we will it, potentially causing shorts.

We have to widen the path to isolate both parts of the circuit properly.

So, let’s get to it!

Iteration 1

PROBLEMS: If you don’t set the Z low enough, you will get a really shiny and polished surface instead of milled traces on the board.

Z is set too high when attaching milling bit:

After adjusting the Z again, and doing a second pass:

The result - my first milled board

Here’s a time-lapse of the milling process

Soldering the components to the boards

Before we get to Soldering, allow me to present this week’s Emotional Seismograph

Alright! a lot to unpack here:

Alright, now that we have this out of the way, let’s take a look at the finish boards.

As you can see, you can clearly see the progression from “first board to be soldered” to “3rd board soldered in my life” is obvious.

Programming the programmer

The last task to complete was to program the master programmer.

Since I used Adai’s board to program mine, I believe this makes him my legal guardian, or something!

Are there initiation rites or superstitions when it comes to programming boards?

EDBG - Atmel Embedded Debugger

In terms of programming, I used a command-line tool called edbg from ataradov/edbg to burn the bootloader into my microcontroller.

This application is available for windows, linux and mac and supports all Atmel Embedded-Debugger-based board.

In my case, I downloaded the latest edbg binary from Taradov’s page, as well as the base image for my board (D11C) , which can be found in the official mattairtech/ArduinoCore-samd repository.

In future weeks, we’ll discover other ways to program board, both, using a programmer, and without needing one, as well as using arduino IDE instead of edbg directly (arduino will still use edbg behind the scenes, but it also supports other ways).

Success

The board seems to work when plugged into the laptop

And it gets recognized as a USB device.

Nice USB handshake 🤝🏻, mate!

Lessons Learned

Loose milling bed

This is what a board looks like, if you fail to fix it properly to the the bed of the machine moves during milling.

Fix: Tighten the bed of the machine, so it does not move/shake/wobble during milling

Cheatsheet

Milling PCB traces using mods

In the barcelona FabAcademy we have a Roland SRM-20 mill, so we will use the settings for the program for that device.

  1. Right-click on the empty mods project. You will see a popup menu:
    1. select “Programs > Open Program” and pick our device from the list (Roland SRM-20 mill Absolute, in our case).
  2. Load the PNG using the bottom panel:
    1. Check that the resolution is 1000 DPI or similar
    2. Check that the sizes match the board you are about to print
  3. On the “Set PCB Defaults” panel at the top of the page:
    1. Check that the mill diameter matches what you will install in the machine (1/64 inch)
    2. Set the Speed to 3mm/s
    3. Click the “mill traces” button
  4. On the “Roland SRM-20 Absolute Coordinates”
    1. Set Speed to 3mm/s
    2. Set Jog Height to 7mm
    3. Set Origin to (0,0,0)
    4. Set Home to (0,0) and 10Z
  5. Connect the output of “Roland SRM-20 Absolute Coordinates” to the input of “Save File” panel
    1. This will allow you to download the tool path once it is calculated
  6. On the “Mill raster” panel
    1. Click “Calculate”

This will generate and download a file on your browser. Load this file into your Roland SRM-20 machine in order to print the traces onto the board.

Cutting the PCB outline using mods

Repeat the same steps with minor changes:

  1. Load the outline file instead of the traces file.
  2. Set “PCB Defaults”, look at the second section called “mill outline 1/32”
    1. set speed to 1.5mm/s
    2. Click on the header button “mill outline 1/32”
  3. on the “Mill Raster 3D” panel
    1. check that “offset number” is set to 1 instead of 4.
    2. set max depth to 1.75mm instead of 1.828mm
  4. In the “Roland SRM-20 Absolute Coordinates” panel
    1. Set speed to 1.5 instead of 3mm

✨ Automating these almost-perfect programs

As you can see, the steps above are “almost perfect”, but they are incorrect in a couple of critical places, which makes us carry a mental load that we’d rather not have to carry, every single day.

After hearing that we will be doing custom boards almost every week for each of the individual assignments, I decided to customize the script, and test it out, before sharing it with the wider community.

These are the customized programs for mods:

You can right-click and “save as” these files.

In order to use them, just import them into mods, using the “Programs > Open program from file”

WHY the effort?

Considering that a single mistake or forgotten setting will result in either:

Considering the cost of “forgetting one setting”, it starts to make sense to automate this step from our production process. Don’t you think?

Btw, if you are wondering which editor makes this work so easy (editing javascript that’s encoded INSIDE a non-prettified JSON file), the answer is IntelliJ IDEA.

I have been using it for 9+ years, and I love it.

Group Project

Assets