I have a question regarding circuits for automatically switching which voltage supply to use. I've got a circuit that I want to power from either a barrel connector or a USB connector. When the USB alone is connected, it should power itself from the 5v USB bus. When the barrel connector is connected, it should power itself from that, regardless of whether the USB is connected or not. This is similar to the way the Arduino Uno is designed.
I'm using a P-channel MOSFET to turn off the USB supply when the barrel connector is powered. I've attached two schematics below. (Some details are omitted, such as bypass caps on all the voltage regulators and such. Just ignore these peripheral issues. I've also added some basic over current/reverse voltage/ESD protective measures, which are not really relevant to my question.)
In the first schematic, it's designed a bit like the Arduino Uno circuit, with a 5 volt regulator to first step down the voltage to 5 volts, to power the op amp comparator, and then an LDO 3.3 volt regulator to power the load and to supply the negative input to the comparator. In my particular application, the input at the barrel connector will always be 9 volts; this cannot be changed.
In the 2nd schematic, I've omitted the 5 volt regulator, because absolutely nothing in my circuit is powered by 5 volts. So I'd like to eliminate this part if possible. However, that brings me to my question. What's the effect of omitting this regulator on the op amp?
Imagine the circuit is powered by the USB bus, so Vcc going to the op amp is at 5 volts. Then you plug in the barrel connector and Vcc all of a sudden jumps to 9 volts. I've tested this in a simulator, and the circuit works in principle; it cuts off the MOSFET going to the USB supply. But is there anything taboo about having the op amp's Vcc all of a sudden change like this? Should I have done it differently?
Thanks.