I needed 12V to 3.3 V, and lower power losses than the LM317 analog I am using now. Various small switcher configurations I tried were not that good. I was specifically afraid of a switch transistor failing, and killing a wole lot of chips at once by putting a high power 12V on those, or just frying those at low load with an unexpected voltage rise.
Then I remembered the LM317 datasheet had a switcher example in it. So I build a small test circuit, and that was only so-so, but it worked. Not a very good waveform, and erratic start-up. Also it needed a BIG inductor (600 uH). Are all LM317 the same????? Did some tinkering with that circuit, to see what effected what, nice change from spice to use a soldering iron and a scope. Was actually looking to make it slow-start, to fix the startup (rush in current) by adding caps, but that accidently significantly improved the whole thing! Here is the diagram (do not look if you have low contrast eyes, or are allergic to pencil and paper): ftp://panteltje.com/pub/LM317_switcher/LM317_switcher_diagram_img_2316.jpg The original values from the datasheet are between brackets. The 100 nF cap was added by me. This is the waveform without that cap, with 230 uH (versus theirs 600 uH): ftp://panteltje.com/pub/LM317_switcher/LM317_switcher_no_100nF_img_2320.jpg This is the waveform from my circuit, nice: ftp://panteltje.com/pub/LM317_switcher/LM317_switcher_final_img_2312.jpg This with the .25 Ohm resistor shorted, you really need it: ftp://panteltje.com/pub/LM317_switcher/LM317_switcher_no_.25_Ohm_img_2319.jpg The setup looks like this: ftp://panteltje.com/pub/LM317_switcher/LM317_switcher_test_setup_img_2318.jpg
The power PNP is a BD??? found it somewhere in the junk box, no idea what exactly it is. The nice thing about this circuit is that at zero, or very low load, it stops switching, and the LM317 just works as a linear regulator. As soon as you draw power it starts switching, nothing gets hot, I measured 63 % efficiency at 160 mA load, what I will use it for. Efficiency should go way up at higher loads, the data sheet mentions 3 A.