摘要 |
PROBLEM TO BE SOLVED: To provide a microcomputer that can diagnose a defect of a memory as curbing enlargement in size of a circuit.SOLUTION: A diagnosis control unit 5 is configured to: read and write data relative to a memory 4 for executing a defect diagnosis, and a diagnosis control unit 5 is configured to hold the data read from the memory 4 in a buffer 10. A diagnosis data generation unit 11 is configured to generate diagnosis data on the basis of the data held in the buffer 10, and the diagnosis control unit 5 is configured to re-read the diagnosis data after writing the generated diagnosis data in an address of the memory 4 reading the held data. A defect determination unit 12 is configured to execute the defect diagnosis depending upon whether the held data and the diagnosis data are in a relationship corresponding to a generation pattern of a diagnosis data generator 11. The diagnosis control unit 5 is configured to cause a CPU2 to read the data held by the buffer 10 when the CPU2 accesses to a diagnosis object address during execution of the defect diagnosis, and to halt the defect diagnosis when the CPU2 performs writing access to the address, and re-execute the defect diagnosis. |