Charging and discharging circuit

A charging and discharging circuit is provided, which includes a charging and discharging control circuit, a first connection port, a first switch circuit, a second switch circuit, a second connection port, a third switch circuit, a fourth switch circuit, and an identification logic circuit. The identification logic circuit determines a mode of the first connection port according to a first channel configuration signal of the first connection port, the charging and discharging control circuit switches the first switch circuit and the second switch circuit according to the mode of the first connection port, and the charging and discharging control circuit determines a mode of the second connection port according to a second channel configuration signal of the second connection port, so as to switch the third switch circuit and the fourth switch circuit.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application claims the benefit of priority to Taiwan Patent Application No. 110107512, filed on Mar. 3, 2021. The entire content of the above identified application is incorporated herein by reference.

FIELD OF THE DISCLOSURE

The present disclosure relates to a charging and discharging circuit, and more particularly to a charging and discharging circuit that can allow dual USB ports to charge and/or discharge independently in one mobile electronic device.

BACKGROUND OF THE DISCLOSURE

In the existing charging and discharging circuit, if two or more universal serial bus (USB) ports are simultaneously supplying power to a system of a mobile electronic device, a voltage difference between the USB ports causes the reverse voltage with each other, thereby damaging part of adapters in the USB ports.

On the other hand, if one of the USB ports needs to charge the system of the mobile electronic device, and the system outputs signals through the other USB port in USB On-The-Go (OTG) standard, then the USB port that is inserted at a later time will fail to work properly. For example, a USB port will not be able to perform charging if the USB port for charging is plugged in later, and the USB for OTG output will not be able to perform OTG outputting if the USB port for OTG output is plugged in later.

SUMMARY OF THE DISCLOSURE

In response to the above-referenced technical inadequacies, the present disclosure provides a charging and discharging circuit that can allow dual USB ports to charge and/or discharge independently in a mobile electronic device.

In one aspect, the present disclosure provides a charging and discharging circuit that connects the battery module and the system-side circuit. The charging and discharging circuit includes a charging and discharging control circuit, a first connection port, a first switch circuit, a second switch circuit, a second connection port, a third switch circuit, a fourth switch circuit and an identification logic circuit. The charging and discharging control circuit has a first input terminal, a second input terminal, an identification terminal, a battery terminal and an output terminal. The battery terminal is connected to the battery module, and the output terminal is connected to the system-side circuit. The first switch circuit is connected between the first connection port and the first input terminal to form a first charging path. The second switch circuit is connected between the first connection port and the output terminal to form a first discharging path. The third switch circuit is connected between the second connection port and the second input terminal to form a second charging path. The fourth switch circuit is connected between the second connection port and the output terminal to form a second discharging path. The identification logic circuit is connected to the first connection port and configured to determine whether a mode of the first connection port mode is in a first charging mode or a first discharging mode according to a first channel configuration signal of the first connection port in response to the first port being connected to a first signal source. The charging and discharging control circuit is configured to control the first switch circuit to be switched in the first charging mode to enable the first charging path, or to control the second switch circuit to be switched in the first discharging mode to enable the first discharging path. The charging and discharging control circuit is configured to receive a second channel configuration signal from the second connection port through the identification terminal in response to the second connection port being connected to a second signal source, so as to determine whether a mode of the second connection port is in a second charging mode or a second discharging mode, and the charging and discharging control circuit is configured to control the third switch circuit to be switched in the second charging mode to enable the second charging path, or to control the fourth switch circuit to be switched in the second discharging mode to enable the second discharging path.

Therefore, the charging and discharging circuit of the present disclosure provides an independent control mechanism and a charging/discharging path for each of the dual USB ports so as to realize that the dual USB ports in a mobile electronic device are configured to charge and discharge independently. When both of the dual USB ports are configured to enter a charging mode to charge a battery module of the mobile electronic device, the dual USB ports are controlled according to a predetermined priority to avoid reverse voltage with each other. In addition, the charging and discharging circuit of the present disclosure also can support that the dual USB ports enter into the discharging mode simultaneously.

DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

FIG.1is a circuit layout of a charging and discharging circuit according to one embodiment of the present disclosure. Referring toFIG.1, an embodiment of the present invention provides a charging and discharging circuit1, which includes a charging and discharging control circuit10, a first connection port11, a first switch circuit12, a second switch circuit13, a second connection port14, and a third switch circuit15, the fourth switch circuit16and the identification logic circuit17. In one embodiment, the first connection port11and the second connection port14can be the same type of connection port, such as a universal serial bus (USB) type-C connection port. The present disclosure is not limited thereto. In one embodiment, the first connection port12and the second connection port22can also be different types of connection ports, such as a USB Type-A connection port and a USB Type-C connection port.

