A semiconductor IC has a current detection resistor and a comparison
circuit for comparing the voltage drop across the current detection
resistor with a threshold voltage to detect a possibly large magnitude of
current passing through the current detection resistor. The semiconductor
IC has a current terminal for externally inputting current to the current
detection resistor, a highly resistive current-limiting resistor
connected between the current detection resistor and one input end of the
comparison circuit, and a measurement terminal connected to the node of
the input terminal of the comparison circuit and the current limiting
resistor. Thus, the magnitude of the current flowing through the
measurement resistor is correctly measured without being influenced by
the parasitic resistances of the terminals or of the test probe used. The
threshold level of detection current is regulated based on the measured
level the detection current without flowing therethrough a large amount
of current nor implementing any additional device.