2003 Nissan Sentra

My car's engine would shut off when I would slow down or come to a complete stop. I could tell that it was about to happen because when id drive at a much higher speed, id feel like a kick from the engine, and as soon as a slow, my engine would shut, but my radio, lights would still be on. It scares the hell out of me. I'd have to restart the car everytime this happens. Sometimes, if im lucky, it wont die till I reach home. I checked for loose battery cables, and sure enough my negative cable hooked on my battery was loose enough to where I could wiggle it with ease. So I tightened it up, then drove it around my area, and it seemed to run ok, till it died on me again. I bought the CarMD, and diagnosed my car and it came out " crankshaft position sesnsor circuit malfunction" (p0335). Im not a genius when it comes to car engines, so what could be the problem?
March 1, 2013.

The code indicates a fault with the crankshaft position sensor and it could be a fault with the sensor or its wiring.

Apr 28, 2013.