for the most part rpm is counting from alternator (generator) there should be two wires one for rpm second for waking alternator
According to my Chilton repair manual , the crankshaft position sensor is used to determine crankshaft position and crankshaft RPM
Here's a link that may help. The RPM sensor is also known as a crank position sensor. http://www.volvoclub.org.uk/faq/EngineSensors.html#Crank_Postition_Sensor
Crankshaft position and crankshaft RPM
The throttle position sensor tells the engine control module what you are doing with the throttle as you drive. If you let your foot off of the accelerator pedal the throttle position sensor sends that information to the engine control module and the engine will receive less fuel and it will lose rpm.
by sensing engine RPM it can teel if engine is not running smooth by sensing the rotation of the rpm's of the engine.
Crank angle sensor reads rpm and sends the signal to the ECU (computer) to aid in the calculation of engine rpm, ignition timing, fuel injection and crankshaft position.
Probable failed TPS (throttle position sensor).
Trouble code P0320 means: Crankshaft position (CKP) sensor/engine speed (RPM) sensor - circuit malfunction
from the engine computer, which gets its rpm info from the crank position sensor
The typical functions of a camshaft sensor are to monitor the speed of a crankshaft and what position it is in. It is used in an internal combustion engine and determines the RPM.
TPS, throttle position sensor.
change the TPS Throttle Position Sensor