Pyr0-piezo Beta Unit Firmware Update Procedure¶
Utilizing the Pyr0-Piezo AVR Programming Jig¶
Physical Construction of the Jig¶
The AVR Programming jig consists of several components:
- A PCB with USB-UART bridge (or a TTL header)
- A second PCB with ICSP header and Diag Headers installed
- 5MM 3D Printed Standoffs between the two boards
- 0.65mm Diameter Pogo Pins that span the two PCB's
- The three main body components of the jig
- The hinge joints, and clamp
- 4x M3 16mm Bolts
- 5x M3 22mm Bolts
Uploading Firmware Without a Jig¶
Uploading firmware without a Pyr0-Piezo AVR Programming Jig requires soldering to the test pads on the bottom of the Sensor's PCB:
To utilize the UART's in-built auto-reset function, a 10k resistor and a small capacitor must be added to the reset wire in the configuration below:
Obtaining the Latest Firmware¶
You can obtain the latest firmware release for this project HERE as a zip file with the source, as well as a pre-compiled hex file for use with certain programmers.
Firmware Upload Procedure¶
The firmware for this project can be updated using one of three methods: VS Code, Arduino IDE, or avrdude.
Please be sure you've already wired up your sensor's UART port or used the programmig jig described earlier in this page.
If you built your own board and are starting out with a completely factory-fresh MCU, you'll need to install a bootloader. Have a look at Uploading over ICSP for instructions on how to do that.
VS Code (Preferred Application)¶
- Install VS Code from Micosoft's official page
- Use the "Extensions" menu to install PlatformIO.
- (Optional) Install extra plugins to assist in development:
- Markdown Preview Enhanced
- C++ Intellisense
- In PIO Home, open the firmware folder:
- By default, VSCode is configured to utilize the Atmega328PB MCU. This can be changed by editing the
default_envsparameter in the
- Make any desired adjustments to default values in
- Click the "PlatformIO: Upload" button found in the bottom bar of the VS Code window
- Verify Serial connection by opening the Serial Monitor and typing
STATE. You should get a response.
Uploading over ICSP¶
Using this method will install the bootloader required to upload firmware over UART
- Open the
platformio.inifile found in the Pyr0_Piezo_sensor_v2.x.x folder
- Change the
[platformio] default_envs = ICSP_Bootloader
- Install Arduino IDE from Arduino's official page
- Under File > Preferences > Additional Board Manager URL's, Add:
AVRDUDESS is a GUI version of the avrdude application used for flashing firmware to AVR based MCU's, and can be found here
After installing AVRDUDESS, and opening it, follow the image below with the settings here:
- A. Choose the COM port of your UART programmer from the pulldown menu
- B. Ensure "Erase Flash and EEPROM" is checked
- C. From the MCU Pulldown, select "Atmega328PB"
- D. Set the Fuse Bits to
F9respectively. Leave LB blank
- E. Click the Flash button to begin the upload process
- Install a bash-like terminal. Choose from a number of options: - [Windows Subsystem for Linux] - [CygWin] - [Mingw64] - [Git Bash (Comes bundled with Git for Windows)]
- Download the [avrdude binaries]
- Extract the binaries somewhere your terminal can find them
sudo apt update && sudo apt install -y avrdude
sudo yum install -y avrdude