Patent attributes
A nonvolatile semiconductor memory for setting control voltages to be supplied to an internal circuit, to an external reference voltage inputted from outside, has a parameter control circuit. The parameter control circuit causes a parameter register to sequentially output the plurality of parameters to a voltage generating control circuit. The parameter control circuit counts, for a fixed period of time, the number of oscillations of each of the trimming flag signals sequentially outputted from the voltage generating control circuit in response to the parameters. The parameter control circuit stores counted values corresponding to the parameters. The parameter control circuit selects the parameter having a maximum counted value as a parameter corresponding to the control voltage closest to the external reference voltage.