P0340 is no cam signal at PCM.
My first thought is that this is a camshaft position sensor issue. However, it is still possible that the crank sensor is involved, but usually when the crank sensor is involved, it will set an additional
code (along with the P0340) like a P0320.
I would look to the cam sensor first. They can be tested with a manual and a meter and I'd certainly test it.
Here are a couple of links on the P0340 that you should check out......
Good luck and let us know how this is resolved!