1. A method of treating a patient with a headache using a microstimulator implanted within a hole formed in a skull of said patient, said microstimulator comprising electrical stimulation circuitry, a capsule containing said electrical stimulation circuitry, and a stimulation electrode disposed on an external surface of said capsule, said method comprising: generating a stimulus in accordance with one or more stimulation parameters using said electrical stimulation circuitry; and extradurally applying said stimulus via said stimulation electrode to a motor cortex within a brain of said patient, thereby treating said headache.