Software running on microcontroller units (MCUs) is considered firmware. This document guides you from obtaining the hardware to making the comm and driver panels work. Note that there are two different ways to upload the firmware: one for the latest driver and comm board (driver v1.9 and comm >v0.4) and one for the older versions. Only follow the instruction from one of the sections, mixing parts from “Older Firmware” and “Firmware” will not work.

  1. Firmware
    1. Prerequisites
    2. Flashing firmware to the latest driver and comm board
  2. Older firmware
    1. Prerequisites
    2. Turn Arduino into In-circuit Serial Programmer (ISP)
    3. Troubleshooting
  3. Programming an older comm panel
    1. Connect comm board
    2. Flash comm board firmware
    3. Checklist for flashing comm firmware
  4. Programming an older driver panel
    1. Connect driver board
    2. Flash driver board firmware
    3. Checklist for flashing driver firmware

Firmware

The driver and comm board use a total of five microcontroller units (MCUs). To program these five ATmega328s, you will need the programmer explained in the acquisition step.

Prerequisites

You will need the following parts:

Set up Pololu USB AVR Programmer

Using the Pololu USB AVR software, configure the Pololu with the following parameters. Most notably, switch the regulator mode to 5V and set the VCC output to “Enabled”.

Install MiniCore

In the Arduino IDE, you will need to install the MiniCore board package for the Pololu programmer. To do this, go to File → Preferences and add https://files.pololu.com/arduino/package_pololu_index.json to the “Additional Boards Manager URLs”. Then go to the Board Manager (Tools → Board → Boards Manager) and search for “MiniCore”. Alternatively, follow MiniCore’s own installation instructions. Install the latest version of the MiniCore package.

Flashing firmware to the latest driver and comm board

Download the repository

Download the firmware: either clone the Git repository or download the repository as a zip file and unpack it into a directory. For hardware newer than v0.2, use the firmware in the hardware_v0p2 folder: the comm board uses the firmware in the comm folder, and the driver uses the firmware in the driver folder. Then load either the comm.ino or the driver.ino in the Arduino IDE.

Connect Driver Board

Connect either the driver or comm board via the matching shield to the Pololu USB AVR Programmer. The driver shield needs to align flush with the driver board.

Connect Comm Board

The comm board and the comm board shield need to be in the same plane. Connect either of the shields to the programmer via the flat cable and connect the programmer to the computer.

Set serial

For the driver shield, select the quadrant you want to program first via the dip switch on the programmer. Connect the Pololu USB AVR Programmer to your computer via USB. Select the COM port that is shown as “Programming port” in the Pololu USB AVR software or, if you don’t have that software, select the COM port with the higher number, which is usually the programming port. Select all other options similar to what is shown in the screenshot, such as the Board (ATmega328), the Programmer (STK500 as ISP (MiniCore)), Variant (328P / 328PA), etc. Then click “Burn Bootloader” to flash the bootloader to the driver or comm board. You should see a success message in the Arduino IDE.

Upload using programmer

Load the correct sketch (either comm.ino or driver.ino) in the Arduino IDE and click “Sketch” → “Upload Using Programmer” to flash the firmware to the driver or comm board. You should see a success message in the Arduino IDE.

Older firmware

For the older drivers and comm boards, we used an Arduino as an “In-circuit Serial Programmer” (ISP) to flash the firmware to the driver and the comm board.

Prerequisites

You will need the following parts:

Install the custom version of the Arduino IDE on your computer. This IDE has the PanelsG4 board added as a target. The Windows version of Arduino-1.6.5 is provided as an asset to the “Customized Arduino IDE” release on GitHub.

Turn Arduino into In-circuit Serial Programmer (ISP)

To flash the firmware to the panel MCUs, the Arduino will act as a programmer. For this, the Arduino requires special firmware, which is provided as “example” code. Follow these steps to turn the Arduino into an ISP.

  1. Connect the Arduino (make sure the programmer shield is off, as it will prevent programming).
  2. Open the Arduino IDE.
  3. Go to Tools ­→ Board and select Arduino UNO.
  4. Go to Tools ­→ Port and select the correct port.
  5. Go to File ­→ Examples and select ArduinoISP.
  6. Verify (check button) and Upload (right point arrow button).

These steps should be similar to what is described in an Arduino tutorial online.

Troubleshooting

There is no verbose output that helps with debugging problems, but one of the following three steps has solved most problems in the past:

  1. Make sure that the Arduino firmware has not been corrupted. Flashing the ISP firmware to the Arduino again solved many unexplained problems.
  2. Make sure your driver and comm boards are connected in the correct way. It’s easy to mix up the polarity, which, in the worst case, can corrupt a panel but is often solved by using the correct polarity.
  3. Make sure only one subdevice is selected on the driver board. Multiple selections can lead to unexpected results.

