Amiga Laser Mouse (v1.2 PCB)
PCBWay have quite a simple and useful project to covert your old tank mouse into a laser mouse. I'm not a great fan of the mouse ball and no nostalgia for them, so I picked up 5 boards to have a go at a conversion.
PCBs can be found at https://www.pcbway.com/project/shareproject/Amiga_Laser_Mouse.html. There's a simple BOM list, but there could be a bit more information to explain the build. There's also no firmware supplied, which is quite odd when the board has been released for people to also build their own project. The good news is that other people have created versions of this to flash so not all bad news. The source can be obtained, along with pre-built hex files at https://github.com/gps79/Amiga-Laser-Mouse-ADNS-9800. I had issues trying to use this firmware with the V1.2 boards from PCBWay and I suspect that some pins may have been rearranged. I've forked and rebuilt the code to work with the V1.2 and you can get a built version from my github at https://github.com/AidanHolmes/Laser-Mouse-ADNS-9800.
Assembley
This is the population of BOM that I made to get a working mouse:
C1: 470pF capacitor (I used a through hole, but Mouser or Digikey have many options in 0805)
C4, C2, C7: 0.1uF capacitor (Mouser: 581-KAF21BR71H104JM)
C5, C3, C6, C8: 1uF capacitor (Mouser: 791-0805X105M160CT)
Q1: P-Channel MOSFET (mine were slightly larger and needed the solder masking scraping to fit - Mouser: 621-DMG2305UX-7)
R1, R4: Not required
U1: PIC18F23K22 (Mouser: 579-PIC18F23K22-I/SO)
S1, S2: Switch Electronics subminature microswitch SBDT
Still some learning on the right component for the MOSFET, but it did work with the one bought from Mouser.
The buttons can be micro switched or tactile press buttons. Microswitches are subminature. Oddly the PCB is for double throw but are connected together so you need to remove a leg from the switch to actually work with the board. I added a dab of solder mask to stop any future contact (see below)
![]() |
Microswitches with leg removed |
The PCB will need some modification if your laser mouse has a plastic post in the way. Alternative solution would be to remove the post, but if you prefer to not damage the casing then I suggest you drill a hole in the PCB just above the letter I in the AMIGA text. Drill out with size 8 bit to allow the post through.
There's nothing to damage in the bottom left of the board. I had to do this on my board (see below).
![]() |
Mostly assembled, note the drill hole for plastic post |
You will need to solder in header pins for at least R.BTN to +5V on CON1. The POTY isn't required unless you want to see UART output from debugging (not included in the firmware build I've made as not useful and slows processing). Header pins are not required for J2 as the firmware handles the configuration differently.
A 3d printed closure will be needed to hold the lens in place. I only have a resin printer, which isn't ideal for this type of print.
The second link is the intended print for the V1.2 board, but I only found the first linked print that I used in my build. If I did another mouse, then I would try the second one as it has screw points for the V1.2 PCB and less faff filing the print down to fit properly.
The laser module itself needs buying with the lens and circuit board together. AliExpress has some cheaper options than eBay for the ADNS 9800. Solder this component in last after you've printed the holder and can insert the lens into the recess. The ADNS 9800 laser circuit board needs soldering in at the right height and distance from the main PCB, otherwise it will rock about on top of the lens or be too high and not work.
Remove any protection stickers from the laser lens itself before the next steps. Assemble the holder into the base of the tank mouse, insert the lens, insert the PCB into the mouse base and then insert the ADNS 9800 circuit board and laser into the PCB. Ensure the clear plastic posts of the lens correctly fit through the ADNS 9800 board (if not then try rotating the lens and try again). Solder the ADNS 9800 in situ and you should have the board set to the correct height.
Writing firmware
https://www.pedalpc.com/blog/program-pic-raspberry-pi/
This uses the Pickle tool to programme the PIC on the PCB. It will need a download and build to get it working, but this is quick with the following steps from the shell command line:
raspberrypi:~ $ mv downloads\:pickle-5.01.tgz pickle-5.01.tgz
raspberrypi:~ $ tar zxf pickle-5.01.tgz
raspberrypi:~ $ cd pickle
raspberrypi:~ $ make linux
raspberrypi:~ $ sudo make linux-install
I configured it to use pins 9, 10 and 11 for the programming. To set this then create the following config file in ~/.pickle with your favorite text editor. Note that I'm using a Pi 4 and you should set the DEVICE according to your actual hardware!
SLEEP=1
BITRULES=0x4F00
VPP=9
# set PGM = -1 if not used, otherwise use the correct pin number below
PGM=-1
PGC=10
PGD=11
Following this setup, you will need to add some DuPont wires to go into the J1 header. You can solder some pins in or just press the pins against the solder points (I chose to press as I'm only doing this once to program). The pins should be connected as follows (from bottom up starting from + up to the top connector of the PCB)
- 5v (red)
- GND (black)
- pin 9 (white)
- pin 11 (yellow)
- pin 10 (grey)
Once you have the hex file on your Raspberry Pi, then run the following command from the same directory as the hex file (assuming it's called amiga_mouse.hex, otherwise alter as necessary). Note that you should not connect the mouse to your computer whilst doing this!
raspberrypi:~ $ p16 lvp program amiga_mouse.hex
This should report success. If you get an error then verify your pins are correct and soldering is good on your board.
Final assembly requires desoldering of the shield wire off the original mouse PCB and removal of header pins from the old PCB. The mouse will work without the shield wire so it is your choice to resolder back onto the laser mouse PCB. I soldered it on just to secure it somewhere
![]() |
Assembled with original wiring loom |
It's very likely that the original mouse wiring doesn't follow the exact same colour you can see in the above image. Verify that the 5v power pin is the correct one going into CON1. The rest of the pins should be in the correct order, but if you have problems then you may need to check.
As a finishing touch the board should be secured down to prevent it jumping around in the case. If you use the intended lens holder then 3 screws can go into the 3 holes around the laser. If you use the other lens holder then the screw posts will need spacers or elastic bands around the posts to hold things down. It's not totally necessary but will stop rattling and ensure the lens is kept in place.
Using the mouse
Programming a new hex
Firstly, let's get some dependencies needed:
raspberrypi:~ $ sudo apt-get install bison flex libboost-all-dev
Download gputils from https://sourceforge.net/projects/gputils/files/gputils/1.5.0/.
Install SDCC - full version. Download from https://sourceforge.net/projects/sdcc/files/sdcc/4.5.0/.
raspberrypi:~ $ tar xvf sdcc-src-4.5.0.tar
raspberrypi:~ $ cd sdcc-4.5.0
raspberrypi:~ $ ./configure
raspberrypi:~ $ sudo cp -r * /usr/local
This will install SDCC with full versions of tools.
Comments
Post a Comment