Skip to content

7. ATmega Firmware

othermod edited this page Jun 1, 2026 · 2 revisions

The ATmega8 handles hardware interfacing on the PSPi 6 -- reading buttons, managing power, and controlling the backlight. All boards sold by othermod.com come with the firmware and bootloader pre-flashed and ready to use.

Updating Firmware

Boards running PCB version 1.5 or newer sold on from othermod.com have the bootloader installed and can update firmware without any wiring using the firmware update image.

What You'll Need

Steps

  1. Flash the firmware update image to a MicroSD card.
  2. Shut the device down completely.
  3. Insert the MicroSD card.
  4. Hold the display button and power on. Keep holding for one full second until the WiFi LED begins blinking -- this puts the ATmega into bootloader mode.
  5. Wait for the update to complete. The process runs automatically.
  6. When the WiFi LED switches to fast blinking, the firmware has been verified and the update is complete. The device will power off on its own shortly after.
  7. Swap back to your regular MicroSD card.

Flashing from Scratch

If you have a self-manufactured board or a PCB version older than 1.5, the bootloader is not yet present and the ATmega must be flashed manually over SPI using avrdude. This requires physical access to the SPI test points on the board.

After completing this process, the board will have the bootloader installed and can receive future firmware updates using the method above -- no wiring required.

What You'll Need

  • Raspberry Pi or Arduino
  • avrdude (sudo apt install avrdude)
  • Wires or a pogo pin rig

Connection Points

You will need to connect to six test points on the PSPi board:

SPI Attachment Points

  • 🔴 VCC
  • ⚫ GND (use a ground pin on the 40-pin header on PCB versions earlier than 1.2)
  • 🟢 Clock
  • 🟠 MISO
  • 🔵 MOSI
  • 🟡 Reset

Flashing with Raspberry Pi

Connect the PSPi board to your Raspberry Pi GPIO pins:

Raspberry Pi GPIO Pinout

  • 🔴 VCC to 3.3V (Pin 1 or 17)
  • ⚫ GND to any GND pin (e.g. Pin 6)
  • 🟢 Clock to GPIO3
  • 🟠 MISO to GPIO6
  • 🔵 MOSI to GPIO5
  • 🟡 Reset to GPIO2

Configure the linuxgpio programmer in /etc/avrdude.conf (search for the linuxgpio entry, uncomment it, and set the pin numbers to match):

programmer
  id    = "linuxgpio";
  desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
  type  = "linuxgpio";
  reset = 2;
  sck   = 3;
  mosi  = 5;
  miso  = 6;
;

Then flash the fuses and firmware together:

sudo avrdude -c linuxgpio -p m8 -U lfuse:w:0xA4:m -U hfuse:w:0xDA:m -U flash:w:combined.hex:i

Clone this wiki locally