Help with vintage mouse encoders - Page 1
Forum section: electronics / repair

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 12:24:50 pm
content: Hi,I have a mouse from an A&T Unix PC, circa 1985. It mostly works: button clicks are received by the PC, and mouse moves cause the cursor to flicker, indicating the PC is receiving messages.Decoding the mouse's output, I see that for every +1 mouse movement, it sends a -1 that effectively cancels it out. This happens on both the X and Y axes.Inside, the mouse has two encoder wheels (it's a ball mouse, of course) and each wheel has two LEDs and two phototransistors. There's a 28 pin, 0.6" wide IC labelled Motorola SC87347P. Google does not offer up a datasheet for it (though it does find me and one other guy asking about it).What could cause a mouse to fail in this way, sending negative movements that offset every positive movement?Thank you,Bob

author: aqibi2000
author_rank: Regular Contributor
timestamp: June 19, 2021, 12:30:18 pm
content: Check pull up resistors

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 02:36:19 pm
content: Quote from: aqibi2000 on June 19, 2021, 12:30:18 pmThere are only two resistors, 150 ohms each, which appear to be current-limiting resistors for the LEDs.There are 4 LEDs in all, two for each encoder wheel. The two LEDs for an encoder wheel appear to be wired in series, allowing only one resistor for each pair.I'm a little surprised there are no pull-up for the buttons. But the buttons are working fine, so I won't worry about that.- Bob

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 03:11:18 pm
content: Quote from: rea5245 on June 19, 2021, 12:24:50 pmDuh! The second line of text on the IC says "R6-6805". So it's a Motorola microcontroller.

author: Twoflower
author_rank: Frequent Contributor
timestamp: June 19, 2021, 03:34:42 pm
content: A wild guess. As that happens on X and on Y direction that points to the chip. But since everything else works and even it sends the right messages I would say that the controller is also working as expected. At least to some degree. Can you check the supply voltages? Is there some noise/ripple if you rotate the encoder wheels?My guess is that the controller has some noise problems. If the encoder toggles and the controller send a message causes the supply drop and the controller resets/enter unknown state. If there are electrolytic caps used on VDD-GND add temporarily one in parallel to see if that helps. De-solder on these old PCBs should probably avoided as there's a chance to damage the traces.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 05:27:02 pm
content: Quote from: Twoflower on June 19, 2021, 03:34:42 pmThe 5V is rock-solid, measured with a scope at the IC's Vcc pin.

author: screwbreaker
author_rank: Regular Contributor
timestamp: June 19, 2021, 07:00:11 pm
content: Try to clean it.Usually there are some little slots on the plastic holder for the leds.Try to spray some air on it to remove all the dust.Clean also the wheels for each axis.It happen when there is some dirt on the infrareds, that the cursor don't move properly or start to act weird.

author: coromonadalix
author_rank: Super Contributor
timestamp: June 19, 2021, 07:34:59 pm
content: Or the ball get very crusty lolll

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 07:43:19 pm
content: Quote from: coromonadalix on June 19, 2021, 07:34:59 pmI took the ball out and I'm rolling the wheels directly.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 19, 2021, 08:30:08 pm
content: Quote from: screwbreaker on June 19, 2021, 07:00:11 pmOK. I blew air on the encoder wheels and inspected them; I see no dust. I wiped the LEDs and phototransistors with a cotton swab dipped in rubbing alcohol.Still no joy.

author: Manul
author_rank: Super Contributor
timestamp: June 19, 2021, 10:32:33 pm
content: If you have two channel scope, probe both detectors at the same time and look if they produce a valid quadrature encoder signal (phase shifted square waves). Post how it looks.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 06:37:59 pm
content: Quote from: Manul on June 19, 2021, 10:32:33 pmEach wheel has two photodetectors on it. On each wheel, one of the detectors works (sends out a stream of pulses) while the other doesn't (remains flat-lined). So that explains why the mouse is misbehaving.All the IR LEDs work: I can see them lit through my cell phone camera.The photodetectors look like phototransistors, but they're something more. They have three leads. One is connected to +5V, the second is connected to the microcontroller, and the third is connected to ground. The microcontroller line toggles between 5V and ground. There's no biasing and no pull-up resistor: whatever this component is, it's a sweet, digital, optical switch. I fear it's not manufactured any more. And of course, there's no part number on it.- Bob

author: ledtester
author_rank: Super Contributor
timestamp: June 21, 2021, 06:59:59 pm
content: QuotePost a pic!You might be able to replace it with a conventional phototransistor and add your own pull-up resistor.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 08:03:16 pm
content: Quote from: ledtester on June 21, 2021, 06:59:59 pmPic posted.The detectors are not flush with the board. Since quadrature encoding requires precise placement of the detectors, I wonder if they had some sort of spacer they used during assembly to ensure they were at the right height.

