An improved body function assistance device is provided wherein a microprocessor controls the response of the device to various external physiological events and internal timer events. The microprocessor is adapted for use with the limited energy supply available from a battery by activating internal logic components of the processor only in response to selected events and to perform an operating routine corresponding to the "wakeup" event. At the end of the operating routine, a new set of wakeup events is selected and the internal logic components are deactivated. A further reduction in the average operating current is obtained by providing a plurality of counting rates to minimize the number of state changes during counting cycles. The microprocessor may be provided with a fixed operating routine or may be provided with the capability of actually introducing program changes in the implanted device.