TP4056 charge enable and battery detection
Does pulling down the TP4056 CE pin to low disables the entire chip or just stops charging


From the datasheet it is hard to say, but after some quick googling you can find the block diagram of the IC (not sure how reliable it is). According to it, the temperature monitor and, enable pin and feedback op-amp form an "OR" logic configuration, disabling the upper FETs in case of faulty or regulation. Answering your question, I suppose part of the internal circuitry is still functional but with very low quiescent current.

Source


  Also is the CHRG pin flashing when battery is not connected


Battery is being charged: CHRG pin is pulled low 
Battery is completely charged: STDBY is pulled low and CHRG is high impedance

If there is no battery, CHRG should be high impedance.


  How can we connect the CHRG pin and the STDBY pin to the micro controller to detect if battery is connected or not?


As far as I can say, this IC has no "load detection". What you can do is to use a pull-up resistor to check whether "anything" is being charged, and read this voltage with the digital input of the microcontroller.

CHRG high = not charging / there is no load
CHRG low = charging / there is load







simulate this circuit &ndash; Schematic created using CircuitLab