CN104899177A - I2C (inter-integrated circuit) equipment control method and system - Google Patents

I2C (inter-integrated circuit) equipment control method and system Download PDF

Info

Publication number
CN104899177A
CN104899177A CN201510374359.XA CN201510374359A CN104899177A CN 104899177 A CN104899177 A CN 104899177A CN 201510374359 A CN201510374359 A CN 201510374359A CN 104899177 A CN104899177 A CN 104899177A
Authority
CN
China
Prior art keywords
equipment
address
preset
port
bus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510374359.XA
Other languages
Chinese (zh)
Other versions
CN104899177B (en
Inventor
梁玉锋
袁涛
龙元维
程维新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hai Yun New Energy Co ltd
Original Assignee
SHENZHEN GOLDWEB TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN GOLDWEB TECHNOLOGY Co Ltd filed Critical SHENZHEN GOLDWEB TECHNOLOGY Co Ltd
Priority to CN201510374359.XA priority Critical patent/CN104899177B/en
Publication of CN104899177A publication Critical patent/CN104899177A/en
Application granted granted Critical
Publication of CN104899177B publication Critical patent/CN104899177B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4265Bus transfer protocol, e.g. handshake; Synchronisation on a point to point bus
    • G06F13/4269Bus transfer protocol, e.g. handshake; Synchronisation on a point to point bus using a handshaking protocol, e.g. Centronics connection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention provides an I2C (inter-integrated circuit) equipment control method and system. Multiple I2C devices currently connected with an I2C bus are controlled to be powered on one by one; when any one of the I2C devices is powered on, preset slave addresses of the I2C devices currently powered on are accessed, and when first signals fed back from the preset slave addresses are received, the fact that the I2C devices currently powered on have the preset slave addresses and are required target I2C devices is indicated; in order to allow the system to accurately recognize the target I2C devices from the I2C devices having the same addresses, slave addresses in one-to-one correspondence are re-assigned for the target I2C devices according to preset rules, thus the multiple I2C devices connected with the I2C bus each have one unique slave address, the system is allowed to accurately recognize the required target I2C devices according to the slave addresses, and controlling the specified I2C devices and exchanging data among the specified I2C devices is achieved.

Description

A kind of I 2c apparatus control method and system
Technical field
The present invention relates generally to data communication technology field, more particularly relates to a kind of I 2c apparatus control method and system.
Background technology
I 2c (Inter-Integrated Circuit, internal integrated circuit) bus is a kind of twin wire universal serial bus developed by PHILIPS company, i.e. I 2the serial time clock line (SCL) of C and I 2serial data line (SDA) two lines of C, for connecting microcontroller and peripherals thereof, are a kind of bus standards that microelectronics Control on Communication field extensively adopts.
In actual applications, I 2usually can the multiple I of carry in C bus 2c equipment, these I 2c equipment will by this I 2c bus realizes data interaction, but, due to the I of the same type of existing manufacturer production 2c equipment identical from address, like this, works as I 2the I of the multiple same type of carry in C bus 2after C equipment, system cannot distinguish the I of these same types according to address 2c equipment, thus also just cannot realize assigned I 2the control of C equipment and assigned I 2data interaction between C equipment.
Summary of the invention
In view of this, the invention provides a kind of I 2c apparatus control method and system, by being I again 2the I of C bus carry 2c equipment distributes unique from address, makes I 2the multiple identical type i of C bus carry 2during C equipment, system also accurately can identify assigned I 2c equipment, thus realize assigned I 2the control of C equipment and assigned I 2data interaction between C equipment.
To achieve these goals, this application provides following technical scheme:
A kind of I 2c apparatus control method, described method comprises:
Control I 2multiple I of the current connection of C bus 2c equipment is energized one by one;
At described multiple I 2any one I in C equipment 2during the energising of C equipment, access described multiple I 2c equipment preset from address;
When receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address.
Preferably, described method also comprises:
Control described I 2all I in C bus 2c equipment power port energising;
When any one I being in idle condition being detected 2c equipment is powered on port and is inserted I 2during C equipment, enter the described multiple I of described access 2c equipment preset from address step.
Preferably, described method also comprises:
In the first Preset Time, at least two I being in idle condition detected 2c equipment is powered on port and is all inserted I 2during C equipment, select any one I wherein 2c equipment is in "on" position, and returns the described multiple I of described access 2c equipment preset from address step, until all I for inserting 2c equipment is all redistributed one to one from address.
Preferably, the I being in idle condition is detected 2c equipment powers on port whether insert I 2the process of C equipment is specially:
Detect power management chip and whether produce look-at-me, wherein, described look-at-me described I detected 2c equipment is powered and to be produced when the current consumption of port is greater than first threshold.
Preferably, described according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed and is specially from address one to one:
From default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment, to make described multiple I 2c equipment has one to one from address.
A kind of I 2c apparatus control system, described system comprises:
First controller, for control I 2multiple I of the current connection of C bus 2c equipment is energized one by one;
With described multiple I 2c equipment Programmable Logic Controller one to one;
I 2c controller, at described multiple I 2any one I in C equipment 2during the energising of C equipment, access this I 2c equipment Programmable Logic Controller one to one preset from address, when receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address, and send to described current have presetly be in the I of "on" position from address 2c equipment Programmable Logic Controller one to one.
Preferably,
Described first controller is also for controlling described I 2all I in C bus 2c equipment power port energising;
Then described I 2c controller is also for detecting the I being in idle condition 2c equipment powers on port whether insert I 2c equipment, when any one I being detected 2c equipment is powered on port and is inserted I 2during C equipment, enter the described multiple I of described access 2c equipment preset from address step; When in the first Preset Time, at least two I being in idle condition detected 2c equipment is powered on port and is all inserted I 2during C equipment, select any one I wherein 2c equipment is in "on" position, and returns the described multiple I of described access 2c equipment preset from address step, until all I for inserting 2c equipment is all redistributed one to one from address.
Preferably, described system also comprises:
Power management chip, for detecting described I 2c equipment is powered when the current consumption of port is greater than first threshold and is produced look-at-me;
Then described I 2c controller detects the I being in idle condition 2c equipment powers on port whether insert I 2the process of C equipment is specially: detect described power management chip and whether produce look-at-me.
Preferably, described system also comprises:
Storer, for storing default I 2c address pool, to make described I 2c controller is at described multiple I 2each I in C equipment 2during the energising of C equipment, from described default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment.
Preferably, described Programmable Logic Controller is specially single-chip microcomputer.
As can be seen here, compared with prior art, this application provides a kind of I 2c apparatus control method and device, control I 2multiple I of the current connection of C bus 2c equipment is energized one by one, at this multiple I 2any I in C equipment 2during the energising of C equipment, by accessing this multiple I 2c equipment preset from address, when receiving described preset the first signal from address feedback, illustrates the I of current energising 2c equipment has that this is preset from address, is required target I 2c equipment, has the I of identical address to enable system 2this target I is accurately identified in C equipment 2c equipment, the application is this target I according to preset rules at this moment 2c equipment is redistributed one to one from address, thus makes I 2multiple I that C bus connects 2c equipment all has unique from address, so that system is according to should accurately identify required target I from address 2c equipment, and then realize assigned I 2the control of C equipment and assigned I 2data interaction between C equipment.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
Fig. 1 is a kind of I provided by the invention 2the schematic flow sheet of C apparatus control method embodiment one;
Fig. 2 is a kind of I 2c bus work system structured flowchart;
Fig. 3 is a kind of I provided by the invention 2the part run schematic diagram of C apparatus control method embodiment two;
Fig. 4 is a kind of I provided by the invention 2the part run schematic diagram of C apparatus control method embodiment three;
Fig. 5 is a kind of I provided by the invention 2the structural representation of C plant control unit embodiment four.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
This application provides a kind of I 2c apparatus control method and device, control I 2multiple I of the current connection of C bus 2c equipment is energized one by one, at this multiple I 2any one I in C equipment 2during the energising of C equipment, by accessing this multiple I 2c equipment preset from address, when receiving described preset the first signal from address feedback, illustrates the I of current energising 2c equipment has that this is preset from address, is required target I 2c equipment, has the I of identical address to enable system 2this target I is accurately identified in C equipment 2c equipment, the application is this target I according to preset rules at this moment 2c equipment is redistributed one to one from address, thus makes I 2multiple I that C bus connects 2c equipment all has unique from address, so that system is according to should accurately identify required target I from address 2c equipment, and then realize assigned I 2the control of C equipment and assigned I 2data interaction between C equipment.
For enabling object, the feature and advantage of technique scheme provided by the invention more become apparent, below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
Embodiment one:
As shown in Figure 1, be a kind of I provided by the invention 2the schematic flow sheet of C apparatus control method embodiment one, the method can comprise the following steps:
Step S110: control I 2multiple I of the current connection of C bus 2c equipment is energized one by one.
Wherein, because I 2c bus takes up room very little, decrease the space of circuit board and the quantity of chip pin, reduce interconnected cost, be widely used in various service and management occasion, realize the functional status configuring or grasp assembly, as the parameter such as power supply, system temperature, add the security of system, facilitate management.
In the present embodiment practical application, I 2the multiple I of usual carry in C bus 2c equipment can be various sensing chips etc., but is not limited thereto.Wherein, for the I of same type 2c equipment, producer usually can be identical from address for its configuration, as 0x3D, but is not limited thereto, by the I causing system cannot distinguish these same types according to address 2c equipment.
Based on this, the present embodiment is by the I by being same type 2c equipment is redistributed and is distinguished from address, and based on this thought, the present embodiment can be each I 2c equipment arranges a Programmable Logic Controller, for setting this I 2c equipment from address, to realize I 2multiple I of carry in C bus 2the management of C equipment.
So with reference to the system chart shown in Fig. 2, it is only with I 2carry two I in C bus 2c equipment is that example is described, and works as I 2the I of C bus 2after C controller powers on, first can cut off I 2the I of C bus 2c equipment is powered port (not drawing in Fig. 2), afterwards, then switches each I in turn 2c equipment is powered port being energized, and that is, the present embodiment will be I one by one 2the I of C bus carry 2c equipment is powered, composition graphs 2, namely controls power supply On/Off by peripheral first controller (not drawing in Fig. 2), thus realizes and I 2each I of C bus carry 2c equipment is power on/off.It should be noted that, control power supply is I 2each I of C bus carry 2the process that C equipment is powered one by one and feed circuit used thereof belong to this area routine techniques means, and the present embodiment is not described in detail in this.
Step S120: at described multiple I 2any one I in C equipment 2during the energising of C equipment, access described multiple I 2c equipment preset from address.
In the present embodiment practical application, based on above-mentioned the present embodiment invention thought, as control I 2multiple I of C bus carry 2any one I in C equipment 2during the energising of C equipment, namely control this I 2the I that C equipment is corresponding 2c equipment power port energising time, the present embodiment is preset from address by accessing, and detects the current I being switched to "on" position 2whether C equipment is the I of required type 2c equipment.Wherein, this is presetly required type i from address 2the address of C equipment.
Step S130: when receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address.
Based on above-mentioned analysis, above-mentioned preset behind address in access, if this presetly has feedback first signal from address, then illustrate that this preset being from the equipment address is switched to "on" position and is the I of required type 2c equipment; Otherwise illustrate and access unsuccessfully, this is preset from address zero load or non-identifying thing etc., but is not limited thereto, so long as not the I of required type 2c equipment.
Optionally, in the present embodiment practical application, if this has presetly fed back the first signal from address, can directly from default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment, to make described multiple I 2c equipment has one to one from address, and in follow-up all communication processs, this I 2c equipment all by using receive from address as it from address, and keep I 2continuing of C bus and power supply.
Afterwards, next I will be switched 2c equipment is energized, still in the manner described above to this next I 2c equipment carry out identifying rear distribution unique from address, the like, until will with I 2multiple I of the current connection of C bus 2c equipment is all redistributed one to one from address, thus guarantees at same I 2multiple I in C bus 2c equipment all has unique from address, to realize these I 2effective management of C equipment.
Wherein, in the various embodiments described above, for each I 2the setting from address of C equipment and the reading of data and write etc. operation by with its one to one Programmable Logic Controller realize, that is, the present embodiment is obtaining each I 2c equipment unique behind address, the Programmable Logic Controller by its correspondence is arranged this I 2c equipment from address.Optionally, this Programmable Logic Controller can be the controller that single-chip microcomputer etc. can rewrite device address, is not limited to single-chip microcomputer, and the present embodiment is only described for single-chip microcomputer.
Wherein, it should be noted that, as above-mentioned I 2after C equipment is restarted, it will become above-mentioned preset from address again from address, need to redistribute it unique can continue management from address; And, to all I 2c equipment distributes and is different from that this is preset from address one to one from address, that is, and above-mentioned default I 2this is not comprised preset from address (as above-mentioned 0x3D) in C address pool.
In sum, the present embodiment is at I 2multiple I of the current connection of C bus 2in the process that C equipment is energized one by one, by being switched to "on" position to current and be each I of required type 2c equipment is redistributed unique from address, makes system can according to distinguishing these from address from equipment (i.e. I 2c equipment), thus solve the I because of identical type in prior art 2c equipment has identical preset from address, causes same I 2c bus can not there is simultaneously the I of multiple identical type 2c equipment is in the technical matters from pattern, achieves same I 2multiple I in C bus 2the unified management of C equipment, can realize assigned I 2the control of C equipment and assigned I 2data interaction between C equipment.
Embodiment two:
On the basis of above-described embodiment one, the I that the application proposes 2c apparatus control method can also comprise the part run schematic diagram shown in Fig. 3, specifically can comprise the following steps:
Step S310: control described I 2all I in C bus 2c equipment power port energising.
In the present embodiment practical application, when the controller in Fig. 2 powers on poll I 2after C equipment completes, be I 2all I in C bus 2c equipment is all redistributed unique behind the address, can by now I 2in C bus, other do not connect I 2the I of C equipment 2c equipment power port energising, even if this I 2all I in C bus 2c equipment is powered port energising, so that detect in time the I inserted 2c equipment.
Step S320: when any one I being in idle condition being detected 2c equipment is powered on port and is inserted I 2during C equipment, access preset from address.
Optionally, at I 2in the C bus course of work, when there being I 2when C equipment inserts, I will inevitably be caused 2c equipment is powered the curent change of port, to be produced by triggering voltage managing chip interrupt when current consumption reaches first threshold, and then I in triggering graph 2 2c controller detects should I 2c equipment is powered the I of port 2c equipment, namely to this I 2c equipment carries out identifying and distributes unique from address.Wherein, first threshold is the threshold value of power management chip inside, and the present invention does not limit its concrete numerical value, can determine according to the concrete model of this power management chip.
As can be seen here, whether the present embodiment produces look-at-me by detecting power management chip, judges the I being in idle condition 2c equipment is powered port (i.e. this I 2c equipment port of powering does not connect I 2c equipment) on whether insert I 2c equipment, wherein, this look-at-me is then I detected 2c equipment is powered and to be produced when the current consumption of port is greater than first threshold.
Wherein, in the above-described embodiments, in order to ensure the object inserted and detect can be reached, need at I 2what C equipment inserted maintains in a flash certain current drain, thus avoids because of certain some resistance or the less I of impedance 2c equipment insert time to current drain less and cannot triggering voltage managing chip produce interrupt, so, this enforcements by insertion I 2c equipment mounts the consumption-type loads such as resistance, but is not limited to this consumption ways of resistance.
Optionally, in order to reduce power consumption, when system is to the I inserted 2c recognition of devices is also distributed one to one from address, after entering proper communication logic, the consumption-type loads such as this resistance can be turned off, specifically can pass through consumption-type load short circuits such as resistance, but be not limited thereto.
Step S330: when receiving described preset the first signal from address feedback is the I inserted according to preset rules 2c equipment is redistributed one to one from address.
Known based on above-mentioned analysis, the present embodiment achieves I 2the detection of dynamic of C equipment, solves because of existing I 2c agreement itself is not supported to interrupt detecting, and makes I 2c equipment cannot support the technical matters of hot plug, thus makes I provided by the invention 2the range of application of C apparatus control method is wider, and it is convenient more flexibly to operate.
Embodiment three:
On the basis of above-described embodiment one, as the I of idle condition 2c equipment is powered on port and is inserted multiple I 2during C equipment, part run schematic diagram as shown in Figure 4, this I 2c apparatus control method can also comprise the following steps:
Step S410: control described I 2all I in C bus 2c equipment power port energising.
Step S420: in the first Preset Time, detects at least two I being in idle condition 2c equipment is powered on port and is all inserted I 2during C equipment, select any one I wherein 2c equipment is in "on" position, and accesses preset from address.
Step S430: when receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address, until all I for inserting 2c equipment is all redistributed one to one from address.
In actual applications, if at I 2in the C bus course of work, insert at least two I 2c equipment, the present embodiment only to insert two I in the first Preset Time 2c equipment is that example is described, and wherein, this first Preset Time is less than the I that system identification is inserted 2c equipment also distributes uniquely from the time of address for it, that is, and these two I 2it is extremely short that C equipment inserts the time interval, can think to insert simultaneously, now, and I 2c bus has the identical preset I from address by there will be again two 2c equipment, so, in order to realize these I 2the unified management of C equipment, the present embodiment will according to above-described embodiment one supplying method to these two I 2c equipment carries out one by one identifying and distributes unique from address.
Based on this, the present embodiment can first from two I inserted 2select one in C equipment and identify object, and record another I 2the insertion event of C equipment, simultaneously by another recorded I 2the power supply of C equipment is cut off, and guarantees to the smooth identification of selected identification object with from address assignment, when to this I 2c equipment distributes number unique behind address, then gives another I of record 2c equipment is powered, and completes this another I 2the identification of C equipment and the distribution from address, the concrete description identifying and can refer to above-described embodiment corresponding part from address allocation procedure, the present embodiment is not described in detail in this.
As can be seen here, at I 2the I of C bus and connection thereof 2in C equipment normal course of communications, no matter insert several I 2c equipment, system can both detect in time and realize insertion I 2the identification of C equipment and unique distribution from address, thus this system is realized I 2c bus is as all I of front mount 2the same management of C equipment.
Optionally, in the various embodiments described above, be I 2c bus is as all I of front mount 2c equipment distributes unique after address, can also utilize each I 2the Programmable Logic Controller of C equipment reads its corresponding I 2the address information of C equipment and device type, so that based on this address information and device type to I 2c equipment carries out Classification Management.
Wherein, if this Programmable Logic Controller is single-chip microcomputer, be I 2c equipment distribute unique can be length from address be 12 character string, device type also can be length be 8 character string, but to be not limited thereto.
In addition, the system chart shown in composition graphs 2, controller and each I 2communication between C equipment needs keep alive signal to maintain line states usually, if all receive I p.s. 2the signal of C equipment feedback, then do not need to send keep alive signal, otherwise, p.s. will be needed and send a keep alive signal, if do not receive I 2the signal of C equipment feedback, then illustrate this I 2c equipment off-line or fault cause without response, and now, exportable corresponding information, points out staff to this I 2c equipment checks, but is not limited thereto.
Embodiment four:
As shown in Figure 5, be a kind of I provided by the invention 2the structural representation of C apparatus control system, this system can comprise: the first controller 510, Programmable Logic Controller 520 and I 2c controller 520, wherein:
First controller 510, for control I 2multiple I of the current connection of C bus 2c equipment is energized one by one, so that the follow-up I to being switched to "on" position 2c equipment carries out identifying and from the distribution of address.
Optionally, this first controller 510 can be specifically CPU (Central Processing Unit, central processing unit), but is not limited thereto.In actual applications, the first controller can control each I 2c equipment is powered the "on" position of port, thus controls and this I 2c equipment power port connect I 2the electric power thus supplied of C equipment, i.e. each I in control chart 2 2the corresponding supplying channels On/Off of C equipment.
Wherein, this I 2c equipment can be the sensing chip with some flexible configuration functions, or other adopt I 2c bus carries out the equipment of data interaction, and the application does not do concrete restriction to it.
Programmable Logic Controller 520 and above-mentioned multiple I 2c equipment one_to_one corresponding, for arranging this I 2c equipment from address, this I 2the dynamic maintenance of C devices communicating, reads this I 2the address information and device type etc. of C equipment.
Optionally, this Programmable Logic Controller 520 can be specifically single-chip microcomputer, but is not limited thereto, and the present embodiment is only described for single-chip microcomputer, then as follows at the concrete function in the present embodiment practical application.
I 2c controller 530, at described multiple I 2each I in C equipment 2during the energising of C equipment, access this I 2c equipment Programmable Logic Controller 520 one to one preset from address, when receiving described preset the first signal from address feedback, is currently have this and be presetly in the I of "on" position from address according to preset rules 2c equipment is redistributed one to one from address, and sends it to Programmable Logic Controller 520 one to one.
In actual applications, this I 2c controller 530 can be specifically current various high-performance processors on the market, as ARM single-chip microcomputer etc., but is not limited thereto.And, as shown in Figure 2, at I 2in C bus, this I 2usually various I is provided with in C controller 530 2c bus interface, as above-mentioned I 2c equipment is powered port, FPDP, clock port etc.
Optionally, in the present embodiment practical application, at I 2the I of C bus and carry thereof 2in C equipment normal course of communications, may need according to actual needs to insert I again 2c equipment, so, complete I 2the I of carry in C bus 2c equipment after address assignment, the first controller 510 can control I 2all I in C bus 2c equipment is powered port energising, and by I 2c controller 530 detects the I being in spatiality in real time 2c equipment powers on port whether insert I 2c equipment, when any one I being detected 2c equipment is powered on port and is inserted I 2during C equipment, the I that can record according to above-described embodiment 2c recognition of devices and from address distribution method is the I inserted 2c equipment distributes unique from address; When in the first Preset Time, at least two I being in idle condition detected 2c equipment is powered on port and is all inserted I 2during C equipment, that is, the I inserted 2the insertion time interval between C equipment, the mode can recorded according to above-described embodiment one was at least two I inserted very in short-term 2c equipment carries out identifying and from address assignment, thus makes these I 2c equipment obtains unique from address, facilitates system to carry out unified management to it.
As can be seen here, the present embodiment solves I 2c protocol bus is not supported to interrupt detecting, and causes I 2c equipment does not support the technical matters of hot plug, expands this systematic difference scope, and is convenient to continue expansion, achieves I 2the detection of dynamic of C equipment, and for the I of insertion being detected 2c equipment distributes unique from address in time, thus realizes I 2c bus is as all I of front mount 2the unified management of C equipment.
As another embodiment of the present invention, on the basis of above-described embodiment, this I 2c apparatus control system can also comprise:
Power management chip, for detecting described I 2c equipment is powered when the current consumption of port is greater than first threshold and is produced look-at-me, to make I 2whether C controller 530 produces look-at-me by detecting power management chip, detects the I being in idle condition 2c equipment powers on port whether insert I 2c equipment.
Wherein, in order to reach the object inserted and detect, the application can also at each I 2c equipment mounts the consumption-type loads such as resistance, for inserting this I 2c equipment maintain in a flash certain current drain, thus guarantee insertion this I 2look-at-me can be produced by triggering voltage managing chip during C equipment.
It should be noted that, for I 2the consumption-type load of C equipment mounting is not limited to resistance, and be merely able to reach the object of above-mentioned moment current sinking, this enforcement is described in detail no longer one by one at this.
Optionally, in order to reduce power consumption, complete the I to inserting 2the identification of C equipment and after address assignment, can turn off this consumption-type load, specifically by this consumption-type load short circuits, but can be not limited thereto.
In addition, on the basis of above-described embodiment, this control system can also comprise:
Storer, for storing default I 2c address pool, to make I 2c controller 530 is at described multiple I 2each I in C equipment 2during the energising of C equipment, from described default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment.
Wherein, it should be noted that, above-mentioned default I 2c address pool also can be pre-stored in I 2in C controller, or each I 2in the Programmable Logic Controller that C equipment is corresponding, the present invention does not do concrete restriction to this, pays that creative work determines so long as not those skilled in the art, all belongs to scope.
In conjunction with above-mentioned analysis, when being each I 2when the Programmable Logic Controller 520 that C equipment is arranged is single-chip microcomputers, can by the VCC of single-chip microcomputer (power lead), GND (ground wire), SDA (serial data line) and SCK (serial time clock line) pin and I 2the corresponding pin of C controller 530 is connected, and preset from address 0x3D (this preset be not limited thereto from address, can change according to actual needs) by single-chip microcomputer, and this single-chip microcomputer register address can as shown in Table 1, but be not limited thereto.
Table one single-chip microcomputer register address
In above-mentioned table one, Upgrade red can upgrade the firmware program of single-chip microcomputer; Whether Handshake reg can be used for identifying whether being the equipment defined herein, be namely have the preset I from address 2c equipment; Dprofile reg is used for reading I 2the address information of C equipment and device type; Dread reg can be used for read response data; Dwrite reg can be used for write request data; Ack reg may be used for the dynamic maintenance communicated; Slave_addr reg can be used for arranging from address.
Based on the structure of above-mentioned single-chip microcomputer, work as I 2c controller has detected I 2when C equipment inserts, can first write Handshake reg, identify the I of insertion 2whether C equipment is define equipment (the i.e. I of required type 2c equipment), if (be above-mentioned receive preset from address feedback the first signal), write Slave_addr reg, from preset address pond, select any one address as this I 2c equipment unique from address, afterwards, write Dprofile reg, parse this I 2the current address information of C equipment and device type, carry out Classification Management so that follow-up to it.
Wherein, can be length be the address in preset address pond 12 character string, that is, distribute to each I 2what C equipment was unique can be the character string of 12 for length from address, and this I 2the device type of C equipment can be the string representation of 8 by length, but is not limited thereto, and those skilled in the art can rationally change gained technical scheme based on keynote idea of the present invention and all belong to scope.
In sum, in the present embodiment, at the first controller control I 2multiple I of the current connection of C bus 2c equipment is energized one by one, and at this multiple I 2any one I in C equipment 2during the energising of C equipment, I 2c controller is by this multiple I of access 2c equipment preset from address, when receiving described preset the first signal from address feedback, illustrates the I of current energising 2c equipment is required define equipment, and the application is unique from address by redistributing for it, thus the I made 2c bus is as all I of front mount 2c equipment all has unique from address, reaches same I 2the I of carry multiple identical type while of C bus 2the object of C equipment work, achieves these I 2the unified management of C equipment, can to assigned I 2the control of C equipment also realizes assigned I 2data interaction between C equipment.
In addition, it should be noted that, about in the various embodiments described above, the such as relational terms of first, second grade and so on is only used for an operation or device and another operates or device region separates, and not necessarily requires or imply the relation or order that there is any this reality between these devices or operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method or system and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method or system.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method or the system comprising described key element and also there is other identical element.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For system disclosed in embodiment, because it is corresponding with method disclosed in embodiment, so description is fairly simple, relevant part illustrates see method part.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (10)

1. an I 2c apparatus control method, is characterized in that, described method comprises:
Control I 2multiple I of the current connection of C bus 2c equipment is energized one by one;
At described multiple I 2any one I in C equipment 2during the energising of C equipment, access described multiple I 2c equipment preset from address;
When receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address.
2. method according to claim 1, is characterized in that, described method also comprises:
Control described I 2all I in C bus 2c equipment power port energising;
When any one I being in idle condition being detected 2c equipment is powered on port and is inserted I 2during C equipment, enter the described multiple I of described access 2c equipment preset from address step.
3. method according to claim 2, is characterized in that, described method also comprises:
In the first Preset Time, at least two I being in idle condition detected 2c equipment is powered on port and is all inserted I 2during C equipment, select any one I wherein 2c equipment is in "on" position, and returns the described multiple I of described access 2c equipment preset from address step, until all I for inserting 2c equipment is all redistributed one to one from address.
4. method according to claim 3, is characterized in that, detects the I being in idle condition 2c equipment powers on port whether insert I 2the process of C equipment is specially:
Detect power management chip and whether produce look-at-me, wherein, described look-at-me described I detected 2c equipment is powered and to be produced when the current consumption of port is greater than first threshold.
5. method according to claim 1, is characterized in that, described according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed and is specially from address one to one:
From default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment, to make described multiple I 2c equipment has one to one from address.
6. an I 2c apparatus control system, is characterized in that, described system comprises:
First controller, for control I 2multiple I of the current connection of C bus 2c equipment is energized one by one;
With described multiple I 2c equipment Programmable Logic Controller one to one;
I 2c controller, at described multiple I 2any one I in C equipment 2during the energising of C equipment, access this I 2c equipment Programmable Logic Controller one to one preset from address, when receiving described preset the first signal from address feedback, according to preset rules be current have presetly be in the I of "on" position from address 2c equipment is redistributed one to one from address, and send to described current have presetly be in the I of "on" position from address 2c equipment Programmable Logic Controller one to one.
7. system according to claim 6, is characterized in that,
Described first controller is also for controlling described I 2all I in C bus 2c equipment power port energising;
Then described I 2c controller is also for detecting the I being in idle condition 2c equipment powers on port whether insert I 2c equipment, when any one I being detected 2c equipment is powered on port and is inserted I 2during C equipment, enter the described multiple I of described access 2c equipment preset from address step; When in the first Preset Time, at least two I being in idle condition detected 2c equipment is powered on port and is all inserted I 2during C equipment, select any one I wherein 2c equipment is in "on" position, and returns the described multiple I of described access 2c equipment preset from address step, until all I for inserting 2c equipment is all redistributed one to one from address.
8. method according to claim 7, is characterized in that, described system also comprises:
Power management chip, for detecting described I 2c equipment is powered when the current consumption of port is greater than first threshold and is produced look-at-me;
Then described I 2c controller detects the I being in idle condition 2c equipment powers on port whether insert I 2the process of C equipment is specially: detect described power management chip and whether produce look-at-me.
9. system according to claim 6, is characterized in that, described system also comprises:
Storer, for storing default I 2c address pool, to make described I 2c controller is at described multiple I 2any one I in C equipment 2during the energising of C equipment, from described default I 2select arbitrarily in C address pool an address as be sent to from address current have presetly be in the I of "on" position from address 2c equipment.
10. the system according to claim 6-9 any one, is characterized in that, described Programmable Logic Controller is specially single-chip microcomputer.
CN201510374359.XA 2015-06-30 2015-06-30 A kind of I2C apparatus control methods and system Expired - Fee Related CN104899177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510374359.XA CN104899177B (en) 2015-06-30 2015-06-30 A kind of I2C apparatus control methods and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510374359.XA CN104899177B (en) 2015-06-30 2015-06-30 A kind of I2C apparatus control methods and system

Publications (2)

Publication Number Publication Date
CN104899177A true CN104899177A (en) 2015-09-09
CN104899177B CN104899177B (en) 2018-03-16

Family

ID=54031848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510374359.XA Expired - Fee Related CN104899177B (en) 2015-06-30 2015-06-30 A kind of I2C apparatus control methods and system

Country Status (1)

Country Link
CN (1) CN104899177B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106828161A (en) * 2017-02-13 2017-06-13 清华大学 One kind is applied to multichannel charging socket charging equipment of electric automobile and its control method
CN107273328A (en) * 2017-08-02 2017-10-20 郑州云海信息技术有限公司 A kind of interface managerial method and system
CN109684264A (en) * 2018-12-27 2019-04-26 上海剑桥科技股份有限公司 IIC exchange system and its control method
CN111221765A (en) * 2019-12-31 2020-06-02 苏州浪潮智能科技有限公司 Communication method and communication system for preventing I2C bus address conflict
CN114756500A (en) * 2021-07-28 2022-07-15 义明科技股份有限公司 Master-slave system and sub-integrated circuit thereof

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783045A (en) * 2004-12-04 2006-06-07 鸿富锦精密工业(深圳)有限公司 System and method for dynamically distributing device address on integrated circuit bus
CN1783050A (en) * 2004-12-04 2006-06-07 鸿富锦精密工业(深圳)有限公司 System and method for dynamically distributing I2C address
CN102012885A (en) * 2010-09-15 2011-04-13 开源集成电路(苏州)有限公司 System and method for realizing communication by adopting dynamic I2C bus
CN102339267A (en) * 2010-06-04 2012-02-01 英特赛尔美国股份有限公司 I2C address translation
US20130275647A1 (en) * 2012-01-12 2013-10-17 Christopher N. Bradley Pcie smbus slave address self-selection
CN103412838A (en) * 2013-07-26 2013-11-27 华为技术有限公司 Expansion system, communication method, address configuration method, equipment and device
TW201435596A (en) * 2013-03-14 2014-09-16 Linear Techn Inc Address translation in I2C data communications system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783045A (en) * 2004-12-04 2006-06-07 鸿富锦精密工业(深圳)有限公司 System and method for dynamically distributing device address on integrated circuit bus
CN1783050A (en) * 2004-12-04 2006-06-07 鸿富锦精密工业(深圳)有限公司 System and method for dynamically distributing I2C address
CN102339267A (en) * 2010-06-04 2012-02-01 英特赛尔美国股份有限公司 I2C address translation
CN102012885A (en) * 2010-09-15 2011-04-13 开源集成电路(苏州)有限公司 System and method for realizing communication by adopting dynamic I2C bus
US20130275647A1 (en) * 2012-01-12 2013-10-17 Christopher N. Bradley Pcie smbus slave address self-selection
TW201435596A (en) * 2013-03-14 2014-09-16 Linear Techn Inc Address translation in I2C data communications system
CN103412838A (en) * 2013-07-26 2013-11-27 华为技术有限公司 Expansion system, communication method, address configuration method, equipment and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106828161A (en) * 2017-02-13 2017-06-13 清华大学 One kind is applied to multichannel charging socket charging equipment of electric automobile and its control method
CN106828161B (en) * 2017-02-13 2019-03-26 清华大学 One kind being applied to multichannel charging jack charging equipment of electric automobile and its control method
CN107273328A (en) * 2017-08-02 2017-10-20 郑州云海信息技术有限公司 A kind of interface managerial method and system
CN107273328B (en) * 2017-08-02 2020-03-31 郑州云海信息技术有限公司 Interface management method and system
CN109684264A (en) * 2018-12-27 2019-04-26 上海剑桥科技股份有限公司 IIC exchange system and its control method
CN111221765A (en) * 2019-12-31 2020-06-02 苏州浪潮智能科技有限公司 Communication method and communication system for preventing I2C bus address conflict
CN114756500A (en) * 2021-07-28 2022-07-15 义明科技股份有限公司 Master-slave system and sub-integrated circuit thereof

Also Published As

Publication number Publication date
CN104899177B (en) 2018-03-16

Similar Documents

Publication Publication Date Title
US7117272B2 (en) Interchangeable power over Ethernet module
CN108459827B (en) Storage device supporting multiple communication types and operation method thereof
CN104899177A (en) I2C (inter-integrated circuit) equipment control method and system
CN105302755B (en) A kind of PCIE boards and its monitoring method with monitoring function
US8700814B2 (en) Intelligent bus address self-configuration in a multi-module system
EP2688258B1 (en) Single board communication method, system and single board
JPS63231560A (en) Data processing system
EP2388960A1 (en) Intelligent bus address self-configuration in a multi-module system
CN104111886A (en) Management system compatible with different GPUs and design method thereof
CN210925482U (en) Storage device based on Loongson processor
CN111209241A (en) Management system of whole cabinet server
CN105323328A (en) Automatic address identification method by utilizing MODBUS communication protocol on RS-485
CN101765850A (en) Memory card control device and method for controlling the same
US9507744B2 (en) Handling two SGPIO channels using single SGPIO decoder on a backplane controller
CN110619914A (en) Mass production method for solid state disk with PCIe interface mass production device
CN106371876B (en) Method and system for upgrading external program of product
CN103412838B (en) A kind of expanding system, communication means, address configuration method, equipment and device
CN115167629A (en) Double-circuit server CPU mainboard
CN105896215B (en) Bay section hub
US20080222404A1 (en) In-system programming system and method for motherboard
WO2010049310A1 (en) Usb device able to automatically adapt to usb capability of a connected host
CN102393791B (en) Device and method for realizing power supply control on hardware modules
US10810150B1 (en) Configuration of a solid-state drive dock having local and network interfaces
CN108984447B (en) Control method of electronic equipment and electronic equipment
KR100358142B1 (en) Power controlling system for bus connected computer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 518000 Nanshan Medical Instrument Industrial Park 1019, Nanhai Road, Nanshan District, Shenzhen, Guangdong, A211-A213

Patentee after: Shenzhen Hai Yun new energy Co.,Ltd.

Address before: 518000 Nanshan Medical Instrument Industrial Park 1019, Nanhai Road, Nanshan District, Shenzhen, Guangdong, A211-A213

Patentee before: SHENZHEN LANDING TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180316

CF01 Termination of patent right due to non-payment of annual fee