P0340 on a Duramax LMM: Camshaft Position Sensor and What Actually Causes It
TL;DR: P0340 is a camshaft position sensor circuit fault, and on a 2007.5–2010 LMM Duramax it usually shows up as a long crank before the engine catches rather than a hard no-start. The ECM can fall back on the crankshaft position sensor, but it works out cylinder phasing the slow way, which is what stretches the crank time. The sensor is only one of several things that set this code — connector corrosion, a chafed or oil-wicked harness, weak batteries and grounds, and a damaged signal ring all produce the same number. Test before you buy.
What P0340 actually means on an LMM
P0340 is the generic OBD-II definition for camshaft position sensor "A" circuit. It is not a code that says "the sensor has failed." It says the ECM did not receive a usable camshaft signal when it expected one — during the crank event, during a running cycle, or both.
That distinction matters on a diesel. The LMM is a Bosch common-rail 6.6L with a CP3 injection pump, and there is no ignition timing to lose — no spark plugs, coils or distributor anywhere on the engine. The camshaft signal tells the ECM which stroke each cylinder is on so it knows which injector to fire and when. Lose that reference and the ECM derives phasing from the crankshaft signal alone, which it can do — it just takes longer.
If you have a companion code, read it carefully before you order anything:
| Code | What it points at |
|---|---|
| P0340 | Camshaft position sensor circuit — no signal, or signal absent when expected |
| P0341 | Camshaft position sensor range/performance — signal present but not correlating with the crank signal |
| P0335 / P0336 | Crankshaft position sensor circuit or performance — a different sensor entirely |
| P0016 (and family) | Crank/cam correlation — timing relationship out of range |
P0340 alone points at the cam circuit. P0340 with a crank code points at something shared — power, ground, or a common harness run. P0340 with a correlation code is a more serious conversation about mechanical timing.
The symptoms you will actually see
The classic LMM presentation is an engine that cranks noticeably longer than normal, then starts and runs fine. It is often intermittent for weeks before it becomes constant, and it is frequently worse hot, because heat is what pushes a marginal sensor or connection over the line. Alongside it you may see a random stall at idle with a normal restart, a few seconds of rough running after a long crank, and a check engine light that cycles on and off across drive cycles rather than staying on. It does not usually cost you power once running.
What it does not typically look like is a dead crank-no-start. If your LMM will not start at all, look harder at fuel supply, the crankshaft position sensor, and battery and starter condition before you spend the afternoon on a cam sensor. Diagnosis on the Duramax LMM parts side of the shop starts with confirming which reference the ECM actually lost.
What actually causes it — in the order you should check
1. The connector and the pigtail. The most common real cause and the cheapest to find. Pull the connector and look for green or white powder on the terminals, a terminal that has backed out or spread, and engine oil that has wicked up inside the connector body and insulated the pins. Oil in a connector is a genuine failure mode and cleaning the outside does not fix it.
2. Harness chafe. Follow the sensor lead back as far as you can see it, looking for it resting against a bracket, a line, or a casting edge. A wire worn through its insulation shorts intermittently to ground and sets this code long before it goes fully open. This is where the harnesses and engine electrical side of the job usually ends up.
3. Power and ground quality. The sensor is a three-wire device: reference voltage, ground, and signal. Weak batteries, corroded terminals, or a poor engine-to-frame ground on a truck with two batteries drag reference voltage down during the crank event — exactly when the ECM is looking for the signal. Load-test both batteries and clean the grounds before condemning a sensor. It resolves a real share of intermittent P0340s on high-mileage trucks.
4. The sensor itself. Sensors do fail, more often with heat and age — but confirm it. Back-probe the connector key-on and verify reference voltage and a clean ground, then watch the camshaft signal parameter on a scan tool while cranking. Crank signal present and cam signal flat or erratic is your answer. Replacements are inexpensive in the engine sensors category, but confirm the current part number against the manufacturer catalogue for your exact build — the Duramax family changed sensors and connectors across generations.
5. The signal ring or reluctor. Rare but real. Debris, a damaged tooth, or a ring that has moved produces a signal the ECM can see but cannot trust. This usually reads as a range/performance code, and it is where the job stops being a driveway repair.
6. The ECM. Last, and it should be. Do not replace a controller on the strength of a circuit code until the circuit has been proven good end to end.
Doing the replacement without creating a second problem
If testing points at the sensor, the replacement itself is straightforward, with a few things worth getting right:
- Confirm the sensor location on your specific truck before pulling accessories. The routine is not the same as a gas V8 — check the service manual illustration for the LMM rather than assuming.
- Do not force the sensor into its bore. It seats on an O-ring: lubricate with clean engine oil, push it home by hand, then start the fastener.
- Torque the hold-down to the service manual figure. It is a small fastener threading into aluminum, and overtightening cracks a boss.
- Reseat the connector until it clicks and reinstall the retainer. A half-latched connector reproduces the original code within a week and you will blame the new sensor.
- Clear codes and drive it through several heat cycles. An intermittent fault needs more than a parking-lot idle to confirm the fix.
- Replace any seal or O-ring you disturbed rather than reusing it — those live under gaskets and seals.
Budget roughly one to two labour hours at a shop, depending on access and corrosion. Rust-belt trucks take longer.
What to do if the code comes back
A returning P0340 after a sensor replacement almost always means the circuit was the problem, not the part. Go back to the connector with a meter rather than your eyes: reference voltage key-on, ground resistance back to the block, and a wiggle-test of the harness while watching for the reading to drop out. If the fault only appears hot, run the same test on a fully warmed engine.
If the truck also has fuel-side complaints — hard hot starts, a miss under load, or a rail pressure code — treat those as their own diagnosis rather than folding them into the cam sensor story. The Duramax parts and diesel engine parts categories cover both sides of that job.
Orders over $70 ship free. If you are not certain which sensor your truck takes, email the VIN to sales@coretransmissionparts.com and we will confirm the fitment before you buy.
Frequently Asked Questions
Will a Duramax LMM still start with a bad camshaft position sensor? Usually yes. The ECM can determine cylinder phasing from the crankshaft position sensor alone, so the engine typically still starts and runs — it just cranks noticeably longer. A complete no-start is more often a fuel supply, crankshaft sensor, or battery and starter problem.
Is P0340 on an LMM safe to drive with? It does not usually derate the truck by itself, so short-term driving is generally not damaging. The risk is the intermittent stall, which is a safety issue in traffic. Treat it as a fix-soon item rather than an emergency.
What is the difference between P0340 and P0341? P0340 is a circuit fault — the ECM did not see the signal at all when it expected it. P0341 is a range or performance fault — the signal is there but it does not correlate correctly with the crankshaft signal. P0341 is more likely to involve the signal ring or a mechanical timing issue, so it deserves a more careful diagnosis.
Can a weak battery cause P0340 on a diesel? Yes, and it is underrated as a cause. Reference voltage sags during the crank event, exactly when the ECM is looking for the camshaft signal. Load-test both batteries and clean the battery, engine and frame grounds before condemning a sensor on an intermittent code.
Do I need to reset anything after replacing the camshaft position sensor? Clear the stored codes and drive the truck through several full heat cycles to confirm the fix. Some GM applications also call for a crankshaft position variation relearn after related work — check whether the procedure applies to your model year in the service manual rather than assuming it does or does not.
Does an LMM camshaft position sensor have anything to do with spark timing? No. The LMM is a compression-ignition diesel — there are no spark plugs, coils or a distributor on the engine. The camshaft signal tells the ECM which stroke each cylinder is on so injection can be phased correctly, which is a fuel timing function, not an ignition function.
Sources
Written from the generic OBD-II definitions of P0340 and P0341, the Bosch common-rail architecture used on the 2007.5–2010 LMM 6.6L Duramax, and standard three-wire position sensor diagnostic practice. Sensor part numbers, locations, torque values and any required relearn procedure should be confirmed against GM service information and the sensor manufacturer's current catalogue for the exact VIN before purchase or installation.