IIC communication address distribution and identification circuit and method

By introducing protection units, filtering units and configuration units into the IIC communication address allocation and identification circuit, the problems of IO port security risks and insufficient number of pins in traditional methods are solved, and the security protection of microcontroller IO and multiple IIC communication addresses are realized. Identification.

CN118945142APending Publication Date: 2024-11-12SHENZHEN DADE AVIATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410999665.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

During the IIC communication process, traditional methods use multiple ordinary IO ports to allocate address security risks, and microcontrollers with small number of pins are difficult to be compatible with multiple IIC communication addresses, resulting in missing functions or damage to the equipment.

Method used

A circuit for IIC communication address allocation and identification including a protection unit, a filter unit and a configuration unit is designed. The IO port of the microcontroller is protected through the protection unit, the filter unit filters the electrical signal, and the configuration unit configures the IIC communication address according to the voltage difference to ensure the microcontroller. IO is secure and can identify multiple addresses.

Benefits of technology

It realizes that using a single input pin to identify multiple IIC communication addresses while ensuring the security of the microcontroller IO, improving the reliability and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945142A_ABST
    Figure CN118945142A_ABST
Patent Text Reader

Abstract

The invention discloses an IIC communication address distribution and identification circuit, which is formed by combining a protection unit, a filtering unit and a configuration unit, and is characterized in that the first end of the protection unit is electrically connected with a single chip microcomputer to protect the circuit, and the second end of the protection unit is used as an input pin of the single chip microcomputer; the filtering unit is electrically connected to the second end of the protection unit so as to filter an electric signal output by the protection circuit, the first end of the configuration unit is electrically connected to the second end of the protection unit, and the second end of the configuration unit is grounded so as to configure an IIC communication address, so that the IO safety of the single-chip microcomputer is ensured, and meanwhile, a single input pin is realized; therefore, a plurality of IIC communication addresses are identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of address allocation, and in particular to an IIC communication address allocation and identification circuit and method. Background Art

[0002] During the IIC communication process, when multiple address units need to be allocated, the traditional method is to use multiple ordinary IO ports to identify them by reading high and low levels. In some cases where the address allocation ports are open to the outside, there are often safety hazards. For example, the external port may input a high-voltage voltage pulse to the microcontroller, directly damaging the microcontroller's IO and causing functional loss. In order to improve its reliability, each port has to be configured with a corresponding protection circuit.

[0003] Moreover, in the process of module power supply design, multiple IIC communication addresses are set, and a single-chip microcomputer with a large number of pins is often used. However, due to the very high density of electronic components, small electronic components need to be selected. At this time, a single-chip microcomputer with a small number of pins will be selected. Therefore, it is currently difficult to have both a single-chip microcomputer with a small number of pins and the function of configuring multiple IIC communication addresses. Summary of the invention

[0004] The purpose of the present invention is to provide an IIC communication address allocation and identification circuit and method in view of the technical problems existing in the background technology.

[0005] In order to achieve the above technical objectives, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides an IIC communication address allocation and identification circuit, which is electrically connected to a single-chip microcomputer. The IIC communication address allocation and identification circuit includes a protection unit, a filtering unit, and a configuration unit. The first end of the protection unit is electrically connected to the single-chip microcomputer to protect the circuit, the second end of the protection unit is used as an input pin of the single-chip microcomputer, the filtering unit is electrically connected to the second end of the protection unit to filter the electrical signal output by the protection circuit, the first end of the configuration unit is electrically connected to the second end of the protection unit, and the second end of the configuration unit is grounded to configure the IIC communication address.

[0007] Preferably, the protection unit includes a pull-up resistor R1, a pull-down resistor R4 and a diode D1, the first end of the pull-up resistor R1 is electrically connected to the VDD of the microcontroller, the first end of the pull-down resistor R4 is connected to the ground of the microcontroller, the positive electrode of the diode D1 is electrically connected to the AD port of the microcontroller, the second end of the pull-up resistor R1 and the second end of the resistor R2, and the negative electrode of the diode D1 serves as the input pin of the microcontroller.

