SAM MOUSE TURBO wheel support by Velesoft The original SAM MOUSE interface can't support a wheel mouse (there are no free pins at the mouse connector). But the SAM MOUSE TURBO supports a mouse with the PS/2 protocol, 5 buttons and a wheel. All signals are linked and can be used. However a firmware in the CPLD of the SAM MOUSE TURBO is based on the standard SAM MOUSE communication. Here is an idea how to modify the firmware and how to add a wheel status: Original SAM MOUSE communication protocol ----------------------------------------------------------------- reading 9 times the port #FFFE means CPU will read: 1) keyboard state 2) keyboard state 3) mouse buttons (three buttons + 1 bit is unused/reserved) 4) X-AXIS counter (high 4 bits) 5) X-AXIS counter (middle 4 bits) 6) X-AXIS counter (low 4 bits) 7) Y-AXIS counter (high 4 bits) 8) Y-AXIS counter (middle 4 bits) 9) Y-AXIS counter (low 4 bits) All 9 ports must be read during time 100ys. Theoretically can be added a status with the wheel counter or 4th and 5th mouse buttons. Here is a new protocol idea: reading 11 times the port #FFFE means CPU will read: 1) keyboard state 2) keyboard state 3) mouse buttons (three buttons + 1 bit is unused/reserved) 4) X-AXIS counter (high 4 bits) 5) X-AXIS counter (middle 4 bits) 6) X-AXIS counter (low 4 bits) 7) Y-AXIS counter (high 4 bits) 8) Y-AXIS counter (middle 4 bits) 9) Y-AXIS counter (low 4 bits) 10) mouse wheel counter (high 4 bits) 11) mouse wheel counter (low 4 bits) This protocol returns 8bit counter for wheel (-128 to 127). It is not sure if there is a free space in the current CPLD chip for this counter. The SAM MOUSE uses counters for X and Y axis which are too big. Each counter has a 12bit value (2048 steps). We can reduce counters to 8bit as in the KEMPSTON MOUSE for the Sinclair ZX Spectrum (256 steps). High 4 bits of X and Y axis are unused and only (hardware) emulated for a backward compatibility. After such an optimalisation will be the protocol the same (11 times read FFFE) and free space in CPLD can be used for wheel counter. Up to 5 mouse buttons can be readable in the 12th reading of FFFE.