Speedometer.not working Bad ECM

I have a 1991 Buick Century Special 2.5L. The car had stalling problems when coming off the freeway or up to a stoplight after driving at highway speed for an extended time. The problem seemed to be ECM (computer) and I ruled out the Transmission and TCC. I changed the ECM along with the ignition control module and crank sensor and the car drove just fine without a check engine light. Then, the speedometer stopped working after a couple days and the check engine light came on. SO i took it to a mechanic and he tried a couple different ECMs and the speedometer would work but the stalling problem returned. So i put the “good” ECM back in and have been driving without a speedometer for a couple months now and the car has drove fine. My question is What causes my speedometer to work with one ecm and stall, and not work with the ecm that makes the car drive fine? What problem is actually occurring here?

Should I try yet another ECM?

There may be speed sensor in the transmission that provides a signal to the ECU that has a faulty connection to it. If the error code indicates a circuit problem then that is most likely the trouble.

Thanks. Ive tried a brand new speed sensor but it still did not make the speedometer work. I did notice that someone had repaired the connector wires going into the sensor harness with butt connectors. One of the wires is yellow and the other purple. This could be causing a short but the speedometer does work with a different ECM. The speedometer stopped working for the first time in very cold weather with snow if that helps…

And also the speedometer is getting some signal because it will work up to 15mph when first started and then goes all the way to the right past 85mph when driving, then all the way back down to 0 and finally just dissappears. Theres also a fast ticking sound coming from behind instrument panel. Any other Ideas anyone?