[0008] Preferably, the diode D1 is a diode of model IN4148.

[0009] Preferably, the filtering unit comprises a filtering capacitor C5 , a first end of the filtering capacitor C5 is electrically connected to the cathode of the diode D1 , and a second end of the filtering capacitor C5 is electrically connected to the first end of the pull-down resistor R4 .

[0010] Preferably, the configuration unit includes a configuration resistor R7, a first end of the configuration resistor R7 is electrically connected to the cathode of the diode D1, and a second end of the configuration resistor R7 is grounded, wherein the configuration resistor R7 includes different resistance values, and the configuration resistor R7 under different resistance values ​​is used to configure corresponding multiple IIC communication addresses.

[0011] Preferably, the single chip microcomputer is a N32G430 series single chip microcomputer.

[0012] In a second aspect, the present invention provides an IIC communication address allocation method, which is applied to the IIC communication address allocation and identification circuit of any one of the above schemes, and the IIC communication address allocation method comprises:

[0013] The protection unit is connected to the single-chip microcomputer to obtain voltage, wherein the second end of the protection unit is used as an input pin of the single-chip microcomputer;

[0014] Connecting the filtering unit to the protection unit to filter out high-frequency clutter in the circuit;

[0015] The single chip microcomputer detects the voltage value of the second end of the protection unit when it is disconnected and grounded, and obtains a first voltage value and a second voltage value respectively;

[0016] Calculating a difference between the first voltage value and the second voltage value, and using the difference as an addressing range;

[0017] Calculate the preset pressure difference value and the addressing range to obtain multiple IIC communication addresses;

[0018] The configuration unit is electrically connected to the second end of the protection unit to obtain an input voltage value, and the IIC communication address corresponding to the configuration unit is configured according to the input voltage value.

[0019] Compared with the prior art, the present invention has the following beneficial technical effects: the present invention is composed of a protection unit, a filtering unit and a configuration unit, the first end of the protection unit is electrically connected to a single-chip microcomputer to protect the circuit, the second end of the protection unit is used as an input pin of the single-chip microcomputer, the filtering unit is electrically connected to the second end of the protection unit to filter the electrical signal output by the protection circuit, the first end of the configuration unit is electrically connected to the second end of the protection unit, the second end of the configuration unit is grounded to configure an IIC communication address, and while ensuring the IO safety of the single-chip microcomputer, a single input pin is realized to identify multiple IIC communication addresses. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of the circuit structure of an embodiment of the first aspect of the present invention;

[0021] Figure 2 This is a workflow diagram of an embodiment of the second aspect of the present invention. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0023] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "primary", "secondary", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "primary", "secondary", and the like may explicitly or implicitly include one or more features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0024] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or a specific connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.

[0025] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0026] like Figure 1As shown, the present invention proposes an IIC communication address allocation and identification circuit in a first aspect, which is electrically connected to a single-chip microcomputer. The IIC communication address allocation and identification circuit includes a protection unit, a filtering unit and a configuration unit. The first end of the protection unit is electrically connected to the single-chip microcomputer to protect the circuit, the second end of the protection unit is used as an input pin of the single-chip microcomputer, the filtering unit is electrically connected to the second end of the protection unit to filter the electrical signal output by the protection circuit, the first end of the configuration unit is electrically connected to the second end of the protection unit, and the second end of the configuration unit is grounded to configure the IIC communication address.

[0027] Furthermore, the protection unit includes a pull-up resistor R1, a pull-down resistor R4 and a diode D1, the first end of the pull-up resistor R1 is electrically connected to the VDD of the microcontroller, the first end of the pull-down resistor R4 is connected to the ground of the microcontroller, and the positive electrode of the diode D1 is electrically connected to the AD port of the microcontroller, the second end of the pull-up resistor R1 and the second end of the resistor R2.

