| CPC H02J 7/007182 (2020.01) [G01R 31/68 (2020.01); H02J 7/0049 (2020.01)] | 17 Claims |

|
1. A device for detecting an attachment and detachment of a portable device, the device comprising:
a first terminal and a second terminal configured to be connected to the portable device;
a pull-up circuit connected to the first terminal;
a charging circuit configured to generate an output voltage for charging the portable device through the first terminal and the second terminal; and
a controller configured to
control the charging circuit to generate the output voltage when a voltage of the first terminal drops while the first terminal is pulled up by the pull-up circuit and the controller is in a detachment state, the drop in the voltage of the first terminal corresponding to a voltage drop that occurs when the portable device attaches to the device, and the detachment state being a first state of the controller corresponding to a determination that the portable device has detached from the device, and
determine whether to transition to an attachment state based on an output current output from the charging circuit through the first terminal during a first period in which the output voltage is generated, the attachment state being a second state of the controller corresponding to a determination that the portable device is attached to the device,
wherein the controller is configured to periodically compare the output current with a first reference current during the first period, count a first number of times the output current is equal to or greater than the first reference current and determine a transition to the attachment state when the first number of times is greater than a value greater than 1.
|