Copied and pasted from www.justanswer.com
...........Not sure if this will address your problem though.....
I have a 1998 dodge ram 1500 with the 5.2 engine. I put a new engine in it and it would idle for about 30 seconds and start surging. I though it was a vacuum leak at the intake so I change all the gaskets on the intake. I checked the vacuum and it was reading about 20 when the engine started surging the vacuum fluctuated. I then checked all the sensors and replaced the IAC,and the crankshaft sensor. I put in new cap,rotor,wires, and coil. I took it in to be checked. It will run if the idle is above 1500 rpms. I was told when they tried to check the timing with the computer it kick them out. I did get two codes with the scan tool. The codes are 1391 and 1492. I did not know if I got the flex plate correct so I pulled the engine and started back at step one. I pulled number one plug and rechecked the timing. With number one up the crankshaft pulley line up at 0 on the mark the flex plate is not lined up with the opening. Lining it up it is about 5 degrees before tdc. Please Help.
Hi. You need to index the distributor. Injector synchronization is set by turning the distributor, and if the distributor is off far enough it will send spark to the wrong pole in the distributor cap. Ignition timing is controlled by the engine controller, so there is no way to set timing. Once the distributor is indexed the controller takes care of the timing. Here is the procedure.
Connect a voltmeter to the distributor sensor connector by removing the end seal and carefully back probing the connector. Connect the positive lead to the sensor output pin (pin 3, either a tan wire with a yellow tracer or a gray wire, depending on vehicle application). Connect the negative lead to the sensor ground pin (pin 2, a black wire with a light blue tracer).
Rotate the engine clockwise as viewed from the front, until the number one piston is at Top Dead Center (TDC) of the compression stroke. The timing mark on the vibration damper should line up with the zero degree (TDC) mark on the timing chain case cover.
Continue to rotate the engine slowly clockwise until the V6 or V8 mark (depending on engine type) lines up with the zero degree (TDC) mark on the timing chain case cover. The V8 mark is 17.5° after TDC and the V6 mark is 14.7° after TDC.
NOTE: DO NOT ROTATE THE ENGINE COUNTER CLOCKWISE. IF THE ENGINE IS ROTATED BEYOND THE MARK, RETURN TO STEP 2 AND REPEAT THE PROCEDURE.
Loosen the distributor clamp bolt.
With the ignition switch in the ON position, rotate the distributor slightly in either direction until the voltmeter switches between the sensor transition point of 0 and 5 volts.
Adjust the distributor as close as possible to either side of this transition point and tighten the distributor clamp bolt to 170-230 in. lbs. (19-26 Nm).
Read more: http://www.justanswer.com/questions/...#ixzz0N629v3AP