Right ignore the knock sensor on your engine. it does nothing for a non super charged X. Mine on my 2000 x has been faulty for 10 years. The cam shaft sensor, check this
http://www.obd-codes.com/p0340 could also be related to crank shaft position sensor too.