Patent ID: 7020813

Claim:
A microcontroller provided with a function of reading from or writing to a built-in RAM or registers during execution of an application program, wherein said microcontroller comprises: an external interface terminal group for executing transmission and reception of data relative to an outside; and a data transmit/receive section for executing transmission and reception of data between the external interface terminal group and a DMA controller; wherein the DMA controller includes an address register for storing therein an address of a hardware serving as an object to be accessed by DMA, registers for executing reading or writing by the DMA, a control flag for controlling the start of the DMA, and a timing controller of the DMA; wherein said microcontroller is coupled externally to a register for storing therein flag information for determining whether access can be executed or not by the DMA, and a unit for outputting a bus state recognition signal indicating whether a bus state of the microcontroller is in a state to be accessed or not by the DMA; and wherein, when (1) the flag information indicates that access can be executed by the DMA, (2) the bus state recognition signal indicates that the bus can be occupied by the DMA, and (3) the control flag inside the DMA controller indicates that access is started by the DMA, the built-in RAM or registers are accessed under the control of the timing controller of the DMA inside the DMA controller so that data is read from the RAM or registers to the outside of the microcontroller or data is written to the RAM or registers from the outside.