Designing an off-line (as in, powered off-line mains voltage) converter has always been a difficult process since, in addition to calculating numerous part specifications, safety must also be considered. ICs such as the TNY268PN make the work easier by including all of the necessary control components as well as the power switch into a single IC. A transformer and some passives are the only external components required. The diagram below is an example application circuit of TNY268PN.

TNY268PN Application Circuit
The TYN268PN is mostly handled as a high-voltage power MOSFET linked to the transformer's low side. Only two extra pins are used: the bypass pin for the internal power supply, which must be connected with an appropriate capacitor, and the EN/UV pin, which also acts as the feedback pin. The feedback network is an optocoupler that is activated when the breakdown voltage of the output Zener diode is exceeded. To avoid voltage spikes from harming the internal power switch, an RC network is attached to the IC's drain. The IC contains an inbuilt 6.4V Zener diode that restricts the drain-source voltage to safe levels. Internally, the switch's current is limited to 500mA.