2005 Altima 3.5 SE (codes P0345/P0021)
Problem started with what felt like the tranny was "slipping" (auto transmission). RPM's went up but car wasn't moving in comparison. Replaced bank 2 (closer to radiator) cam position sensor (P0345 code). Checked connections and ground too. This took care of the "slipping" problem but created a harder starting problem. It was cranking but not starting right away. This then threw code P0021. I then replaced the bank 1 (closer to firewall) cam position sensor and the crank position sensor (mounted underneath on transmission). Checked the IVT solenoid on bank 2. Still had problems with the cranking. I had replaced the bank 2 cam position sensor with an aftermarket sensor. The bank 1 cam position sensor and crank sensor were replaced with Nissan sensors. I was just about ready to throw in the towel and take it to the dealer when I decided to replace the bank 2 cam position sensor with a Nissan sensor. Changed sensors and immediately the car started right away! No more long cranking and no problems with the "slipping". Watch out for the aftermarket sensors. My 3.5 (92,600 mi) did not like the aftermarket for whatever reason.