Camshaft position sensor generates pulses of the piston at TDC 1st and 4th cylinders in the compression stroke, by which ECM determines the sequence of fuel injection.
RPM Sensor crankshaft transmits the ECM information on the crank angle (the position of the piston). Based on this information the output signal of the sensor, the ECM calculates the engine speed and crankshaft position.