Both 7805 and LM317 are linear regulators - this means the difference between 20v and 3.3 or 5v is converted to heat.
So let's say you have a microcontroller and a small lcd screen... you'd use about 100mA of power... The linear regulator would have to take 20v and get it down to 5v, so it will turn into heat (20-5) * 0.1 = 1.5 watts That's a lot of wasted power wasted.
A microcontroller is not really that sensitive to the quality of the DC voltage, as long as it runs at few Mhz and you filter the voltage a bit using some capacitors. You should be able to use a cheap and simple switching regulator to convert that 20 v down to 5v or 3.3v - switching regulators are more efficient and don't waste as much power turning it into heat, but you do need a few extra components.
A very simple chip for something like this is the 34063 (made by various companies) :
http://uk.farnell.com/jsp/search/browse.jsp?N=2025+203946&Ntk=gensearch&Ntt=34063&Ntx=mode+matchallpartialDave even made a video about how these regulators work and how to calculate all the values needed for these regulators here :
and there's also an online calculator for these chips which makes it easy for you :
http://dics.voicecontrol.ro/tutorials/mc34063/(later edit ) The datasheets for this chip even have examples with this up to 25v input and 5v / 0.5 A output, which is enough for most home circuits/small prototypes... see page 11:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00001232.pdf There's also a video Dave made about the differences between linear regulators and switching regulators :
So you could use the switching regulator to go straight 20v to 5v or 3.3v, and the microcontroller will probably run just fine with it.
If you want to be extra sure and have as smooth voltage as possible (for example if you want to use the 5v voltage as reference for analog to digital converters instead of the built in reference voltage), you can always configure this switching regulator to generate 6-6.5v, then use a linear regulator to take this 6-6.5 down to a smooth 5v. Most linear regulators need the input voltage to be 1-1.5 volts above their output (but some can require as low as 0.2v above the output, like MIC2941)