Disclosure of Invention
(One) solving the technical problems
Aiming at the defects existing in the prior art, the invention provides a method and a system for identifying the free replacement of a module, which can effectively overcome the defects existing in the prior art that the plug-and-play and automatic identification cannot be realized.
(II) technical scheme
In order to achieve the above purpose, the invention is realized by the following technical scheme:
The identification method for the free replacement of the module comprises the following steps:
S1, providing a connecting seat and a plurality of electronic function modules, when the connecting seat is connected with the electronic function modules, a power supply module circuit supplies power to the electronic function modules, and starting the identity recognition of the electronic function modules;
s2, the connection base judges the type of the electronic function module according to the identity identification information output by the identity identification;
And S3, determining a specific interaction mode with the electronic function module by the connection seat according to the identified type.
Preferably, the identification information in S2 is a combined identification information including at least two groups.
Preferably, the connection base in S3 opens an interaction module corresponding to the electronic function module according to the identified electronic function module.
Preferably, the specific interaction mode in S3 may be freely switched to an analog signal interaction mode, a digital signal interaction mode or other types of signal interaction modes according to different modules.
A module free replacement identification system comprises a connecting seat and a plurality of electronic function modules, and also comprises an identification for identifying the type of the electronic function module when the connecting seat is connected with the electronic function modules, and a controller for switching different specific interaction modules according to the identified module.
Preferably, the connection base further includes a plurality of universal interfaces for connecting with the electronic functional modules, which may be a socket structure.
Preferably, the connection base further comprises a transceiving transmission interface of the serial connection base.
Preferably, the power supply system further comprises a power supply module circuit, the power supply module circuit supplies power for identity recognition, the identity recognition is an ID recognition voltage division circuit, one path of the ID recognition voltage division circuit comprises a node ID1, the other path of the ID recognition voltage division circuit comprises a node ID2, and the interface on the connecting seat determines and outputs different interaction modes according to the voltages at the node ID1 and the node ID 2.
Preferably, the ID recognition voltage dividing circuit is provided with two paths, one path of ID recognition voltage dividing circuit comprises serially connected Rt1 and Rt2, one end of Rt1 is connected with the end of VOUT, one end of Rt2 is connected with GND, two ends of Rt2 are connected with CT1 in parallel, a node ID1 is arranged between Rt1 and Rt2, the other path of ID recognition voltage dividing circuit comprises serially connected Rt3 and Rt4, one end of Rt3 is connected with the end of VOUT, one end of Rt4 is connected with the end of GND, two ends of Rt4 are connected with CT2 in parallel, and a node ID2 is arranged between Rt3 and Rt 4.
Preferably, the connecting seat is provided with a magnetic connection interface and an electronic function module to realize electric connection, the ID voltage dividing circuit is connected with the controller, the ID voltage dividing circuit identifies the type of the peripheral electronic function module and outputs the type of the peripheral electronic function module to the controller, and the controller switches different interaction modes to work according to the identified type of the electronic function module.
(III) beneficial effects
Compared with the prior art, the method and the system for identifying the free replacement of the module have the following beneficial effects:
1) The magnetic attraction structure can be connected with the connecting seats PL1, PL2, PL3, PL4, PL5 and PL6, and can be connected with the universal module interface circuit through the plug-in terminal, so that the electronic function module can be replaced conveniently;
2) The electronic function module can be directly identified by means of the ID identification voltage division circuit, and identification and initialization can be automatically carried out, manual configuration is not needed, and the use of a user is greatly facilitated;
3) The pins of the controller are saved, so that the controller is multipurpose.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The identification method for the free replacement of the module comprises the following steps:
S1, providing a connecting seat and a plurality of electronic function modules, when the connecting seat is connected with the electronic function modules, a power supply module circuit supplies power to the electronic function modules, and starting the identity recognition of the electronic function modules;
s2, the connection base judges the type of the electronic function module according to the identity identification information output by the identity identification;
And S3, determining a specific interaction mode with the electronic function module by the connection seat according to the identified type.
The identification information in S2 is a combined identification information including at least two groups.
And S3, starting an interaction module corresponding to the electronic function module by the connection seat according to the identified electronic function module.
The specific interaction mode in S3 can be freely switched into an analog signal interaction mode, a digital signal interaction mode or other types of signal interaction modes according to different modules.
A module free replacement identification system, as shown in fig. 1 to 6, comprises a connecting seat and a plurality of electronic function modules, and also comprises an identification for identifying the type of the electronic function module when the connecting seat is connected with the electronic function modules, and a controller for switching different specific interaction modules according to the identified module.
The connecting seat also comprises a plurality of universal interfaces for connecting the electronic functional modules, and the universal interfaces can be a row plug structure.
The connecting seat also comprises a receiving and transmitting interface of the serial connecting seat.
The power supply module circuit is used for supplying power for the identity recognition, the identity recognition is an ID recognition voltage division circuit, one path of ID recognition voltage division circuit comprises a node ID1, the other path of ID recognition voltage division circuit comprises a node ID2, and the interface on the connecting seat determines and outputs different interaction modes according to the voltages at the node ID1 and the node ID 2.
The ID recognition voltage dividing circuit is provided with two paths, one path of ID recognition voltage dividing circuit comprises serially connected Rt1 and Rt2, one end of Rt1 is connected with the VOUT end, one end of Rt2 is connected with GND, two ends of Rt2 are parallelly connected with CT1, a node ID1 is arranged between Rt1 and Rt2, the other path of ID recognition voltage dividing circuit comprises serially connected Rt3 and Rt4, one end of Rt3 is connected with the VOUT end, one end of Rt4 is connected with GND, two ends of Rt4 are parallelly connected with CT2, and a node ID2 is arranged between Rt3 and Rt 4.
The connecting seat is provided with a magnetic connection interface and an electronic functional module to realize electric connection, the ID voltage division circuit is connected with the controller, the ID voltage division circuit identifies the type of the peripheral electronic functional module and outputs the type of the peripheral electronic functional module to the controller, and the controller switches different interaction modes to work according to the identified type of the electronic functional module.
The power supply module circuit comprises UM1, the VIN end of UM1 is connected with a 5V power supply, the VIN end of UM1 is connected with GND through Cp1 and Dp, the VOUT end of UM1 outputs 3.3V, the VOUT end of UM1 is connected with GND through Cu1, UM1 is AP2201, cp1 is 4.7 mu F, and Cu1 is 1 mu F.
Interfaces PL1, PL2, PL3, PL4, PL5 and PL6 are arranged on the connecting seat, PL1 is connected with a controller 10 pin and a node ID1, PL2 is connected with a controller 11 pin and a node ID2, PL3 is connected with a controller 19 pin, PL4 is connected with a controller 35 pin, PL3 and PL4 output signals of different modes according to voltages at the node ID1 and the node ID2, PL5 is connected with GND, PL6 is connected with a 5V power supply, PL5 is connected with PL6 through CL1, and CL1 is 1 mu F.
Interface protection circuits are arranged on the connecting seat interfaces PL1, PL2, PL3 and PL4, PL1 is connected with GND through Dp2 and CP1, PL2 is connected with GND through Dp3 and CP2, PL3 is connected with GND through Dp4, PL4 is connected with GND through Dp1, CP1 and CP2 are 1nF, and the connecting seat interfaces PL1, PL2, PL3, PL4 and Dp are composed of voltage stabilizing diodes which are connected in reverse series, and the connecting seat interfaces PL1, PL2, PL3, PL4, PL5 and PL6 are connected with the electronic function module through a magnetic attraction structure.
The universal module interface circuit comprises a terminal strip Header 5 multiplied by 2, a terminal strip 7 pin is connected with the VOUT end, a terminal strip 3 pin is connected with a controller 15 pin, a terminal strip 4 pin is connected with a controller 14 pin, a terminal strip 5 pin is connected with a controller 18 pin, a terminal strip 6 pin is connected with a controller 45 pin, and the terminal strip Header 5 multiplied by 2 in the universal module interface circuit is connected with an electronic function module through a plug terminal.
The controller is STM32F030C8T6, and the 30 feet, the 12 feet, the 31 feet and the 13 feet of the controller are used for left and right connection signal transmission.
In the ID identification voltage division circuit, different voltages can be separated through different resistors of Rt1 and Rt2, and the voltages are output to an analog signal interface 10 pin of the controller through a node ID 1; similarly, different voltages are separated through different resistors of Rt3 and Rt4, the voltages are output to an analog signal interface 11 pin of the controller through a node ID2, and the controller identifies an accessed electronic function module through a group of unique voltages of the node ID1 and the node ID 2.
And the connecting seats PL3 and PL4, and the terminal power strip 5 pins and 6 pins output signals of different modes, such as IO signals, I2C signals, ADC signals and the like, according to the voltages at the nodes ID1 and ID 2.
The electronic function module is adsorbed on the connecting seat, the connecting seat supplies working voltage of 5V to the electronic function module, 3.3V voltage is output to the ID recognition voltage dividing circuit through the power supply module circuit, an ID voltage dividing voltage value is generated, different electronic function modules are recognized through detecting the ID voltage dividing voltage value by the controller, and the controller calls a control program corresponding to the different electronic function modules to control the data receiving and transmitting of the electronic function modules.
Fig. 7 is a typical circuit diagram of a key module, where connection base PL4 and pin 6 of the terminal strip can output an IO signal through SIG2 to control the key module.
The identification method and system for the free replacement of the module provided by the invention have the following beneficial effects:
1) The magnetic attraction structure can be connected with the connecting seats PL1, PL2, PL3, PL4, PL5 and PL6, and can be connected with the universal module interface circuit through the plug-in terminal, so that the electronic function module can be replaced conveniently;
2) The electronic function module can be directly identified by means of the ID identification voltage division circuit, and identification and initialization can be automatically carried out, manual configuration is not needed, and the use of a user is greatly facilitated;
3) The pins of the controller are saved, so that the controller is multipurpose.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.