2009 Hyundai Elantra Touring camshaft/crankshaft fault codes

My car is throwing camshaft and crankshaft sensor fault codes even after these were replaced and cleared. It idles a little rough but drives ok for a while until suddenly losing power and threatening to stall. After cooling down it will start again (sometimes not so easily) and drives ok until the same occurs. Fault codes come up again. Any ideas where the problem may lie? Cheers

Check the wiring and connectors to the sensors for damage, corrosion or loose socket terminals.
Check ground straps on battery cable, body and engine.

A stretched timing belt or chain can cause these codes.

Please post the exact codes

Thanks for your response. The timing belt all seems in order and tensioned properly so I’m thinking the problem might be electrical.

cheers

Hey circuitsmith thanks for your response. I think you’re right about it being electrical so I’ll check all those things out.
cheers,

Anton

Thanks for your response. The codes are P 340/P 345 which I believe are cam and crank position sensors.
Mechanically the timing belt and cam alignment seem ok and both sensors have been replaced so it looks like an electrical problem?

cheers,

Don’t know if this is applicable to this problem,but there is a camshaft crankshaft variable learn procedure that is supposed to be done after crank sensor replacement. Probably won’t be the problem. Might check to see if there is a spec for gap between the crank sensor and flywheel.

Ok thank you. Didn’t know about that (or much else car wise to be truthful) but I’ll look into it.

cheers,