The charging and discharging control circuit10has a first input terminal In1, a second input terminal In2, an identification terminal CC1, a battery terminal Bat, and an output terminal Out. The battery terminal Bat is connected to the battery module20, and the output terminal Out is connected to a system-side circuit30. For example, the charging and discharging control circuit10, the battery module20, and the system-side circuit30can be built in a mobile electronic device, the system-side circuit30can be powered by the battery module20through the charging and discharging control circuit10, and the charging and discharging control circuit10can be connected to an external signal source, such as a voltage source, to charge the battery module20through the first connection port11and the second connection port14, or can be connected to another electronic device that needs to be powered by the above-mentioned mobile electronic device.

For example, the charging and discharging control circuit10can be, for example, a programmable logic controller circuit, a micro-processor circuit, a digital signal processor (DSP), or a micro-control circuit, but the present disclosure is not limited thereto.

Next, the first switch circuit12is connected between the first connection port11and the first input terminal Inl to form a first charging path Pcl. The second switch circuit13is connected between the first connection port11and the output terminal Out to form a first discharge path Pdcl.

On the other hand, the third switch circuit15is connected between the second connection port14and the second input terminal In2to form a second charging path Pc2. The fourth switch circuit16is connected between the second connection port14and the output terminal Out to form a second discharge path Pdc2.

For example, the first switch circuit12, the second switch circuit13, the third switch circuit15and the fourth switch circuit16each include a P-type metal-oxide-semiconductor field effect transistor (PMOSFET) and an N-type metal-oxide-semiconductor field effect transistor (NMOSFET). In certain embodiments, the first switch circuit12, the second switch circuit13, the third switch circuit15and the fourth switch circuit16further each include a current limiting unit, which is configured to turn off the corresponding PMOSFET and the corresponding NMOSFET in response to a rated current being exceeded. For example, the first switch circuit12, the second switch circuit13, the third switch circuit15, and the fourth switch circuit16are all power switches to ensure the safety and reliability of power supplies. The current limiting unit can safely cut off the power supply in response to overloading or overheating. The power switch can include a control terminal (for example, an EN pin), which is used to activate the MOSFET and prevent reverse current through a diode. In response to an output current of the power switch exceeding a current upper limit threshold, the current limiting unit turns off the MOSFET. In certain embodiments, the power switch can include another terminal to notify the system that a failure has occurred in response to any protection function being triggered. In another embodiment, the charging and discharging control circuit10can also be provided with the current limiting unit for the first input terminal Inl and the second input terminal In2, such that in response to the rated current being exceeded, the corresponding first input terminal Inl or the second input terminal In2can be disabled; however, the foregoing configuration is for exemplary purposes only, and the present disclosure is not limited thereto.

The identification logic circuit17is connected to the first connection port11. The identification logic circuit17can be, for example, a programmable logic controller circuit, a micro-processor circuit, a digital signal processor (DSP), or a micro-control circuit, but the present disclosure is not limited thereto.

More specifically, the identification logic circuit17is connected to a channel configuration (CC) pin of the first connection port11. When the first connection port11is connected to the first signal source S1, the identification logic circuit17can establish a corresponding power transmission mode with a first signal source S1from an external device through the CC pin of the first connection port11, for example: a master-slave relationship, which one serves as a master device (Host) to be used as a power supply end (Source), and which one serves as a slave device (Slave) to be used as a power receiving end (Sink), and a charging specification between the charging and discharging control circuit10and the first signal source S1, and the like.

In response to the first connection port11being connected to the first signal source S1, the identification logic circuit17determines whether a mode of the first connection port11is in a first charging mode or a first discharging mode according to a first channel configuration signal Scc1of the first connection port11, and outputs a mode signal Sm indicating the mode of the first connection port11to the charging and discharging control circuit10, correspondingly.

In detail, in response to the identification logic circuit17determining that the first signal source S1is a master device (Host), the charging and discharging control circuit10is a slave device (Slave), the identification logic circuit17determines that the mode of the first port11is in the first charging mode. In other words, the first charging path Pc1is to be used, and the identification logic circuit17correspondingly generates the mode signal Sm to inform the charging and discharging control circuit10that the first charging path Pcl needs to be enabled.

