Amiga tank mouse laser conversion – Alternative firmware

I’ve been working on alternative firmware for the Amiga tank mouse conversion that can be found on PCBWay.
Amiga tank mouse

The mouse is using a Microchip PIC18F26K22 MCU and an Avago ADNS9800 optical sensor.
The firmware monitors the ADNS9800 sensor and translates the X/Y movement deltas into V/VQ and H/HQ quadrature pulses for the Amiga

I may be putting the source code up on Github eventually, but for now, here’s a link to download the HEX file.

I’ve been using a TL866II Plus during the development and testing of this firmware and did not encounter any issues flashing the device. The programming pins are from top to bottom:

  • Clock
  • Data
  • MCLR
  • VCC


The only configuration option is for the sensor resolution. To adjust this, make sure the Amiga is powered off and then jumper CFG to the middle pin.
Connect the mouse and switch on the Amiga.
Clicking the left mouse button increases sensor resolution and right mouse button lowers the resolution, in the range from 200 up to 8,200 dpi. When you have your preferred resolution, power off the Amiga and remove the jumper from CFG. The resolution changes are saved automatically, so when the Amiga is powered up, the mouse will start with the preferred resolution. The setting is stored in EEPROM memory, so the mouse keeps its resolution even when moved between computers.

Future improvements

  • Unfortunately, due to which pins have been wired to the ADNS9800, the SPI communication has to be bit-banged. There’s no way to change that without routing the ADNS9800 communication lines to one of the hardware SPI capable sets of pins on the PIC controller. However, this requires making changes to the board, which can be done as a future improvement.
  • The ADNS9800 has a _MOTION signal which goes low when the sensor detects motion. Another future improvement would be to use this to trigger an interrupt on the PIC controller when we need to read motion data from the sensor. This can reduce the power consumption of the mouse a bit by avoiding the need to continuously poll the sensor.
  • I would also prefer to have an LED on the board to indicate that the mouse is in configuration mode. I’ve accidentally left the mouse in configuration mode a few times too many during the development and testing, which leads to some surprises when trying to click stuff…