[0028] Furthermore, the diode D1 is a diode of model IN4148.

[0029] Furthermore, the filter unit includes a filter capacitor C5 , a first end of the filter capacitor C5 is electrically connected to the cathode of the diode D1 , and a second end of the filter capacitor C5 is electrically connected to the first end of the pull-down resistor R4 .

[0030] Furthermore, the configuration unit includes a configuration resistor R7, a first end of the configuration resistor R7 is electrically connected to the cathode of the diode D1, and a second end of the resistor is grounded, wherein the configuration resistor R7 includes different resistance values, and the configuration resistor R7 under different resistance values ​​is configured to correspond to multiple IIC communication addresses.

[0031] Furthermore, the single chip microcomputer is a N32G430 series single chip microcomputer.

[0032] Specifically, in the present embodiment, the pull-up resistor R1 is 10kΩ, the pull-down resistor R4 is 100kΩ, and the filter capacitor C5 is 0.1μF for filtering to remove high-frequency clutter. The tube voltage drop of the diode D1 is 0.6V, and the AD reference voltage of the N32G430 series microcontroller is 3.3V. The AD adopts a precision of 12 bits. When the user uses it, the output pin is suspended and short-circuited to the ground. The voltage range detected by the AD port of the microcontroller is between 0.6V and 3.0V. A certain voltage difference value can be preset in advance through the program in the microcontroller to set a corresponding IIC communication address, or a certain number of IIC communication addresses can be preset to determine the voltage difference value between each IIC communication address. For example, if 10 IIC addresses are set, the voltage difference between each IIC address is 0.24V, then the AD value difference between each address is 297, and the upper and lower hysteresis is 100, and the address recognition range is 97.

[0033] As attached Figure 2 As shown, the present invention proposes an IIC communication address allocation method in a second aspect, which is applied to the IIC communication address allocation and identification circuit of any one of the above schemes, and the IIC communication address allocation method includes:

[0034] 101. Accessing the single-chip microcomputer through the protection unit to obtain voltage, wherein the second end of the protection unit serves as an input pin of the single-chip microcomputer;

[0035] 102. Connect the filtering unit to the protection unit to filter out high-frequency clutter in the circuit;

[0036] 103. Detecting, by the single chip microcomputer, a voltage value of the second end of the protection unit when it is disconnected and grounded, to obtain a first voltage value and a second voltage value respectively;

[0037] 104. Calculate a difference between the first voltage value and the second voltage value, and use the difference as an addressing range;

[0038] 105. Calculate the preset pressure difference value and the addressing range to obtain multiple IIC communication addresses;

[0039] 106. Electrically connect the configuration unit to the second end of the protection unit to obtain an input voltage value, and configure the IIC communication address corresponding to the configuration unit according to the input voltage value.

[0040] Specifically, the configuration resistor R7 in the configuration unit is actually a resistor in the user product. In the default state, the IIC communication address allocation and identification circuit is not connected to the configuration resistor R7, and is disconnected by default, that is, the second end of the protection unit is disconnected. At this time, the resistance value of the configuration resistor R7 at this position is infinite, and the corresponding first voltage value is 90% of the VDD voltage, and the default IIC communication address is used accordingly. It should be noted that when the second end of the protection unit is grounded, the second voltage value at this time is the tube voltage drop of the diode D1 in the protection unit. The specific explanation is as above. When different products are connected, that is, configuration resistors R7 with different resistance values ​​are connected, then according to the above configuration method for the IIC communication address, the corresponding IIC communication address is assigned to the connected product, so that a single pin can give the corresponding product the corresponding IIC communication address.

