Abstract: A microcomputer, resettable by a reset signal from the outside, for performing processes under the control of a control program, and includes an input and output circuit having a plurality of operation modes, a control signal generator for generating a write signal in an operation mode setting routine of the control program, a control circuit for setting an operation mode of the input and output circuit in response to the write signal, and a protection circuit for protecting the input and output circuit from being reset in operation mode until the protection circuit is reset by the reset signal from the outside once the control circuit has set the operation mode, wherein the input and output circuit receives a signal from and sends a signal to the outside in accordance with the operation mode set by the control circuit.