A method of programming a programmable microcontroller for installing into and for controlling an electrically operated system, while the microcontroller is installed within the system, the microcontroller having a plurality of input ports, the method comprising the steps of:
- selecting at least some of the input ports for performing a dual function according to whether the microcontroller is operating in a normal mode or a programming mode and thereby eliminating the need for dedicated programming pins,
- using said at least some of the input ports for receiving instruction words to be entered in the microcontroller while in said normal mode, the number of input ports being smaller than the number of bits in an instruction word
- using said at least some of the input ports for receiving data serially to be used to program the microcontroller while in said program mode;
- and,
- substantially isolating electrical levels associated with programming the microcontroller from the circuit of the system to be controlled, with the microcontroller installed in circuit with the system, to preclude disturbances to the system during the in-system programming.