[0041] Of course, in another embodiment, the voltage distribution is not limited to the external resistor R7 to the ground, but an external voltage between 0V and VDD is used to calibrate the IIC communication address. According to the number of IIC communication addresses to be used, a certain voltage difference value is specified as the calibration of the corresponding IIC communication address. For example: VDD = 3.3V, 10 IIC communication addresses are required, then the voltage difference value can be used for calibration: external 2.5V is IIC communication address 1; external 2.3V is IIC communication address 2; external 2.1V is IIC communication address 3, etc. Similarly, in actual use, it is not limited to configuring the IIC communication address, and other protocol address allocation algorithms and protocol address recognition circuits can also be used.

[0042] The above is an IIC communication address allocation and identification circuit or multiple implementations provided in combination with specific content, and it is not considered that the specific implementation of the present invention is limited to these descriptions. Any similarity or similarity with the method, structure, etc. of the present invention, or a number of technical deductions or replacements made under the premise of the concept of the present invention, should be regarded as the protection scope of the present invention.

Claims

1. An IIC communication address allocation and identification circuit, which is electrically connected to a single-chip microcomputer, characterized in that: include: A protection unit, wherein a first end of the protection unit is electrically connected to the single-chip microcomputer to protect the circuit, and a second end of the protection unit serves as an input pin of the single-chip microcomputer; A filter unit, electrically connected to the second end of the protection unit to filter the electrical signal output by the protection circuit; A configuration unit, wherein a first end of the configuration unit is electrically connected to a second end of the protection unit, and a second end of the configuration unit is grounded to configure an IIC communication address.

2. An IIC communication address allocation and identification circuit according to claim 1, characterized in that: The protection unit includes a pull-up resistor R1, a pull-down resistor R4 and a diode D1. The first end of the pull-up resistor R1 is electrically connected to the VDD of the single-chip microcomputer, the first end of the pull-down resistor R4 is connected to the ground of the single-chip microcomputer, the positive electrode of the diode D1 is electrically connected to the AD port of the single-chip microcomputer, the second end of the pull-up resistor R1 and the second end of the resistor R2, respectively, and the negative electrode of the diode D1 serves as the input pin of the single-chip microcomputer.

3. An IIC communication address allocation and identification circuit according to claim 2, characterized in that: The diode D1 is a diode of type IN4148.

4. The IIC communication address allocation and identification circuit according to claim 2, characterized in that: The filtering unit includes a filtering capacitor C5 , a first end of the filtering capacitor C5 is electrically connected to the cathode of the diode D1 , and a second end of the filtering capacitor C5 is electrically connected to the first end of the pull-down resistor R4 .

5. The IIC communication address allocation and identification circuit according to claim 2, characterized in that: The configuration unit includes a configuration resistor R7, a first end of the configuration resistor R7 is electrically connected to the cathode of the diode D1, and a second end of the configuration resistor R7 is grounded, wherein the configuration resistor R7 includes different resistance values, and the configuration resistor R7 under different resistance values ​​is configured to correspond to multiple IIC communication addresses.

6. The IIC communication address allocation and identification circuit according to claim 1, characterized in that: The single chip microcomputer is a N32G430 series single chip microcomputer.

7. A method for allocating IIC communication addresses, characterized in that: It is applied to the IIC communication address allocation and identification circuit according to any one of claims 1 to 6, and the IIC communication address allocation method includes: The protection unit is connected to the single-chip microcomputer to obtain voltage, wherein the second end of the protection unit is used as an input pin of the single-chip microcomputer; Connecting the filtering unit to the protection unit to filter out high-frequency clutter in the circuit; The single chip microcomputer detects the voltage value of the second end of the protection unit when it is disconnected and grounded, and obtains a first voltage value and a second voltage value respectively; Calculating a difference between the first voltage value and the second voltage value, and using the difference as an addressing range; Calculate the preset pressure difference value and the addressing range to obtain multiple IIC communication addresses; The configuration unit is electrically connected to the second end of the protection unit to obtain an input voltage value, and the IIC communication address corresponding to the configuration unit is configured according to the input voltage value.