How do you stop detonation?

Detonation, also referred to as knocking in gasoline engines happens when the gasoline vapor in the cylinder ignites prematurely before the piston is in an optimum position in the cylinder, usually, slightly before the piston has reached it maximum extension in the cylinder (referred to as BTDC - before top dead center). The solution is to try using a higher octane of gasoline as the higher octane slows the burning of the gasoline. If you are already using a 93 or 94 octane gasoline, take your vehicle to your friendly mechanic. As there may be other issues involved such as the incorrect timing of the engine.