Spin Cycle issues

Washer won’t spin. Door lock solenoid works. Door switch works. Washes OK. Goes to spin cycle and stops. Red light flashes. Sometimes can be started by manually advancing dial to final spin. Now on final spin motor turns once or twice, but will not start and reach spin speed. Holding start switch for three seconds will not clear the program and release door. Need to unplug, wait a few seconds, replug then press and hold start switch. Suspect timer or motor speed sensor. Any ideas?