I am working on a project which will be powered by a single lithium ion cell that is boosted to 5V with a MCP1640 boost IC. It will sometimes be connected via usb, and I would like the circuit to automatically switch to usb power when it is plugged in. The MCP1640 has an active high enable pin, so I was thinking I could use the enable pin to switch the circuit from battery power to usb. Would it work if I were to use a NOT inverter IC like (http://uk.rs-online.com/web/p/standard-logic-gates/7705351/) to put a low input signal into the MCP1640 enable pin when USB 5v is input into the inverter IC so that the boost IC is shut down when the usb is connected? Thanks in advance for any advice!
What you are looking for is called PMIC - Power Management IC. The MCP1640 is a weaker version of real PMIC. Several companies (Linear, Texas Instruments, Cypress) offer a whole line of ICs that are charging a Li-Ion battery when external power is available (while feeding the system directly), and automatically turn to battery booster when external power is lost. These circuits also can limit the power they take from USB in accord with the standard, and some even might negotiate power within BC1.2 specifications. As an example, take a look at this IC, BQ24296. It is likely that you will find a better fit to your particular need from the sizable lineup of their products.