System Description
WARNING: This page is about a different car, the 2004 Toyota Corolla. However, it is still accessible from the selected car via links, so may be relevant.
The ECM uses signals from the vehicle speed sensor and crankshaft position sensor to detect the actual gear position (1st, 2nd, 3rd or O/D gear).
Then the ECM compares the actual gear with the shift schedule in the ECM memory to detect the mechanical trouble of the shift solenoid valves, the valve body or automatic transaxle (clutch, brake or gear etc.).