The present invention generally relates to an electronic switching device applied to an electronic product, and a dynamic switching method applied thereto, and more particularly to an electronic switching device applied to an electronic product, and a dynamic switching method applied to the electronic switching device of the electronic product.
Usually, an electronic switching device is widely used in various electronic products. A conventional electronic switching device is chargeable, and the conventional electronic switching device is driven and provided electricity by a rechargeable battery.
As is known to all, when the conventional electronic switching device is applied in the electronic product, such as a cell phone, after the conventional electronic switching device is used, the battery need be charged.
The conventional electronic switching device includes a connection interface connected with an inside of the conventional electronic switching device, and a power element which is disposed in the conventional electronic switching device and is connected with the connection interface, the computer provides the electricity for the conventional electronic switching device to charge the conventional electronic switching device through the computer interface and the connection interface.
The conventional electronic switching device further includes a power and UART (Universal Asynchronous Receiver/Transmitter) module disposed in the conventional electronic switching device. On one hand, in order to make the conventional electronic switching device capable of being charged by the computer, the connection interface is connected with the power element which is disposed in the conventional electronic switching device. On the other hand, in order to make the conventional electronic switching device capable of being communicated with the computer, the power and UART module is connected with the connection interface, the power and UART module is a part of a hardware of the conventional electronic switching device to switch data transmission between a serial communication and a parallel communication, so that purposes of the computer supplying the electricity to the conventional electronic switching device through the connection interface and simultaneously the conventional electronic switching device being communicated with the computer are achieved for satisfying factory production tests, health managements and other applications.
However, when the connection interface of the conventional electronic switching device is connected with the computer to make the conventional electronic switching device be charged by the computer, an operation system of the computer is a windows operation system, a display screen of the computer will display information of device being unrecognized. Moreover, in a condition of the connection interface of the conventional electronic switching device having and starting UART function, when the conventional electronic switching device is connected with the computer, the display screen will display the information of device being unrecognized. A cause of the above-mentioned phenomenon is that the computer interface of the computer transmits and receives USB signals, and when the connection interface of the conventional electronic switching device receives UART signals and then transmits the UART signals to the computer, the windows operation system of the computer has no way of recognizing the UART signals and the information of device being unrecognized is displayed.
Thus, an innovative electronic switching device applied in an electronic product is essential to be provided, after a USB interface of the innovative electronic switching device is connected with the computer through a USB cable, a recognition program unit capable of switching UART function statuses of the innovative electronic switching device is urgent to be needed, and correspondingly a dynamic switching method applied to the innovative electronic switching device of the electronic product is also needed.
An object of the present invention is to provide an electronic switching device applied to an electronic product. The electronic switching device includes a USB (Universal Serial Bus) interface, a multifunction module, a microprogrammed control module, a recognition program unit and a transient memory. The USB interface is connected with a computer through a USB cable. The multifunction module includes a UART (Universal Asynchronous Receiver/Transmitter) circuit unit connected with the USB interface to be communicated with the computer, and a power supply electrically connected with the USB interface to be charged by the computer. The UART circuit unit and the power supply are disposed in the electronic switching device. The UART circuit unit is connected between the USB interface and the microprogrammed control module. The recognition program unit is disposed in the microprogrammed control module. The recognition program unit stores a recognition software program compatible with an operation system of the computer. The transient memory is disposed in the microprogrammed control module. The microprogrammed control module stores an initial value or a start value of the UART circuit unit in the transient memory to dynamically switch UART function statuses of the UART circuit unit to stop or start a UART function by the recognition software program of the recognition program unit.
Another object of the present invention is to provide a dynamic switching method applied to an electronic switching device. After a USB interface of the electronic switching device is connected with a computer through a USB cable, UART function statuses of the electronic switching device is dynamically switched by a recognition software program of a recognition program unit of a microprogrammed control module of the electronic switching device to start or stop a UART function. Specific steps of the dynamic switching method are described hereinafter. Step one: judge whether insertion and withdrawal times between the electronic switching device and the USB cable reach a preset threshold value in a first preset time and by a recognition software program of the recognition program unit compatible with an operation system of the computer, if the insertion and withdrawal times between the USB interface and the USB cable reach the preset threshold value in the first preset time, execute step two, if the insertion and withdrawal times between the USB interface and the USB cable are without reaching the preset threshold value in the first preset time, execute step nine. Step two: start the UART function of the electronic switching device temporarily by virtue of the recognition program unit changing a value stored in a transient memory of the microprogrammed control module, and then execute step three. Step three: judge whether an instruction of starting the UART function sent by the USB cable and sent from the computer is received or not in a second preset time, if the instruction of starting the UART function sent by the USB cable and sent from the computer is received, execute step four, if the instruction of starting the UART function sent by the USB cable and sent from the computer is without being received, execute step eight. Step four: if the recognition program unit receives the instruction of starting the UART function in the second preset time, the recognition program unit starts the UART function of the electronic switching device formally, and then execute step five. Step five: execute the UART function of the electronic switching device by virtue of the recognition program unit receiving the instruction of starting the UART function, and then execute step six. Step six: judge whether the electronic switching device receives an instruction of stopping the UART function sent from the computer or not by the recognition program unit, if the electronic switching device receives the instruction of stopping the UART function sent from the computer, execute step seven, the recognition program unit stops the UART function of the electronic switching device, the electronic switching device is switched to a general status, if the electronic switching device is without receiving the instruction of stopping the UART function sent from the computer, execute the step five. Step seven: switch to an initial status, initialize program variates for preparing to change a start value of the UART circuit unit stored in the transient memory, after completing the preparation for changing the start value of the UART circuit unit, automatically execute step eight. Step eight: change a start value of a UART circuit unit which is stored in the transient memory of the microprogrammed control module into an initial value of the UART circuit unit which is stored in the transient memory by the recognition program unit, after completing executing the step eight, automatically execute the step nine. Step nine: charge the electronic switching device by the computer and through the USB cable.
Another object of the present invention is to provide a dynamic switching method applied to an electronic switching device. After a USB interface of the electronic switching device is connected with a computer through a USB cable, UART function statuses of the electronic switching device are dynamically switched by a recognition software program of a recognition program unit of a microprogrammed control module of the electronic switching device to start or stop a UART function. Specific steps of the dynamic switching method are described hereinafter. Step one: judge whether insertion and withdrawal times between the electronic switching device and the USB cable reach a preset threshold value in a first preset time and by a recognition software program of the recognition program unit compatible with an operation system of the computer, if the insertion and withdrawal times between the USB interface and the USB cable reach the preset threshold value in the first preset time, execute step two. Step two: start the UART function of the electronic switching device temporarily by virtue of the recognition program unit changing a value stored in a transient memory of the microprogrammed control module, and then execute step three. Step three: judge whether an instruction of starting the UART function sent by the USB cable and sent from the computer is received or not in a second preset time, if the instruction of starting the UART function sent by the USB cable and sent from the computer is received, execute step four. Step four: if the recognition program unit receives the instruction of starting the UART function in the second preset time, the recognition program unit starts the UART function of the electronic switching device formally, and then execute step five. Step five: execute the UART function of the electronic switching device by virtue of the recognition program unit receiving the instruction of starting the UART function, and then execute step six. Step six: judge whether the electronic switching device receives an instruction of stopping the UART function sent from the computer or not by the recognition program unit, if the electronic switching device receives the instruction of stopping the UART function sent from the computer, execute step seven, the recognition program unit stops the UART function of the electronic switching device, the electronic switching device is switched to a general status, if the electronic switching device is without receiving the instruction of stopping the UART function sent from the computer, execute the step five. Step seven: switch to an initial status, automatically execute step eight. Step eight: change a start value of the UART circuit unit which is stored in the transient memory into an initial value of the UART circuit unit which is stored in the transient memory by the recognition program unit, after completing executing the step eight, automatically execute step nine. Step nine: charge the electronic switching device by the computer and through the USB cable.
As described above, the dynamic switching method applied to the electronic switching device is provided in the present invention, after the USB interface of the electronic switching device is connected with the computer through the USB cable, the step of the recognition program unit of the microprogrammed control module of the electronic switching device switching the UART function statuses of the electronic switching device is executed. Furthermore, the dynamic switching method has multiple advantages, the power supply disposed in the electronic switching device is connected with the USB interface, so that the computer provides electricity to the power supply of the electronic switching device to charge the electronic switching device by the USB cable, the UART circuit unit is connected with the USB interface to make the UART circuit unit of the electronic switching device communicated with the computer for satisfying factory production tests, health managements and other applications. In addition, when the computer is connected with the USB interface to charge the electronic switching device through the USB cable, a display screen of the computer will be without displaying information of device being unrecognized.
The present invention will be apparent to those skilled in the art by reading the following description, with reference to the attached drawings, in which:
With reference to
After the USB interface 11 of the electronic switching device 100 is connected with the computer 300 through the USB cable 200, the electronic switching device 100 is charged, and an operation system of the computer 300 is a windows operation system, the UART circuit unit 12 is connected with the USB interface 11 to be communicated with the computer 300, the recognition program unit 14 stores a recognition software program compatible with the operation system of the computer 300, the UART function statuses of the UART circuit unit 12 of the electronic switching device 100 are dynamically switched by the recognition software program of the recognition program unit 14 of the microprogrammed control module 13 of the electronic switching device 100 to start or stop a UART function. Specifically, the microprogrammed control module 13 stores an initial value or a start value of the UART circuit unit 12 in the transient memory 15 to dynamically switch the UART function statuses of the UART circuit unit 12 to stop or start the UART function by the recognition software program of the recognition program unit 14. The UART circuit unit 12 is connected between the USB interface 11 and the microprogrammed control module 13. The USB cable 200 is connected between the electronic switching device 100 and the computer 300. The power supply 16 disposed in the electronic switching device 100 is connected with the USB interface 11 to be charged by the computer 300.
The electronic switching device 100 of the electronic product 400 further includes an output module 20 connected with an output end 192 of the microprogrammed control module 13, and an input module 30 connected with an input end 191 of the microprogrammed control module 13. The electronic switching device 100 of the electronic product 400 applying the dynamic switching method to dynamically switch the UART function statuses of the UART circuit unit 12 of the electronic switching device 100 to start or stop the UART function of the UART circuit unit 12 of the electronic switching device 100, and when the USB interface 11 of the electronic switching device 100 receives UART signals and then transmits the UART signals to the computer 300, the operation system of the computer 300 which is the windows operation system is compatible with the recognition software program and recognizes the UART signals, so a display screen 31 of the computer 300 will be without displaying information of device being unrecognized.
A block diagram showing that the USB interface 11 of the electronic switching device 100 of the electronic product 400 is connected with the computer 300 through the USB cable 200 is shown in
In the preferred embodiment, the USB interface 11 has four pins which are a first pin 1, a second pin 2, a third pin 3 and a fourth pin 4. The peripheral circuit system 102 includes a first bidirectional diode D4, a second bidirectional diode D5 and a third bidirectional diode D6. The first pin 1 is connected with a positive pole of the first bidirectional diode D4 through a first testing point TP1. The second pin 2 has a transmitting function, and is connected with a positive pole of the third bidirectional diode D6. The third pin 3 has a receiving function, and is connected with a positive pole of the second bidirectional diode D5. Each of the first bidirectional diode D4, the second bidirectional diode D5 and the third bidirectional diode D6 has a ground foot 17 which is used for connecting with ground 18. The ground feet 17 of the first bidirectional diode D4, the second bidirectional diode D5 and the third bidirectional diode D6 are connected with one another and are connected with the ground 18. The ground feet 17 of the first bidirectional diode D4, the second bidirectional diode D5 and the third bidirectional diode D6 are connected with a second testing point TP3. The second testing point TP3 is connected with the ground 18.
In the preferred embodiment, the UART circuit unit 12 has a transmitting unit 121, and a receiving unit 122 spaced from and parallel with the transmitting unit 121. One end of the transmitting unit 121 is connected with the second pin 2 of the USB interface 11. One end of the receiving unit 122 is connected with the third pin 3 of the USB interface 11. The power supply 16 includes a first voltage end V1 and a second voltage end V2. The first voltage end V1 and the second voltage end V2 are respectively connected with the first pin 1 of the USB interface 11. The peripheral circuit system 102 further includes a first resistor R41, a second resistor R40, a third resistor R12 and a fourth resistor R11. The third resistor R12 and the fourth resistor R11 are 0 Ω. One end of the first resistor R41 is connected with the first voltage end V1, and the other end of the first resistor R41 is without being connected. One end of the second resistor R40 is connected with the second voltage end V2, and the other end of the second resistor R40 is without being connected. The other end of the transmitting unit 121 is connected with the ICSPCLK (In-Circuit Serial Programming) foot 24 of the microprogrammed control module 13 and a third testing point TP21 through the fourth resistor R11. The fourth resistor R11 and the third testing point TP21 are located between the microprogrammed control module 13 and the multifunction module 101. The other end of the receiving unit 122 is connected with the ICSPDAT foot 25 of the microprogrammed control module 13 and a fourth testing point TP 20 through the third resistor R12. The third resistor R12 and the fourth testing point TP 20 are located between the microprogrammed control module 13 and the multifunction module 101. A distance between the microprogrammed control module 13, and the third testing point TP21 and the fourth testing point TP 20 is shorter than a distance between the microprogrammed control module 13, and the third resistor R12 and the fourth resistor R11. The first voltage end V1 is disposed between the first testing point TP1 and the second voltage end V2. The current foot 23 is connected with a fifth testing point TP19.
Referring to
Step one: judge whether insertion and withdrawal times between the USB interface 11 of the electronic switching device 100 and the USB cable 200 reach a preset threshold value in a first preset time and by the recognition software program of the recognition program unit 14 compatible with the operation system of the computer 300, if the insertion and withdrawal times between the USB interface 11 of the electronic switching device 100 and the USB cable 200 reach the preset threshold value in the first preset time, execute step two, if the insertion and withdrawal times between the USB interface 11 of the electronic switching device 100 and the USB cable 200 are without reaching the preset threshold value in the first preset time, execute step nine. The first preset time is six seconds. The preset threshold value of the insertion and withdrawal times is three times.
That is to say, a purpose of the step one is that judge whether a request of starting the UART function of the electronic switching device 100 temporarily is reached by the recognition program unit 14. Within six seconds, the recognition program unit 14 judges whether the USB cable 200 is inserted into the USB interface 11 of the electronic switching device 100 for three times and the USB cable 200 is withdrawn from the USB interface 11 of the electronic switching device 100 for two times. If the recognition program unit 14 judges truly, execute step two, if the recognition program unit 14 judges falsely, execute step nine: charge the electronic switching device 100 by the computer 300 and through the USB cable 200.
A specific judging process is described as follows, within six seconds, after the USB cable 200 is inserted into the USB interface 11 of the electronic switching device 100 for the first time, the recognition program unit 14 judges whether the USB cable 200 is withdrawn from the USB interface 11 of the electronic switching device 100, then the USB cable 200 is inserted into the USB interface 11 of the electronic switching device 100 again, once more, the USB cable 200 is withdrawn from the USB interface 11 of the electronic switching device 100, and the USB cable 200 is inserted into the USB interface 11 of the electronic switching device 100 for one more time.
Step two: start the UART function of the electronic switching device 100 temporarily by virtue of the recognition program unit 14 changing a value stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100, and then execute step three. For example, an initial value of the UART circuit unit 12 stored in the transient memory 15 is 0x00, the initial value of the UART circuit unit 12 stored in the transient memory 15 is changed into a start value of the UART circuit unit 12 stored in the transient memory 15, the start value of the UART circuit unit 12 stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100 is 0xFF, so that the UART function is started.
Step three: the recognition program unit 14 judges whether an instruction of starting the UART function sent by the USB cable 200 and sent from the computer 300 is received or not in a second preset time. The second preset time is five seconds. If the instruction of starting the UART function sent by the USB cable 200 and sent from the computer 300 is received, execute step four, if the instruction of starting the UART function sent by the USB cable 200 and sent from the computer 300 is without being received, execute step eight, the recognition program unit 14 changes the start value of the UART circuit unit 12 stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100 into the initial value.
The start value of the UART circuit unit 12 stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100 is 0xFF, after the recognition program unit 14 changes the start value of the UART circuit unit 12 stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100 into the initial value of the UART circuit unit 12 stored in the transient memory 15, the initial value of the UART circuit unit 12 stored in the transient memory 15 is 0x00, so that the UART function is stopped.
Step four: if the recognition program unit 14 receives the instruction of starting the UART function in the second preset time, the recognition program unit 14 starts the UART function of the electronic switching device 100 formally, and then execute step five.
Step five: the recognition program unit 14 executes the UART function of the electronic switching device 100 by virtue of the recognition program unit 14 receiving the instruction of starting the UART function, and then execute step six. The UART function is applied in factory production tests, health managements and other applications.
Step six: judge whether the electronic switching device 100 receives an instruction of stopping the UART function sent from the computer 300 or not by the recognition program unit 14, if the electronic switching device 100 receives the instruction of stopping the UART function sent from the computer 300, execute step seven, the recognition program unit 14 stops the UART function of the electronic switching device 100, the electronic switching device 100 is switched to a general status, if the electronic switching device 100 is without receiving the instruction of stopping the UART function sent from the computer 300, execute the step five.
Step seven: switch to an initial status, initialize program variates for preparing to change the start value of the UART circuit unit 12 stored in the transient memory 15, after completing the preparation for changing the start value of the UART circuit unit 12, automatically execute step eight.
Step eight: change the start value of the UART circuit unit 12 which is stored in the transient memory 15 of the microprogrammed control module 13 of the electronic switching device 100 into the initial value of the UART circuit unit 12 which is stored in the transient memory 15 by the recognition program unit 14. After completing executing the step eight, automatically execute step nine.
Step nine: charge the electronic switching device 100 by the computer 300 and through the USB cable 200.
As described above, the dynamic switching method applied to the electronic switching device 100 is provided in the present invention, after the USB interface 11 of the electronic switching device 100 is connected with the computer 300 through the USB cable 200, the step of the recognition program unit 14 of the microprogrammed control module 13 of the electronic switching device 100 switching the UART function statuses of the electronic switching device 100 is executed. Furthermore, the dynamic switching method has multiple advantages, the power supply 16 disposed in the electronic switching device 100 is connected with the USB interface 11, so that the computer 300 provides electricity to the power supply 16 of the electronic switching device 100 to charge the electronic switching device 100 by the USB cable 200, the UART circuit unit 12 is connected with the USB interface 11 to make the UART circuit unit 12 of the electronic switching device 100 communicated with the computer 300 for satisfying the factory production tests, the health managements and other applications. In addition, when the computer 300 is connected with the USB interface 11 to charge the electronic switching device 100 through the USB cable 200, the display screen of the computer 300 will be without displaying the information of device being unrecognized.
The electronic switching device 100 and the dynamic switching method applied to the electronic switching device 100 which are provided in the present invention have industrial use values, nevertheless, the above-mentioned description is just a description of the preferred embodiment of the present invention, a person whoever is skillful in this skill, may easily proceed with a variety of improvements according to the above-mentioned description, the variety of the improvements completed according to the above-mentioned description still belong to a spirit of the present invention and a patent scope of the present invention limited below.
Number | Date | Country | Kind |
---|---|---|---|
108141887 | Nov 2019 | TW | national |
This application claims the priorities of U.S. provisional patent application No. 62/852,323, filed on May 24, 2019 and Taiwan patent application no. 108141887, filed on Nov. 19, 2019, which are incorporated herewith by reference.
Number | Date | Country | |
---|---|---|---|
62852323 | May 2019 | US |