Charging a li-ion battery

Hi! I'm powering an Arduino Pro Mini board with a 18650 battery. Now I use a tp4056 controller to charge the battery, but it seems like I can't charge the battery and power the board at the same time. Is there a controller that can power the board and charge the battery at the same time? And when I disconnect external power it should be switched to the battery so this switching is being unnoticed by the board...

Wasn't able to insert an image. Just follow this link - BruControl: Brewery control & automation software | Page 43 | Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

It's called "Load Sharing". The load sharing circuit typically consists of a P-channel mosfet, a schottky diode, and one resistor. The best description I've seen is on this site:

When connected, USB power drives both the Mini and the charger independently, and the battery becomes isolated inside the charger circuit so nothing will interfere with charging.

Can you explain how you have your charger set up? Are you getting power for the charger from the FTDI header, or what? And I assume it's a 3.3V Mini. If so, do you connect the battery output to RAW?

I should say that I don't understand the SparkFun schematic for the Mini. It shows the power pin on the FTDI connector going to Vcc, but it seems to me that for a 3.3V Mini, it should go to RAW to produce regulated 3.3V at Vcc. Edit: No, I'm wrong about that. TxO and RxI are 5V lines, so Vcc has to be 5V when using USB.

ShermanP:
Can you explain how you have your charger set up? Are you getting power for the charger from the FTDI header, or what? And I assume it's a 3.3V Mini. If so, do you connect the battery output to RAW?

I connect the power to micro-USB port of tp4056 charger. The battery is connected to BAT pins, OUT+ goes to RAW pin of Pro Mini. And yes, I'm using 3.3V version.
Thanks for the links!

Ok, but then what do you do when you need to flash new firmware? If you connect a USB adapter to the FTDI header, you’ll get 5V at Vcc. Do you disconnect the battery for that? Actually, maybe it would work with both connected - the regulator wants to produce 3.3V, but it’s already 5V, so maybe it just shuts down. You just don’t want the 5V to flow back through the regulator to the battery.

Anyway, you still need a load sharing circuit when you’re charging so USB can power the Mini and charge the battery properly at the same time.

Actually, the FTDI connector thing kinda complicates this a bit.