author: ledtester
author_rank: Super Contributor
timestamp: June 21, 2021, 08:27:25 pm
content: Perhaps it is a "photologic" sensor like the OPL550:https://www.digikey.com/en/products/detail/tt-electronics-optek-technology/OPL550/498718

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 08:35:14 pm
content: Quote from: ledtester on June 21, 2021, 08:27:25 pmWow! Yeah, I think you're right. Thank you!!

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 09:00:01 pm
content: Quote from: rea5245 on June 21, 2021, 06:37:59 pmSo you say, that both X and Y axis have one failed photodetector? Seems strange. I guess the fault is somewhere else.

author: BrokenYugo
author_rank: Super Contributor
timestamp: June 21, 2021, 09:00:41 pm
content: Is it possible the LEDs have just gotten weak?

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 09:14:20 pm
content: I would try to investigate optical alignment. If it is ok, then the output. Is it open collector with pullup, is it totem pole? Is pullup internal to detector, or MCU? Is it shorted to ground or maybe +5? Is it just somehow missing pullup?

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 09:42:13 pm
content: Quote from: Manul on June 21, 2021, 09:00:01 pmYeah, it's suspicious. But the circuit is so simple, there's nowhere else for the fault to be. The detectors are wired directly to power, ground, and the MCU. The detectors' outputs are not shorted to ground. There's no pull-up resistor; if the detectors are OPL550s, like ledtester thinks they might be, there's no need for a pull-up.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 09:43:39 pm
content: Quote from: BrokenYugo on June 21, 2021, 09:00:41 pmThey looked OK when I viewed them through my cell phone's camera.

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 10:18:35 pm
content: Quote from: rea5245 on June 21, 2021, 09:42:13 pmThe MCU could be faulty, maybe the detectors are wired to different ports and one is bad. So it is not necessarily faulty detectors. There are many variants similar to OPL550, so we don't know which one it is exactly, until some testing of the output is performed.Are not working detectors' output sitting at 0V or 5V?

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 10:25:51 pm
content: Quote from: Manul on June 21, 2021, 10:18:35 pmThe non-working outputs are at 0V. But with power off, a multimeter shows no continuity from those pins to ground.So if the problem is in the MCU, it would be on two pins, and it would be forcing them to 0V only when the MCU is powered on, and it wouldn't be affecting anything else in the MCU. It seems unlikely.

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 10:59:39 pm
content: Quote from: rea5245 on June 21, 2021, 10:25:51 pmWell, MCU port failure would be one failure which explains it versus two failures if we consider detectors. Single failure is more likely then two.Anyway, you need to think of a way, to verify one or another. The most straightforward way would be to try to make one axis good by changing the bad one with a good one from another axis. But this is soldering and might be difficult to align good. Another way could be to cut traces, maybe both good and bad detector. Then you can observe how detectors work on their own, separated from MCU and also simulate switching to MCU to verify that it reads signals if needed. This would probably be my choice.

author: rea5245
author_rank: Frequent Contributor
timestamp: June 21, 2021, 11:09:47 pm
content: Quote from: Manul on June 21, 2021, 10:59:39 pmExcept that it would be two different ports on the MCU that both failed in the same way, while the rest of the MCU was undamaged.

author: Rasz
author_rank: Super Contributor
timestamp: June 21, 2021, 11:16:15 pm
content: Quote from: Manul on June 21, 2021, 10:59:39 pmYes, this is the obvious first step, without buying anything/waiting for shipping

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 11:19:26 pm
content: Quote from: rea5245 on June 21, 2021, 11:09:47 pmPort is agroupof I/O pins, often 8, could be 4, which have their own dedicated control, data registers and all kinds of underlying logic.

author: Ian.M
author_rank: Super Contributor
timestamp: June 21, 2021, 11:33:21 pm
content: Quote from: rea5245 on June 21, 2021, 10:25:51 pmIt could be 'bit-rot'. If the MCU's code is corrupted, and the two axes are each on the same bit positions of different ports, it would only take one bit flipped in the port initialization code, swapping one bit position from input to output to get the observed results.

author: Manul
author_rank: Super Contributor
timestamp: June 21, 2021, 11:40:54 pm
content: Quote from: Ian.M on June 21, 2021, 11:33:21 pmYes, there are actually so many scenarios how a port could fail, even including software corruption, I did not think about that. Notverylikely, but it could explain, how two separate inputs failed at once.