A device comprises a stimulus generator comprising an instruction processor. The stimulus generator is configured to deliver stimuli to a biological tissue. The device also comprises a non-volatile memory for storing instructions directly executable by the instruction processor, the instructions controlling, at least in part, the operation of the device. The instruction processor generates an erase control signal to erase at least a segment of the non-volatile memory and a write control signal to write one or more new instructions to at least a segment of the non-volatile memory, thereby modifying the operation of the device.