A semiconductor device that includes a circuit portion, a first light-shielding film and plural second light-shielding films. The wafer-holding face has a surface roughness Rmax of 0. Here, the master device compares stored error detection data with the received error detection data and initializes the slave device when the stored error detection data is not the same as the received error detection data. The leakage current during the standby time is interrupted by bringing the switch into a conducting state during the active time, and by bringing the switch into a nonconducting state during the standby time.