Background technology
In the past, in the mobile communication terminal that has possessed USB port, possessed USB port and battery input/output end port separately in order to carry out the USB application program.That is, possessed separately, for example, carried out the required USB port of data transmit-receive to the required battery input/output end port of mobile communication terminal supply battery supply, external USB device and USB application program.
Because, in mobile communication terminal, possessed USB port and battery input/output end port separately in the past, therefore strengthened the mobile communication terminal volume, and when being connected with the external USB device, even if exist by the power supply of external device (ED) to the USB port input, but, make battery supply be in dual user mode owing to used battery supply.
As mentioned above, the problem of the existence in mobile communication terminal in the past is, owing to possessed separate USB port and battery input/output end port, thus strengthened the mobile communication terminal volume.
And, in mobile communication terminal in the past, when connecting the external USB device,, still also use battery supply even if exist from the power supply of external device (ED) to the USB port input by USB port, therefore caused battery supply by the problem of dual use.
Summary of the invention
The objective of the invention is to, a kind of mobile communication terminal and driving method with USB (universal serial bus) port is provided, promptly, the voltage that detection is imported by battery and public USB port, voltage that is detected and the reference voltage of having set are compared, to judge that the device that is connected with above-mentioned public USB port is external USB device or the battery that has possessed USB plug, make external USB device or battery supplied power source of mobile communication terminal, thereby can reduce the electric consumption of battery, can also dwindle the space that occupies by USB port and battery input/output end port.
In order to realize aforesaid purpose, technical scheme of the present invention is: a kind of mobile communication terminal with USB (universal serial bus) port, install the mobile communication terminal of the USB (universal serial bus) drive division of communicating by letter for having possessed outside USB (universal serial bus) (USB) with the USB (universal serial bus) of carrying out mobile communication terminal, it comprises following component part: battery has possessed USB (universal serial bus) plug and battery unit; Public USB (universal serial bus) port is connected the USB (universal serial bus) plug of outside universal serial bus device or above-mentioned battery with mobile communication terminal; Power control part, the voltage (VBUS) that the outside universal serial bus device that is connected with above-mentioned public USB (universal serial bus) port or battery are imported detects, and relatively this detection voltage and the reference voltage of having set are with the control signal of output appointment; Central processing unit (CPU) receives from the control signal of above-mentioned power control part output, if the control signal that is received during for the control signal of relevant outside universal serial bus device, drives above-mentioned USB (universal serial bus) drive division.
In order to realize aforesaid purpose, the present invention also provides a kind of mobile communication terminal USB (universal serial bus) port driving method with USB (universal serial bus) port, for the mobile communication terminal that has possessed the public USB (universal serial bus) port that battery or outside universal serial bus device are connected with mobile communication terminal, it comprises the steps: to detect the voltage (VBUS) that is input in the public USB (universal serial bus) port, and voltage that is detected and the reference voltage of having set are compared; Through above comparison, if the voltage that is detected during less than reference voltage, will be judged as battery to the device of public USB (universal serial bus) port input voltage, and the power supply by the battery supplied mobile communication terminal; If the voltage that is detected is during greater than reference voltage, to be judged as outside universal serial bus device to the device of public USB (universal serial bus) port input voltage, by the power supply of outside universal serial bus device supply mobile communication terminal, and the USB (universal serial bus) data communication between execution and the outside universal serial bus device.
Effect of the present invention is, the voltage that detection is imported by battery and public USB port, this voltage that is detected and the reference voltage of having set are compared, judge that the device that is connected with above-mentioned public USB port is external USB device or the battery that has possessed USB plug, make external USB device or battery supplied power source of mobile communication terminal, thereby reached the electric consumption that reduces battery, dwindle the effect that is taken up space by USB port and battery input/output end port.
Embodiment
Below in conjunction with accompanying drawing and preferred embodiment, mobile communication terminal and the USB driving method that has possessed USB port among the present invention with as above feature is elaborated.
Fig. 1 is the mobile communication terminal part-structure displayed map that has possessed USB port among relevant the present invention; As showing among the figure, comprise following component part: battery 50 has possessed USB plug 51 and battery unit 52; Public USB port 40 is connected the USB plug 51 of external USB device (not shown) or above-mentioned battery 50 with mobile communication terminal; Power control part 10, the voltage (VBUS) that the external USB device that is connected with above-mentioned public USB port 40 or battery 50 are imported detects, and relatively this detection voltage and the reference voltage of having set are with the control signal (H or L) of output appointment; Central processing unit (CPU) 20, reception is from the control signal of above-mentioned power control part 10 outputs, if being the control signal of relevant external USB device input voltage, the control signal that is received (for example, in the time of H), drives the usb data communication between 30 execution of USB drive division and the external USB device.
USB plug (VBUS at above-mentioned battery 50, D+, D-, GND) in 51, the D+ circuit is connected with the thermistor (thermistor) of battery 50 inside, power control part 10 will insert by the D+ circuit (DP) of public USB port 40, can detect the temperature of battery 50,, can carry out corresponding control according to battery temperature based on these, at this, no longer be elaborated.
Above-mentioned power control part 10 comprises that in order to detect the voltage that is input to public USB port 40 analog and digital signal converter (ADC:Analog to Digital Converter) (not shown) constitutes, the device that can determine relevant judgement to be connected on the above-mentioned public USB port 40 by the mobile communication terminal manufacturer is battery 50 or the required reference voltage of external USB device, and this reference voltage can be maximum voltage and the voltage from being worth between the minimum voltage of external USB device input that satisfies from battery 50 inputs.For example, the voltage of exporting from battery 50 is generally 3.5~4.2[V], and the voltage of importing from the external USB device is 5[V], therefore, the said reference value should be set to 4.5[V].
And if when the external USB device is connected public USB port 40, USB drive division 30 will receive drive control signal from CPU20, carry out and the external USB device between the usb data transmission-receiving function.
Fig. 2 is relevant embodiment precedence diagram based on mobile communication terminal USB driving method of the present invention.As shown in the figure, following steps have been comprised: detect the voltage (VBUS) be input in the public USB port 40, VBUS and the reference voltage of having set (4.5[V]) are compared; Through above comparison, if VBUS during less than reference voltage, will be judged as battery 50 to the device of public USB port 40 input voltages, switch to battery mode, by battery 50 supply power source of mobile communication terminal; Through above comparison,, switch to the USB pattern, by external USB device provisioning power source of mobile communication terminal if VBUS during greater than reference voltage, will be judged as the external USB device to the device of public USB port 40 input voltages.
And, also comprise the steps: to drive usb driver (drive division), and carry out USB application program (application) if when importing the power supply of above-mentioned mobile communication terminal by the external USB device.
Shuo Ming USB pattern is in the present invention, connects the external USB device, and passes through the driving power of external USB device provisioning mobile communication terminal, can carry out the pattern of usb data communication between external USB device and the mobile communication terminal.
Below the operation of the present invention that is made of above-mentioned steps is described.
At first, the user will have the battery 50 of USB plug 51 or will carry out and mobile communication terminal between the required external USB device of data communication be connected in the public USB port.
After above-mentioned public USB port connects battery or external USB device, detect the voltage of importing to public USB port (VBUS) by power control part, and VBUS is compared with the reference voltage of having set (4.5V).
Through above comparison, if VBUS during less than reference voltage, that is, if when the device of public USB port (40) input voltage is battery 50, mobile communication terminal is switched to battery mode, by the battery supplied power source of mobile communication terminal.
On the contrary, through above comparison, if VBUS is during greater than reference voltage, promptly, if when the device of public USB port 40 input voltages is the external USB device, mobile communication terminal being switched to the USB pattern, the 5[V of the external USB device input that will pass through to be connected] power supply uses and is the mobile communication terminal driving power.
And, switch to after the USB pattern, CPU20 is received from the control signal (H) of power control part 10 outputs, drive USB drive division 30, USB application program between execution and the external USB device, for example, the data transmit-receive application program between execution and the external USB device.And, before the user carries out end operation, move above-mentioned USB application program always.
As mentioned above, the present invention has possessed can be by battery that has USB plug and the public USB port of external USB device, thereby has possessed the advantage that can reduce by battery port and the occupied space of USB port.
As above detailed description, in the present invention, the voltage that detection is imported by battery and public USB port, this voltage that is detected and the reference voltage of having set are compared, judge that the device that is connected with above-mentioned public USB port is external USB device or the battery that has possessed USB plug, make external USB device or battery supplied power source of mobile communication terminal, thereby reached the electric consumption that reduces battery, dwindle the effect that is taken up space by USB port and battery input/output end port.
Above embodiment only limits to illustrate the present invention, but not is used to limit the present invention.