
UniROM VIC-20 and C64
13 July 2023
THE SUPER NINTENDO / SUPER FAMICOM AND ITS PROTECTIONS
7 October 2023Mouse for C64/128 restoration
I was given this mouse to repair with a strange defect.
Let's see what it had, but first let's figure out what it is!
This mouse produced by Commodore in 1986 is the successor to the 1350 mouse, which is not really a full-fledged mouse, how come? The 1350 was a mouse with a digital output, this connected to the port of the C64 or 128 and it was as if a joystick was connected to it, when you went right the mouse closed the contact of the right joy port, and ditto for the other directions, the left button was the fire and the right was a second button (pin 9). What is the difference between this mouse and a traditional mouse? well, this one emulating the joystick directions always moves at the same speed!, try it with a cartridge like "The Final Cartridge 3" and the joystick or the mouse, you will find that to get to the bottom of the screen takes several time. If you use a proportional mouse this problem does not exist, if we move the mouse slowly, the pointer will move slowly, while if we move it quickly we will get to the end of the screen in no time.
All the traditional mouse does is keep track of how many steps (movements) you take and tell the computer what the position is for the X and Y axis.
Here we come to mouse 1351, this in fact by default is a proportional mouse with the left button as the fire and the right as the joystick direction on. In a nutshell it works like the paddles, those have a potentiometer that adjusts the voltage on the potX (pin 9) and potY (pin5) inputs. But this mouse does not have a variable resistor or even a pvm signal then stabilized, how does it pass this information to the SID?
Yep, the SID in addition to dealing with audio, handles analog signals by then providing the computer with a value between 0 and 255 on the X and Y axes.
How does the proportional mode work?
As mentioned before, we need to apply a voltage to the X and Y pins, which the SID reads and converts to digital, a bit like a modern ADC. This is how it works:
The SID uses the CPU clock to sample the analogue input, and the whole thing takes 512 clock cycles.
For the first 256 clocks the SID connects an internal resistor to the pin it is reading, which discharges the capacitor inside the chip. It then disconnects the pull-down resistor and waits for the capacitor inside the port to charge up to a threshold voltage, but how long the capacitor takes to charge depends on how much voltage is applied to the input of the port being read. For every clock that goes by the SID increments its port register until it sees that the capacitor is charged; if the capacitor does not reach the threshold within the remaining 256 clocks, the register reads 255, meaning nothing is connected. If the capacitor charges before the count ends, the value is lower than 255; in fact, if it charges instantly (on the first clock cycle) the value is 0.
Right, now that we know how the SID thinks and how it reads this value, we can make the capacitor charge whenever we like by applying a voltage to the port... well, almost!
This is how the mouse works:
The heart of it all is the MOS 5717, which tracks the mouse movements through the usual photodiodes (like an encoder) and keeps count of the pointer position, just like a modern mouse, but it uses this method to pass the information to the computer.
It waits for the signal on the potY port to go low, a sign that the SID is starting its discharge-and-charge cycle.
It checks the mouse movements and counts 256 clock cycles. How? Well, it also has a 1 MHz crystal, just like the C64/128.
Once those cycles have passed, it simply sends a positive pulse to the X and Y ports at the right moment: it counts the cycles and charges the capacitor instantly when the number of clocks matching the value to be written to the register has gone by. Clever, eh?!
Another thing to mention is that the mouse does not work only in this mode, it is designed to be compatible with its predecessor as well.
Holding down the right mouse button while turning on the computer or connecting it to it, the mouse goes into 1350 mode and reasons as a digital mouse, closing the joystick directions based on how we move the mouse.
Most frequent faults
This mouse is simple but at the same time critical; it takes little to make it not work well.
This is the schematic of revision A, unfortunately I have revision B and could not find its schematic which is slightly different. The most critical part is really the encoder and photodiode wheels that with dirt can decrease their efficiency and not operate the mouse. Other cases are the misalignment of these photodiodes that no longer point correctly or the wheels that have become deformed. It may happen that even after cleaning and verifying that the diodes are working, the mouse does not move one or all directions, this is the case where it is worth checking the voltages at the ends of the resistors R6~R9 because if these are below about 3.4V it may not be interpreted as a high signal. It will be necessary in this case to find a higher value that brings the voltage back above 4V.
In my case
As mentioned above, most of the time the mouse will not move in one or all directions in any mode if the problem comes from the photodiodes, partitions, etc.
This mouse in fact did not work well in the proportional mode, not that it didn't work at all, it would move on all directions but after about a 1-2 centimeter travel it would return to the starting position, and it did so with all directions.
It could not have been a problem with encoder signal recognition, otherwise it would not have moved, plus in the joystick mode it worked fine.
I had later found that by keeping it connected for at least 30 seconds, it would start working properly even in proportional mode. It seemed to be a synchronism defect, see description of operation.
Well, in the end I also changed some capacitors that were no longer in good condition (C3,C5), but the rest were all working and the problem remained. The clock was perfect, nothing seemed to be wrong with it, even the transistor that is not in the schematic was good. Eventually I discovered that the resistor that is listed here as R11 of 5.1K while in my mouse it was 1M, was the one that made the micro recognize the sync signal. I tried lowering its value by replacing it with others of 820k, 470k ... and I noticed that the waiting time for it to work well was getting shorter and shorter. I finally got it down to 100k and the mouse works fine right away.
Watch the video to see all the steps and subscribe to the channel to help us move forward with these videos and repairs!!!
Other revisions
Thanks to Sven H. we now have another case of problems with this mouse; in this revision the problem was solved like this:
I ran into exactly the same problem and the same behaviour you described: proportional mode stayed stuck, joystick mode worked correctly and, about 30–60 seconds after power-on, the old M1351 started working normally again.
In my case, however, there were a few differences:
Revision: b
R11: 5 kΩ resistor present and in place
Electrolytic capacitors: we found 4, whereas the schematic only shows 3
Capacitors fitted: 2 × 47 µF and 2 × 22 µF, tantalum
We replaced them all and I think the problem has been solved: it hasn’t come back for several days.
In this case replacing the capacitors got it working again. Thanks to Sven for the report, which may be useful to anyone with this revision rather than mine.
similar posts




