Circuit apparatus comprising a programmable device and an electrostatic discharge, ESD, protection device, wherein - the circuit apparatus comprises a rail power supply for power supply of the circuit apparatus, - the programmable device comprises a high voltage supply terminal (HV_PAD) for providing high-voltage pulses for programming the programmable device and the ESD protection device is coupled to the high voltage supply terminal (HV_PAD) of the programmable device and - the ESD protection device comprises a detection circuit, a control circuit and a transistor (Mesd), wherein - - the detection circuit is arranged and configured to distinguish between a positive ESD event and a high-voltage rising pad pulse on the high voltage supply terminal (HV_PAD), wherein the detection circuit comprises a threshold detection circuit configured to detect an ESD event when an input signal of the detection circuit exceeds a given threshold, the threshold being set higher than a required high-voltage pad pulse for programming the programmable device and wherein the - - the control circuit is configured to provide a control signal on its output dependent on a detection output signal of the detection circuit, - - the transistor (Mesd) is coupled to a reference potential terminal and the high voltage supply terminal (HV_PAD) and a control input of the transistor (Mesd) is coupled to the output of the control circuit. - the circuit apparatus comprises a rail power supply for power supply of the circuit apparatus, - the programmable device comprises a high voltage supply terminal (HV_PAD) for providing high-voltage pulses for programming the programmable device and the ESD protection device is coupled to the high voltage supply terminal (HV_PAD) of the programmable device and - the ESD protection device comprises a detection circuit, a control circuit and a transistor (Mesd), wherein - - the detection circuit is arranged and configured to distinguish between a positive ESD event and a high-voltage rising pad pulse on the high voltage supply terminal (HV_PAD), wherein the detection circuit comprises a threshold detection circuit configured to detect an ESD event when an input signal of the detection circuit exceeds a given threshold, the threshold being set higher than a required high-voltage pad pulse for programming the programmable device and wherein the - - the control circuit is configured to provide a control signal on its output dependent on a detection output signal of the detection circuit, - - the transistor (Mesd) is coupled to a reference potential terminal and the high voltage supply terminal (HV_PAD) and a control input of the transistor (Mesd) is coupled to the output of the control circuit. - - the detection circuit is arranged and configured to distinguish between a positive ESD event and a high-voltage rising pad pulse on the high voltage supply terminal (HV_PAD), wherein the detection circuit comprises a threshold detection circuit configured to detect an ESD event when an input signal of the detection circuit exceeds a given threshold, the threshold being set higher than a required high-voltage pad pulse for programming the programmable device and wherein the - - the control circuit is configured to provide a control signal on its output dependent on a detection output signal of the detection circuit, - - the transistor (Mesd) is coupled to a reference potential terminal and the high voltage supply terminal (HV_PAD) and a control input of the transistor (Mesd) is coupled to the output of the control circuit.