Disclosure of Invention
Aiming at the problems in the prior art, the application provides a dual-power switching communication device and method for a glucometer, which can supply power to the glucometer internally through a non-rechargeable battery and can be automatically switched to be supplied with power by an external power supply when the external power supply is connected, so that the convenience of independent operation of the glucometer can be effectively improved, the cost of internal power supply equipment can be effectively reduced, and the efficiency and the convenience of flows such as internal and external power supply switching and the like can be effectively improved.
In order to solve the technical problem, the application provides the following technical scheme:
in a first aspect, the present application provides a dual power switching communication device for a blood glucose meter, comprising: a dual power supply automatic switching circuit;
the dual-power automatic switching circuit comprises a first MOS tube, a non-rechargeable battery, an external power interface and an internal power supply interface, wherein the non-rechargeable battery, the external power interface and the internal power supply interface are respectively connected to the first MOS tube;
the internal power supply interface is connected to a singlechip of the glucometer, so that when the glucometer is in a data acquisition operation state, the first MOS tube is conducted to enable the non-rechargeable battery to supply power to the singlechip through the internal power supply interface;
the external power supply interface is connected with an output voltage interface of a USB-to-serial converter connected to the single chip microcomputer, so that when the blood glucose meter is connected with a client terminal device through the USB interface connected to the USB-to-serial converter, the diode is conducted and the first MOS tube is disconnected by the external power supply output by the output voltage interface, and the external power supply supplies power to the single chip microcomputer through the internal power supply interface.
Furthermore,pin 1 of the first MOS transistor is connected to the external power supply interface, two sides of the external power supply interface are respectively connected to a resistor and the diode, the diode andpin 2 of the first MOS transistor are both connected to the internal power supply interface, and the internal power supply interface is connected to the power supply interface of the single chip microcomputer;
and the 3 pins of the first MOS tube are connected with the non-rechargeable battery.
Further, still include: an auxiliary power supply control circuit;
the auxiliary power supply control circuit comprises a resistor and a second MOS tube which are connected with each other;
the resistor is connected with an I/O interface of the singlechip;
the second MOS tube is connected with a power supply interface of the singlechip, so that when the glucometer is in a data acquisition operation state, the non-rechargeable battery supplies power to the singlechip and the auxiliary power supply control circuit through the internal power supply interface; and when the blood glucose meter is connected with a client terminal device through the USB interface, the external power supply supplies power to the singlechip and the auxiliary power supply control circuit through the internal power supply interface.
Furthermore, a trigger is connected to the USB-to-serial converter;
the trigger is connected with an external interrupt pin of the single chip microcomputer, so that when the USB interface is connected with a client terminal device, the external interrupt pin detects a falling edge signal from the trigger, and the single chip microcomputer generates external interrupt after the falling edge signal continuously keeps a low level state in a preset time period, so that the blood glucose meter is awakened to be started up and carries out data communication with the client terminal device.
Further, the trigger comprises a photoelectric coupler and a resistor which are connected with each other;
the trigger circuit is respectively connected with an external interrupt pin of the singlechip and a voltage signal interface of the USB-to-serial port converter.
Furthermore, the USB to serial port converter is connected to the USB interface through a positive polarity data line and a negative polarity data line, and the positive polarity data line and the negative polarity data line are respectively provided with an ESD electrostatic protection device.
Furthermore, a power line for supplying power to the USB interface is arranged between the USB-to-serial converter and the USB interface.
Furthermore, an input interface of the single chip microcomputer is connected with an output interface of the USB-to-serial port converter; and the output interface of the singlechip is connected with the input interface of the USB-to-serial port converter.
On the other hand, the application also provides a dual-power switching communication method for the glucometer, which is realized by applying the dual-power switching communication device for the glucometer, and the dual-power switching communication method for the glucometer comprises the following steps:
if the blood glucose meter is detected to be in a data acquisition operation state, the first MOS tube is conducted, so that the non-rechargeable battery supplies power to the single chip microcomputer through the internal power supply interface;
if the blood glucose meter is detected to be connected with a client terminal device through the USB interface, an external power supply output by the output voltage interface enables the diode to be conducted and the first MOS tube to be disconnected, so that the external power supply supplies power to the single chip microcomputer through the internal power supply interface.
Furthermore, a trigger is connected to the USB-to-serial converter; the trigger is connected with an external interrupt pin of the singlechip, and correspondingly, the dual-power switching communication method of the glucometer further comprises the following steps:
if the blood glucose meter is detected to be connected with a client terminal device through the USB interface, the external interrupt pin detects a falling edge signal from the trigger, and the single chip microcomputer generates external interrupt after the falling edge signal continuously keeps a low level state in a preset time period, so that the blood glucose meter is awakened to be started;
the single chip microcomputer is used for carrying out function configuration on the blood glucose meter and displaying a synchronous interface on a display screen of the blood glucose meter so that the blood glucose meter enters a data communication state with the client terminal equipment;
and the client terminal equipment sends a handshake protocol to the singlechip through the USB-to-serial converter, and if the singlechip sends response information to the client terminal equipment from the USB-to-serial converter according to the handshake protocol, the client terminal equipment receives and sends data with the blood glucose meter through the USB-to-serial converter.
According to the technical scheme, the dual-power switching communication device and the dual-power switching communication method for the glucometer comprise the following steps: a dual power supply automatic switching circuit; the dual-power automatic switching circuit comprises a first MOS tube, a non-rechargeable battery, an external power interface and an internal power supply interface, wherein the non-rechargeable battery, the external power interface and the internal power supply interface are respectively connected to the first MOS tube; the internal power supply interface is connected to a singlechip of the glucometer, so that when the glucometer is in a data acquisition operation state, the first MOS tube is conducted to enable the non-rechargeable battery to supply power to the singlechip through the internal power supply interface; the external power source interface is connected with an output voltage interface of a USB-to-serial port converter connected to the single chip microcomputer, so that when the glucometer is connected with a client terminal device through a USB interface connected to the USB-to-serial port converter, the external power source output by the output voltage interface enables the diode to be connected and the first MOS tube to be disconnected, the external power source supplies power to the single chip microcomputer through the internal power supply interface, the internal power supply can be supplied through a non-rechargeable battery, when a USB data line is inserted for communication at all times, the glucometer can be automatically switched to the external power source for supplying power, the USB-to-be-plugged-and-used and PC communication is achieved, the flow is simple and rapid to operate, the USB is unplugged for communication automatic shutdown within one second, and meanwhile the circuit capacity is enhanced and the electrostatic breakdown is prevented.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The external power supply generally adopts power adapter or USB power supply, is connected to PC through the USB data line and carries out the communication, promptly: the power adapter or the USB does not need to be switched for external power supply, a hardware circuit adopts a USB-to-serial port IC interface, and the blood glucose meter is communicated with the PC in time through a USB data line. However, the blood glucose meter is limited in use due to the mode, cannot work without an external power supply, and cannot be used in a plug-and-play mode for real-time communication. The internal power supply adopts a rechargeable battery such as a lithium battery to supply power for the internal power supply of the glucometer, the rechargeable battery can be automatically switched into the external power supply to supply power when being connected with the external power supply for charging, and the rechargeable battery is connected to a PC (personal computer) for communication through a USB (universal serial bus) data line, namely, a hardware circuit for internal power supply adopts multi-interface display of an operating system, a power management IC (integrated circuit) is matched with a USB-to-serial port IC (integrated circuit) interface to realize the automatic switching function of the internal power supply and the external power supply, and the independent power key is switched to a data synchronization interface to communicate with the PC after being started. Therefore, in view of the above problems of the dual-power switching communication mode of the conventional blood glucose meter, the application provides a dual-power switching communication device and method for the blood glucose meter.
Based on this, blood glucose meter duplicate supply switches communication device includes: a dual power supply automatic switching circuit; the dual-power automatic switching circuit comprises a first MOS tube, a non-rechargeable battery, an external power interface and an internal power supply interface, wherein the non-rechargeable battery, the external power interface and the internal power supply interface are respectively connected to the first MOS tube; the internal power supply interface is connected to a singlechip of the glucometer, so that when the glucometer is in a data acquisition operation state, the first MOS tube is conducted to enable the non-rechargeable battery to supply power to the singlechip through the internal power supply interface; the external power supply interface is connected with an output voltage interface of a USB-to-serial converter connected to the single chip microcomputer, so that when the blood glucose meter is connected with a client terminal device through the USB interface connected to the USB-to-serial converter, the diode is conducted and the first MOS tube is disconnected by the external power supply output by the output voltage interface, and the external power supply supplies power to the single chip microcomputer through the internal power supply interface.
Based on this, the dual-power switching communication method of the glucometer comprises the following steps: if the blood glucose meter is detected to be in a data acquisition operation state, the first MOS tube is conducted, so that the non-rechargeable battery supplies power to the single chip microcomputer through the internal power supply interface; if the blood glucose meter is detected to be connected with a client terminal device through the USB interface, an external power supply output by the output voltage interface enables the diode to be conducted and the first MOS tube to be disconnected, so that the external power supply supplies power to the single chip microcomputer through the internal power supply interface.
The application provides a two switching of power communication device of blood glucose meter and method, use inside button cell or dry battery power supply when gathering blood glucose numerical value alone, when inserting USB data line communication often, the blood glucose meter can automatic switch to the external power supply, realize inserting USB and opening the machine in one second, plug-and-play and PC communication, the simple operation of flow is swift, pull out USB and break and switch on the news auto-shutdown in one second, the interference killing feature of reinforcing circuit simultaneously and prevent the electrostatic breakdown.
In one or more embodiments of the present application, the blood glucose meter operates in two different ways, one being a photoelectric type and the other being an electrode type. The photoelectric blood glucose meter is similar to a CD machine and is provided with a photoelectric head, the photoelectric blood glucose meter has the advantages of low price and short service life, and the detection head is exposed in the air and is easily polluted to influence the test result, and the error range is about plus or minus 0.8. The electrode type test principle is more scientific, the electrode port is concealed, the pollution can be avoided, and the error range is about plus or minus 0.5 generally. The precision is high, under the normal use condition, need not the calibration, long-lived. The blood glucose meter has two types from blood sampling modes, namely a blood smearing type blood glucose meter and a blood sucking type blood glucose meter. The blood-smearing machine generally has a large blood-collecting amount, so that patients feel more pain. If the blood sampling is too much, the test result can be influenced, the blood volume is insufficient, the operation can fail, test paper is wasted, and most of the blood glucose meters are photoelectric. The blood-sucking type glucometer has the advantages that the test paper controls the blood sample metering by itself, the result deviation caused by the problem of the blood volume can be avoided, and the operation is convenient. The blood glucose meter mentioned in the application is suitable for various existing types of blood glucose meters which are internally provided with single-chip microcomputers and are provided with USB interfaces, and the blood glucose meters can be connected with the USB interfaces of client equipment through the USB interfaces of the blood glucose meters, and can specifically adopt USB connecting wires and the like.
In one or more embodiments of the present application, a Single-Chip Microcomputer (or a Microcontroller) is a Microcomputer that integrates a central processing unit, a memory, a Timer/Counter (Timer/Counter), various input/output interfaces, and the like on an integrated circuit Chip.
In one or more embodiments of the present application, ESD (Electro-Static discharge) means "electrostatic discharge". ESD has been developed in the middle of the 20 th century to study the generation and damage of static electricity and the protection of static electricity. Therefore, it is customary internationally to refer to the equipment for electrostatic protection collectively as ESD, herein termed electrostatic impeders.
In one or more embodiments of the present application, data synchronization refers to data synchronization and information sharing between devices, and data maintains integrity and unity.
In one or more embodiments of the present application, a falling edge refers to the instant at which a digital level changes from a high level (digital "1") to a low level (digital "0") in a digital circuit. The signal generated at the falling edge is the falling edge signal. Triggering by a falling edge: when the signal has a falling edge, the switch is triggered by the falling edge when the potential changes from high to low to trigger the output change. I.e. when the measured signal potential is going from high to low, i.e. falling.
In one or more embodiments of the present application, a rising edge refers to the instant at which a digital level changes from a low level (digital "0") to a high level (digital "1") in a digital circuit. The signal generated at the rising edge is the rising edge signal. Rising edge triggering: the switching action when the signal has a rising edge is called rising edge trigger when the potential is changed from low to high to trigger output change. I.e. when the measured signal potential is low to high, i.e. falling.
In one or more embodiments of the present application, the non-rechargeable battery is typically a button battery or a dry battery.
Specifically, the following examples are given to illustrate the respective examples.
In order to supply power to the blood glucose meter internally through the non-rechargeable battery and automatically switch to an external power supply when the external power supply is connected, an embodiment of the dual power switching communication device for the blood glucose meter is provided in the present application, and referring to fig. 1 to 4, the dual power switching communication device for the blood glucose meter specifically includes the following contents:
duplicate supply automatic switchover circuit 7, duplicate supply automatic switchover circuit 7 includes first MOS pipe Q1, is connected to non-rechargeable battery BT1, external power source interface 8 and the inside power supply interface VCC1 of this first MOS pipe Q1 respectively, be equipped with diode D1 between external power source interface 8 and the inside powersupply interface VCC 1.
The inside power supply interface VCC1 is connected to the power supply interface VCC of thesinglechip 2 of theblood glucose meter 1 to when theblood glucose meter 1 is in the data acquisition operation state, first MOS pipe Q1 switches on and makes the non-rechargeable battery BT1 via the inside power supply interface VCC1 does thesinglechip 2 supplies power.
The external power interface 8 is connected to an output voltage interface Vo of the USB toserial converter 3 connected to thesingle chip microcomputer 2, so that when theblood glucose meter 1 is connected to aclient terminal device 6 through theUSB interface 5 connected to the USB toserial converter 3, the external power output by the output voltage interface Vo makes the diode D1 turned on and the first MOS transistor Q1 turned off, so that the external power (+3.3V) supplies power to thesingle chip microcomputer 2 through the internal powersupply interface VCC 1.
Specifically, the USB-to-serial converter 3 is connected with a trigger 4; the USB-to-serial converter 3 is connected with aUSB interface 5 on theblood glucose meter 1, the trigger 4 is connected with an external interrupt pin EXTI of thesinglechip 2 arranged in theblood glucose meter 1, so that when theUSB interface 5 is connected with aclient terminal device 6, the external interrupt pin EXTI detects a falling edge signal from the trigger 4, and thesinglechip 2 generates external interrupt after the falling edge signal continuously keeps a low level state for a preset time period, so that theblood glucose meter 1 is awakened to be started up and carries out data communication with theclient terminal device 6.
It can be understood that the USB toserial converter 3 may also be referred to as a USB to serial IC interface, or a USB to serial chip, and may be implemented by using an existing USB to serial chip, such as model number chips of FT232, PL2303, and CH 340.
It is understood that theclient terminal device 6 may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a PC device, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
As can be seen from the above description, in the dual power switching communication device for a blood glucose meter provided in the embodiment of the present application, the internal power supply interface is connected to a single chip of the blood glucose meter, so that when the blood glucose meter is in a data collection operation state, the first MOS transistor is turned on, so that the non-rechargeable battery supplies power to the single chip through the internal power supply interface; the external power source interface is connected with an output voltage interface of a USB-to-serial port converter connected to the single chip microcomputer, so that when the glucometer is connected with a client terminal device through a USB interface connected to the USB-to-serial port converter, the external power source output by the output voltage interface enables the diode to be connected and the first MOS tube to be disconnected, the external power source supplies power to the single chip microcomputer through the internal power supply interface, the internal power supply can be supplied through a non-rechargeable battery, when a USB data line is inserted for communication at all times, the glucometer can be automatically switched to the external power source for supplying power, the USB-to-be-plugged-and-used and PC communication is achieved, the flow is simple and rapid to operate, the USB is unplugged for communication automatic shutdown within one second, and meanwhile the circuit capacity is enhanced and the electrostatic breakdown is prevented.
In an embodiment of the dual power switching communication device of the blood glucose meter, a power line VBUS for supplying power to a USB is arranged between the USB-to-serial port converter 3 and theUSB interface 5; thesingle chip microcomputer 2 is provided with a power supply interface VCC.
In an embodiment of the dual power switching communication device for the glucometer,pin 1 of the first MOS transistor Q1 is connected to the external power interface 8, two sides of the external power interface 8 are respectively connected with a resistor R1 and a diode D1, pins 2 of the diode D1 and the first MOS transistor Q1 are both connected to the internal power supply interface VCC1, and the internal power supply interface VCC1 is connected to the power supply interface VCC of thesingle chip microcomputer 2; thepin 3 of the first MOS transistor Q1 is connected with the non-rechargeable battery BT1, and the resistor R1 and the non-rechargeable battery BT1 are both connected with a wire grounding end GND.
In an embodiment of the dual-power-supply-switching communication device for the blood glucose meter, referring to fig. 5, the dual-power-supply-switching communication device for the blood glucose meter further comprises: an auxiliary power supply control circuit 9; the auxiliary power supply control circuit 9 comprises a resistor R2 and a second MOS tube Q2 which are connected with each other; the resistor R2 is connected with an I/O interface (via a digital interaction control interface CN in figures 2 and 5) of thesinglechip 2; the second MOS transistor Q2 is connected to a power supply interface VCC of thesingle chip microcomputer 2, so that when theblood glucose meter 1 is in a data collection operation state, the non-rechargeable battery BT1 supplies power to thesingle chip microcomputer 2 and the auxiliary power supply control circuit 9 through the internal powersupply interface VCC 1; and when theblood glucose meter 1 is connected with aclient terminal device 6 through theUSB interface 5, the external power supply supplies power to thesinglechip 2 and the auxiliary power supply control circuit 9 through the internal powersupply interface VCC 1.
Particularly, this application embodiment can realize inside and outside power automatic switch and safe quick and PC communication on low-cost non-rechargeable battery power supply blood glucose meter, and the hardware circuit constitutes and includes: the device comprises asinglechip 2, aUSB interface 5, a trigger circuit consisting of two paths of ESD electrostatic protection circuits of an ESD electrostatic protection device D2 and an ESD electrostatic protection device D3, a USB-to-serial port converter 3, a resistor R and a photoelectric coupler U1, a double-power-supply automatic switching circuit 7 consisting of a resistor R1, a diode D1 and a first MOS tube Q1, and an auxiliary power supply control circuit 9 consisting of a resistor R2 and a second MOS tube Q2. The specific application scenarios are as follows:
(1) internal power supply: when theglucometer 1 independently collects the blood sugar value, an internal button cell or a dry cell or other non-rechargeable battery BT1 is used for supplying power, and an external power supply is 0V; the first MOS tube Q1 is switched on, the diode D1 is switched off in the reverse direction, the current of the non-rechargeable battery BT1 passes through the first MOS tube Q1, and the first MOS tube Q1 supplies power to thesingle chip microcomputer 2 and the auxiliary power supply control circuit 9 through thepins 3 and 2.
(2) External power supply: when theglucometer 1 is in a shutdown state or a work standby state, one end of a USB data line is connected with a PC, the other end of the USB data line is inserted into aUSB interface 5, the output voltage Vo of a USB-to-serial port IC (namely, a USB-to-serial port converter 3) outputs +3.3V external power, the external power triggers a first MOS tube Q1 to cut off a diode D1 for conduction, so that a non-rechargeable battery BT1 serving as an internal power is disconnected, and the +3.3V external power supplies power to supply power to thesinglechip 2 and the auxiliary power control circuit 9 through a diode D1, thereby realizing the mutual switching of the internal power and the external.
(3) Starting the blood glucose meter: the USB-to-serial port IC (namely the USB-to-serial port converter 3) outputs continuous voltage signals from a voltage signal interface Vi, the voltage signal interface Vi generates a falling edge trigger signal through a trigger circuit formed by a resistor R and a photoelectric coupler U1, the falling edge trigger signal is transmitted to an external interrupt pin EXTI of thesingle chip microcomputer 2, thesingle chip microcomputer 2 generates interrupt to enable theblood glucose meter 1 to be quickly started, both sides of aclient terminal device 6 sending a communication instruction can communicate through an input interface RX, an output interface TX, a positive polarity data line D + and a negative polarity data line D-to pull out a USB, the voltage signal of the voltage signal interface Vi disappears to enable the trigger circuit to be invalid, thesingle chip microcomputer 2 inquires that the external interrupt pin EXTI is changed from low level to high level to quickly sleep and shut down, and the scheme realizes the cycle process of inserting USB start and PC communication and pulling out USB.
In one embodiment of the dual power switching communication device of the blood glucose meter, the trigger 4 comprises an optoelectronic coupler U1 and a resistor R which are connected with each other; and the photoelectric coupler U1 is respectively connected with an external interrupt pin EXTI of thesinglechip 2 and a voltage signal interface Vi of the USB-to-serial port converter 3.
In one embodiment of the dual power switching communication device of the blood glucose meter, the photocoupler U1 can enhance the anti-interference capability of the circuit.
In one embodiment of the dual-power switching communication device of the blood glucose meter, an input interface RX of thesingle chip microcomputer 2 is connected with an output interface TX of the USB-to-serial port converter 3; and an output interface TX of thesinglechip 2 is connected with an input interface RX of the USB-to-serial port converter 3.
In an embodiment of the dual power switching communication device of the blood glucose meter, the USB toserial port converter 3 and theUSB interface 5 are respectively connected through a positive polarity data line D + and a negative polarity data line D-. An ESD electrostatic protection device D3 is arranged on the positive polarity data line D +, and an ESD electrostatic protection device D2 is arranged on the negative polarity data line D-.
In order to enable internal power supply of a blood glucose meter through a non-rechargeable battery and enable automatic switching to external power supply when an external power supply is connected, an embodiment of the present application provides an embodiment of a dual power switching communication method for a blood glucose meter, which is implemented by applying the dual power switching communication device for a blood glucose meter, and referring to fig. 6, the dual power switching communication method for a blood glucose meter specifically includes the following contents:
step 001: if the blood glucose meter is detected to be in a data acquisition operation state, the first MOS tube is conducted, so that the non-rechargeable battery supplies power to the single chip microcomputer through the internal power supply interface.
Step 002: if the blood glucose meter is detected to be connected with a client terminal device through the USB interface, an external power supply output by the output voltage interface enables the diode to be conducted and the first MOS tube to be disconnected, so that the external power supply supplies power to the single chip microcomputer through the internal power supply interface.
From the above description, the dual power switching communication method for the glucometer provided by the embodiment of the application can automatically switch to external power supply to supply power when a USB data line is inserted for communication when internal power supply is realized through a non-rechargeable battery, so that the glucometer can be inserted into a USB for one second for starting up, plug and play and PC communication are realized, the process is simple and quick to operate, the USB is pulled out for one second for switching off and switching on and automatically switching off, and meanwhile, the anti-jamming capability of the circuit is enhanced and electrostatic breakdown is prevented.
In one embodiment of the dual power switching communication method of the blood glucose meter, a trigger is connected to the USB-to-serial port converter; the trigger is connected with an external interrupt pin of the single chip microcomputer, referring to fig. 7, the dual power switching communication method of the blood glucose meter further includes the following steps:
step 100: if the blood glucose meter is detected to be connected with a client terminal device through the USB interface, the external interrupt pin detects a falling edge signal from the trigger, and the single chip microcomputer generates external interrupt after the falling edge signal continuously keeps a low level state in a preset time period, so that the blood glucose meter is awakened to be started.
Step 200: and the singlechip is used for carrying out functional configuration on the blood glucose meter and displaying a synchronous interface on a display screen of the blood glucose meter so as to enable the blood glucose meter to enter a data communication state with the client terminal equipment.
Step 300: and the client terminal equipment sends a handshake protocol to the singlechip through the USB-to-serial converter, and if the singlechip sends response information to the client terminal equipment from the USB-to-serial converter according to the handshake protocol, the client terminal equipment receives and sends data with the blood glucose meter through the USB-to-serial converter.
From the above description, the dual power switching communication method for the blood glucose meter provided in the embodiment of the present application can realize power on in one second after the USB device is inserted, and communication with theclient terminal device 6 can be realized by plug and play through the arrangement of the USB toserial port converter 3 and the trigger 4 which are connected with each other, and on the basis of realizing plug and play of theblood glucose meter 1, convenience and reliability of communication between theblood glucose meter 1 and theclient terminal device 6 after power on and power off can be effectively improved, the process is simple and fast to operate, the USB device is unplugged within one second, and the communication between theblood glucose meter 1 and the PC is disconnected, and the cycle process of plugging the USB into the USB and automatically shutting down is realized.
In an embodiment of the dual power switching communication method for a blood glucose meter, beforestep 100, the following is further included:
step 010: and the single chip microcomputer starts corresponding system initialization processing after receiving the system initialization instruction and enters a low power consumption mode.
In an embodiment of the dual power switching communication method for a blood glucose meter, afterstep 300, the following is further included:
step 400: if the USB interface is disconnected with the client terminal equipment, the external interrupt pin EXTI detects a rising edge signal from the trigger, and the single chip microcomputer enters a low power consumption mode after the rising edge signal continuously keeps a high level state for a preset time period.
To further explain the scheme, the present application further provides a specific application example of the dual power switching communication method for a glucometer by using the dual power switching communication device for a glucometer, referring to fig. 1 to 5, in order to realize automatic switching of internal and external power supplies and safe and fast communication with a PC on a low-cost non-rechargeable battery powered glucometer, a hardware circuit comprises: the device comprises asinglechip 2, aUSB interface 5, a trigger circuit consisting of two paths of ESD electrostatic protection circuits of an ESD electrostatic protection device D2 and an ESD electrostatic protection device D3, a USB-to-serial port converter 3, a resistor R and a photoelectric coupler U1, a double-power-supply automatic switching circuit 7 consisting of a resistor R1, a diode D1 and a first MOS tube Q1, and an auxiliary power supply control circuit 9 consisting of a resistor R2 and a second MOS tube Q2.
Referring to fig. 8, the software execution flow of the single chip microcomputer is as follows:
when the USB is plugged into the on-line, the EXTI pin detects a falling edge signal and continuously keeps the low-level single chip microcomputer to generate external interruption, the instrument is awakened to be started up, the function configuration is carried out, the synchronous interface is displayed to enter a communication state, the host computer sends out a handshake protocol, the slave computer responds to the handshake protocol and can continue to receive and transmit data, otherwise, the slave computer does not respond to the host computer and resends the command again until the communication is finished, and when the EXTI pin of the single chip microcomputer detects a rising edge and continuously keeps the high-level USB unplugged instrument to be shut down and execute the halt instruction to enter the low-power. Wherein Y represents "YES" and N represents "NO".
Specifically, the blood glucose meter dual power switching communication device that this application example provided, hardware circuit constitutes: the auxiliary power supply control circuit comprises a trigger circuit consisting of two paths of ESD electrostatic protection circuits including an ESD electrostatic protection device D2 and an ESD electrostatic protection device D3, a USB-to-serial converter 3, a resistor R and a photoelectric coupler U1, a double-power-supply automatic switching circuit 7 consisting of a resistor R1, a diode D1 and a first MOS tube Q1, and an auxiliary power supply control circuit 9 consisting of a resistor R2 and a second MOS tube Q2. Wherein, NOP is idle operation command interface, VDD is power voltage interface.
ESD electrostatic protection device D2 and ESD electrostatic protection device D3.
The input and output signal isolation of a trigger circuit formed by the resistor R and the photoelectric coupler U1 can enhance the anti-interference capability of the circuit.
The dual-power automatic switching circuit 7 is composed of a resistor R1, a diode D1 and a first MOS tube Q1, and the first MOS tube Q1 can be a low-voltage P-channel MOS tube.
The resistor R2 and the second MOS tube Q2 form an auxiliary power supply control circuit 9 which controls the power consumption of modules for temperature acquisition, blood glucose concentration acquisition, data storage, clock, code card information storage and the like.
And initializing an EXTI pin by a singlechip program, setting the EXTI pin as a falling edge to trigger an internal fracture of the external part, and entering a low-power-consumption sleep mode.
The glucometer uses an internal button cell or dry cell to supply power in a non-communication state, and an external power supply is 0V; the first MOS transistor Q1 turns on the diode D1 to cut off the current of the non-rechargeable battery BT1 in the reverse direction, and the power is supplied to thesingle chip microcomputer 2 and the auxiliary power supply control circuit 9 through thepins 3 and 2 of the first MOS transistor Q1.
When the glucometer is inserted into a USB communication state, the USB-to-serial port IC outputs +3.3V external power supply, the first MOS tube Q1 is triggered to cut off the diode D1 to be conducted, the non-rechargeable battery BT1 is cut off, and the +3.3V external power supply supplies power to thesinglechip 2 and the auxiliary power supply control circuit 9 through the diode D1, so that the internal and external power supplies are switched.
When the USB port is connected to a PC, the USB-to-serial port IC interface outputs a continuous voltage signal, the voltage signal generates a falling edge trigger signal to an external interrupt pin EXTI through a trigger circuit formed by a resistor R and a photoelectric coupler U1, and thesinglechip 2 generates interrupt to wake up the startup.
Thesingle chip microcomputer 2 starting program initializes an external interrupt pin EXTI to be input pull-up, and level change of the pin is inquired at any time.
The PC sends communication commands to the two parties, namely, the two parties can communicate through the input interface RX, the output interface TX, the positive polarity data line D + and the negative polarity data line D-.
When thesingle chip microcomputer 2 inquires that the external interrupt pin EXTI is changed from low level to high level and is continuously in n cycle periods, the sleep shutdown can be rapidly carried out.
From the above description, the dual-power switching communication device and method for the glucometer provided by the embodiment of the application use the internal button cell or the dry cell for power supply when independently collecting the blood glucose value, when the USB data line is inserted for communication, the glucometer can be automatically switched to the external power supply for power supply, the USB one-second internal start-up is realized, the plug-and-play and PC communication are realized, the process is simple and quick to operate, the USB is unplugged within one second, the USB is switched off for automatic shutdown, and meanwhile, the anti-jamming capability of the circuit is enhanced and the electrostatic breakdown is prevented.
It is noted that, in this document, relational terms are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. The terms "upper", "lower", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience in describing the present invention and simplifying the description, but do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
Unless expressly stated or limited otherwise, the terms "mounted," "connected," and "connected" are intended to be inclusive and mean, for example, that they may be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the description of the present invention, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description. Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of the present invention may be utilized alone or in combination with one or more other aspects and/or embodiments thereof.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.