摘要 |
PROBLEM TO BE SOLVED: To provide a microcontroller capable of externally accessing a flash memory even when a protected program is stored therein.SOLUTION: A debug circuit 2 generates a debug active signal VD while a program stored in a flash memory 1 is being debugged. A protection range setting circuit 3 sets a protection range PR of addresses of the flash memory 1. An address detection circuit 4 generates an address detection signal DA when an address AD on an address bus 100 is within the protection range PR. A branch instruction detection circuit 5 generates a branch instruction detection signal DB when issuance of a branch instruction is detected. When the debug active signal VD is generated, an access control circuit 6 determines whether to grant an access to the flash memory 1 or not on the basis of the output of the address detection circuit 4 and the output of the branch instruction detection circuit 5.SELECTED DRAWING: Figure 1 |