Patent ID: 8761599

Claim:
A semiconductor device, comprising: an analog/digital conversion unit converting an analog signal into a digital signal; a pulse width modulation unit outputting a transmission signal, the transmission signal being a pulse pattern corresponding to the digital signal output from the analog/digital conversion unit; a reference signal generation unit generating a reference signal, the reference signal being a fixed pulse pattern; a first control unit selecting one from the transmission signal and the reference signal; a light emitting element drive unit outputting a drive current based on the transmission signal when the first control unit selects the transmission signal, and based on the reference signal when the first control unit selects the reference signal; a light emitting element driven by the drive current output by the light emitting element drive unit to emit an optical signal; an optical receiving unit converting a photocurrent of a light receiving element receiving the optical signal into a voltage signal; and a demodulation unit demodulating the voltage signal into a digital signal corresponding to the selected one of the transmission signal and the reference signal.