2004 Mazda 6 • 4 cylinder FWD Manual • 89,545 miles

Ok I am mechanic stupid, my check engine light is on, it says cam shaft sensor, changed it twice still messed up, it revs itself when I first start it this will last up to five minutes, it misses bad when I change gears (stick shift) it makes a loud rattling noise when I first start it too, also the rpm goes down when I let off the gas like it wants to quit then runs back up when I hit the gas have had plugs and wires replaced also it only has 89k miles, I am at a loss and don't have the funds to keep dumping in it with no results. Do you have any ideas at all? Please help cause it has died twice while I am driving.
March 15, 2011.

Not all codes sets because of a bad sensor
you have wiring and timing chain to consider too
if timing is of PCM will assume its a bad cam sensor

Mar 16, 2011.