In contrast, in response to the identification logic circuit17determining that the first signal source S1is the slave device and the charging and discharging control circuit10is the master device, the identification logic circuit17determines that the mode of the first connection port11is in the first discharging mode. In other words, the first discharging path Pdc1is to be used, and the identification logic circuit17correspondingly generates the mode signal Sm to inform the charging and discharging control circuit10that the first discharging path Pdcl needs to be enabled.

Further, in response to the charging and discharging control circuit10receiving the mode signal Sm, according to which of the first charging mode or the first discharging mode that the first connection port11is in as indicated by the mode signal Sm, the first switch circuit12is controlled to be switched in the first charging mode so as to enable the first charging path Pc1, or the second switch circuit13is controlled to be switched in the first discharging mode so as to enable the first discharging path Pdc1.

Similarly, the charging and discharging control circuit10is connected to the second connection port14and has a similar identification mechanism. In response to the second connection port14being connected to the second signal source S2, the charging and discharging control circuit10receives a second channel configuration signal Scc2from the second connection port14through the identification terminal CC1, which is used to determine whether the mode of the second connection port14is in the second charging mode or the second discharging mode.

In detail, the identification logic circuit17is connected to a channel configuration (CC) pin of the second connection port14. When the second connection port14is connected to the second signal source S2, the charging and discharging control circuit17can establish a corresponding power transmission mode with the second signal source S2of an external device through the CC pin of the second connection port14, for example: a master-slave relationship, which one serves as a master device (Host) to be used as a power supply end (Source), and which one serves as a slave device (Slave) to be used as a power receiving end (Sink), and a charging specification between the charging and discharging control circuit10and the second signal source S1, and the like.

In response to the second connection port14being connected to the second signal source S2, the charging and discharging control circuit10can determine a master-slave relationship between the second signal source S2and the charging and discharging control circuit according to the second channel configuration signal Scc2, so as to determine whether the mode of the second connection port14is in the second charging mode or in the second discharging mode, whereby the charging and discharging control circuit10can control the third switch circuit15and the fourth switch circuit16to be switched, so as to enable the second charging path Pc2or the second discharge path Pdc2.

For example, in response to the charging and discharging control circuit10determining that the second signal source S2is the master device and the charging and discharging control circuit10is the slave device, the charge and discharge control circuit10determines that the mode of the second connection port14is in the second charging mode. In other words, the second charging path Pc2is to be used.

In contrast, in response to the charging and discharging control circuit10determining that the second signal source S2is the slave device and the charging and discharging control circuit10is the master device, the charging and discharging control circuit10determines that the mode of the second connection port14is in the second discharging mode. In other words, the second discharge path Pdc2is to be used.

In addition, in the embodiment ofFIG.1, the charging and discharging circuit1further includes a first power conversion circuit18and a second power conversion circuit19. The first power conversion circuit18is connected between the second switch circuit13and the output terminal Out, and the second power conversion circuit19is connected between the fourth switch circuit16and the output terminal Out. The first power conversion circuit18is configured to perform power conversion on an output voltage Vout at the output terminal Out in response to the first discharging path being enabled, and the second power conversion circuit19is configured to perform power conversion on the output voltage Vout in response to the second discharging path being enabled.

For example, the first power conversion circuit18and the second power conversion circuit19can be a boost power converter, a buck power converter, or a buck-boost power converter. The type of the power converters can be determined according to the output voltage provided by the charging and discharging control circuit10Vout, the rated voltage of the battery module20, and voltages to be output to the first connection port11and the second connection port14, so as to step up or step down the output voltage. The above are only examples, and the present disclosure is not limited thereto.

However, as described above, in order to avoid reverse voltage with each other, or where the USB port that is inserted later cannot operate properly, the charging and discharging circuit1provided by the present disclosure has different manners of control for different scenarios.

Reference can be made toFIG.2, which is a schematic diagram of the charging and discharging paths in a first charging and discharging scenario according to one embodiment of the present disclosure. In the first charging and discharging scenario, the first signal source Si and the second signal source S2can be, for example, adapters that can both provide electricity to the battery module20. Therefore, the charging and discharging control circuit10determines that the mode of the second connection port14is in the second charging mode, and is informed, according to the mode signal Sm, that the first connection port11is determined by the identification circuit17to be in the first charging mode. The charging and discharging control circuit10is configured to, according to a predetermined priority set by the user, sequentially control the first switch circuit12and the third switch circuit15, so as to enable one of the first charging path Pc1and the second charging path Pc2, and disable the other.

