A bad or dirty crank sensor, as Bill noted, would be one of the things to check. That is the primary spot for the PCM to get the engine speed. This is the description.
Description and Operation
The IPC displays the engine speed based on information from the PCM. The PCM converts the engine speed data to a 2 pulses/engine revolution signal. The IPC uses the engine speed signal circuit from the PCM in order to calculate the engine speed. The tachometer defaults to 0 rpm if a malfunction in the engine speed signal circuit exists.