sim800 restarts on battery but works fine on power supply
You haven't posted any details about the battery you're trying to use, but it's either insufficient decoupling-caps on your Vcc rail to ground, or (probably more likely if you're using an off-the-shelf SIM800 module) a battery that's just too small in capacity - or more accurately - too high an internal resistance, for the load you're drawing.

GSM/GPRS radios have very high current draw in short sharp pulses of 1 amp or even 2 amps.  Your battery's capacity &amp; resultant internal resistance (check its spec sheet) and your power regulation/distribution system need to be able to supply this load without the supply voltage buckling under that load during those current spikes, because that's what's likely resetting your MCU.

Start with getting a 'scope on your Vbatt rail &amp; Vcc rail if they're separated by a regulator, and reviewing your Vcc decoupling regime, and if that seems to be OK or adding some bulk capacitance (e.g. not just 100n ceramics, but also one or a few 10uF tantalum or electrolytic) doesn't help, then get either a bigger capacity battery, or dive deeper into your battery specs to choose one that has low enough internal resistance at your desired capacity/size.