Programming an older comm panel

Each comm board needs to be programmed.

The following has to be done only once for all comm boards: In the Arduino IDE, go to Tools ­→ Board and select PanelG4. In Tools ­→ Programmer, you need to select Arduino as ISP (not ArduinoISP).

Connect comm board

How to connect a comm shield

To program the ATmega328 on a comm board, connect the board to the comm shield board in a way that you can see the components on both boards (also see image). There is no need to connect the external power supply; power is provided through the Arduino shield.

Flash comm board firmware

Once the comm board is attached to the comm shield, you can connect the comm shield to the Arduino shield with the ribbon cable. Make sure to disconnect the ribbon cable when changing the comm boards.

With the Arduino IDE open, select Tools ­→ Burn Bootloader to write the boot loader to the comm board’s MCU. With the correct comm.ino open (the latest version is in the GitHub repository linked to this page (see link in the bottom left of the page) at hardware_v0p2/comm/), select Sketch ­→ Upload Using Programmer. Now the comm board should be fully functional. Disconnect the ribbon cable before programming the next comm board.

Checklist for flashing comm firmware

  1. Connect Arduino shield to the computer1
  2. Open Arduino IDE
  3. Go to Tools ­→ Board and select PanelG4
  4. Go to Tools ­→ Programmer and select Arduino as ISP (not ArduinoISP!!!)
  5. Disconnect ribbon cable between comm shield board and Arduino shield
  6. Attach comm board to the comm shield board
  7. Connect the comm shield board to Arduino shield via ribbon cable2
  8. Go to Tools ­→ Burn Bootloader
  9. Open the comm.ino sketch
  10. Go to Sketch ­→ Upload Using Programmer to upload the sketch to the comm board
  11. For the next comm board, continue at step 5

Programming an older driver panel

The following steps have to be done for each individual driver board. This applies to all driver versions except the most recent v1.9.

The following has to be done only once for all driver boards: In the Arduino IDE, go to Tools ­→ Board and select PanelG4. In Tools ­→ Programmer, you need to select Arduino as ISP (not ArduinoISP).

Connect driver board

How to assemble a driver shield

The first step is to connect the driver board to the driver board shield. The correct orientation of the driver is when the two triangles printed on the board point away from the connector (up in the picture). This also means that the upper edge of the shield and the driver are well aligned and the lower edge of the driver aligns with the printed line on the shield. Make sure you double-check the orientation, as there is a chance of breaking the driver. There is no need to connect the external power supply; power is provided through the Arduino shield.

Flash driver board firmware

Dip switch selecting subdevice 1

Once the driver is attached to the driver shield, you can connect the driver shield to the Arduino shield with the ribbon cable. Make sure to disconnect the ribbon cable when changing the driver board.

Select one of the four subdevices to be programmed by moving one of the dip switches away from the panel and the other three towards the panel. In the picture on the right, subdevice number 4 is selected through the dip switch on the left. Select Tools ­→ Burn Bootloader to write the boot loader to the ATmega328. With the correct driver.ino sketch opened, select Sketch ­→ Upload Using Programmer to upload the sketch to the panel. Currently, the latest version of the driver sketch is in the associated GitHub repository (see link in the bottom left of the page) at hardware_v0p2/driver/.

Repeat the steps for “Flash driver board firmware” for the other three subdevices on the same driver panel.

Checklist for flashing driver firmware

  1. Connect Arduino shield to the computer1
  2. Open Arduino IDE
  3. Go to Tools ­→ Board and select PanelG4
  4. Go to Tools ­→ Programmer and select Arduino as ISP (not ArduinoISP!!!)
  5. Connect a driver board to the driver shield board2
  6. Connect driver shield to the Arduino shield via ribbon cable1
    1. Select the subdevice using the dip switch. Away from the panel means “on”; only one should be up at a time3.
    2. Go to Tools ­→ Burn Bootloader
    3. Open the driver.ino sketch
    4. Go to Sketch ­→ Upload Using Programmer to upload the sketch to the panel.
    5. Repeat from step a) for the other subdevices
  7. Disconnect ribbon cable
  8. Repeat from step 5 for each driver board

  1. Always remove the ribbon cable before removing and attaching a new driver subpanel, as attaching a panel without doing so will sometimes corrupt the ArduinoISP program on the Arduino Uno.  2 3

  2. Note that you do not need an external power supply; the Arduino will provide power.  2

  3. To fully program the driver, you need to program all four ATmega328s, which means programming the bootloader and firmware for all four dip switch “on” positions, one at a time. 


This site uses Just the Docs, a documentation theme for Jekyll.