In the embodiment ofFIG.2, the predetermined priority prioritizes use of the second connection port14. Therefore, the charging and discharging control circuit10controls the first switch circuit12to be turned off, and the third switch circuit15to be turned on, so as to disable the first charging path Pc1and enable the second charging path Pc2. At the same time, the charging and discharging control circuit10charges the battery module20through the battery terminal Bat in response to the second charging path Pc2being enabled.

In addition, it should be noted that the first charging path Pc1and the first discharging path Pdc1are mutually exclusive, and when one is enabled, the other is disabled. Similarly, the second charging path Pc2and the second discharging path Pdc2are mutually exclusive. Therefore, in the first charging and discharging scenario, the charging and discharging control circuit10also controls the second switch circuit13and the fourth switch circuit16to be turned off, so as to disable the first discharging path Pdcl and the second discharging path Pdc2.

Reference can be made toFIG.3, which is a schematic diagram of the charging and discharging paths in a second charging and discharging scenario according to one embodiment of the present disclosure. In the second charging and discharging scenario, the first signal source S1is another electronic device that needs to be powered, and the second signal source S2is an adapter that can provide electricity to the battery module20. Therefore, the charging and discharging control circuit10determines that the mode of the second connection port14is in the second charging mode, and is informed, according to the mode signal Sm, that the first connection port11is determined to be in the first discharging mode by the identification circuit17. The charging and discharging control circuit10controls the second switch circuit12and the third switch circuit15to be turned on, so as to enable the first discharging path Pdcl and the second charging path Pc2. At the same time, the charging and discharging control circuit10charges the battery module20through the battery terminal Bat in response to the second charging path Pc2being enabled. In addition, in the second charging and discharging scenario, the charging and discharging control circuit10also controls the first switch circuit12and the fourth switch circuit16to be turned off, so as to disable the first charging path Pdc1and the second discharging path Pdc2.

Reference can be made toFIG.4, which is a schematic diagram of the charging and discharging paths in a third charging and discharging scenario according to one embodiment of the present disclosure. In the third charging and discharging scenario, the first signal source S1is an adapter that can provide power to the battery module20, and the second signal source S2is another electronic device that needs to be powered. Therefore, the charging and discharging control circuit10determines the mode of the second connection port14is in the second discharging mode, and is informed, according to the mode signal Sm, that the first connection port11is determined to be in the first charging mode by the identification circuit17. The charging and discharging control circuit10controls the first switch circuit12and the fourth switch circuit16to be turned on, so as to enable the first charging path Pc1and the second discharging path Pdc2. At the same time, the charging and discharging control circuit10charges the battery module20through the battery terminal Bat when the first charging path Pc1is enabled. In addition, in the third charging and discharging scenario, the charging and discharging control circuit10also controls the second switching circuit13and the third switching circuit15to be turned off, so as to disable the first discharging path Pdc1and the second charging path Pc2.

FIG.5is a schematic diagram of charging and discharging path in a fourth charging and discharging scenario according to one embodiment of the present disclosure. In the fourth charging and discharging scenario, both the first signal source S1and the second signal source S2are electronic devices that need to be powered. Therefore, the charging and discharging control circuit10determines that the mode of the second connection port14is in the second discharging mode, and is informed, according to the mode signal Sm, that the first connection port11is determined to be in the first discharge mode by the identification circuit17. The charging and discharging control circuit10controls the second switch circuit13and the fourth switch circuit16to be turned on, so as to enable the first discharging path Pdc1and the second discharge path Pdc2. At the same time, in response to the first discharging path Pdc1and the second discharging path Pdc2both being enabled, the battery module20charges the first signal source S1and the second signal source S2through the battery terminal Bat. In addition, in the third charging and discharging scenario, the charging and discharging control circuit10also controls the first switching circuit12and the third switching circuit15to be turned off, so as to disable the first charging path Pc1and the second charging path Pc2.

In conclusion, the charging and discharging circuit provided by the present disclosure can realize independent usage of each of the dual USB ports in a mobile electronic device, including both charging and discharging, by providing independent charging and discharging paths, and an independent control mechanism for the dual USB ports.

Furthermore, in the charging and discharging circuit provided by the present disclosure, when the dual USB ports are both configured to enter a charging mode, the dual USB ports are controlled according to a predetermined priority to avoid reverse voltage with each other and charge a battery module of the mobile electronic device. In addition, the charging and discharging circuit provided by the present disclosure supports simultaneous entering of the dual USB ports into the discharging mode.