[M]ouse: PS/2 to Commodore C1351 Mouse Adapter
[M]ouse lets you use a regular PS/2 mouse with a Commodore 64 computer. It supports both proportional (analog, C1351) and joystick (C1350) modes. This is the source code of [M]ouse firmware for ATmega8 microcontroller. It must be compiled with avr-gcc.
- main.c main file
- ps2.c Interrupt-driven PS/2 protocol implementation
- mouse.c Mouse protocol implementation: boot and configuration
- c1351.c Timer-based Commodore mouse emulation
It boots the PS/2 mouse into streaming mode. Mouse sends updated position with every movement. This movement is translated into timer intervals. Every measurement cycle that happens once in 512us, movement is loaded into output compare units of Timer1. When compare matches, corresponding output, POTX or POTY, is asserted high. Then the cycle repeats.