CN102023954B - Device with multiple I2C buses, processor, system main board and industrial controlled computer - Google Patents

Device with multiple I2C buses, processor, system main board and industrial controlled computer Download PDF

Info

Publication number
CN102023954B
CN102023954B CN2009101904619A CN200910190461A CN102023954B CN 102023954 B CN102023954 B CN 102023954B CN 2009101904619 A CN2009101904619 A CN 2009101904619A CN 200910190461 A CN200910190461 A CN 200910190461A CN 102023954 B CN102023954 B CN 102023954B
Authority
CN
China
Prior art keywords
bus
processor
bus controller
register
pld
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.)
Active
Application number
CN2009101904619A
Other languages
Chinese (zh)
Other versions
CN102023954A (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.)
Guangdong Industrial Edge Intelligent Innovation Center Co ltd
Original Assignee
EVOC Intelligent 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 EVOC Intelligent Technology Co Ltd filed Critical EVOC Intelligent Technology Co Ltd
Priority to CN2009101904619A priority Critical patent/CN102023954B/en
Publication of CN102023954A publication Critical patent/CN102023954A/en
Application granted granted Critical
Publication of CN102023954B publication Critical patent/CN102023954B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)
  • Multi Processors (AREA)

Abstract

The invention relates to a device with multiple I2C (Inter-Integrated Circuit) buses, a processor, a system main board and an industrial controlled computer. The device with multiple I2C buses comprises a programmable logic device. The programmable logic device comprises a plurality of I2C bus controllers and a processor interface module, wherein each I2C bus controller has a master work module and a slave work mode, and each I2C bus controller is matched with a register set. The I2C buses of the processor are expanded by the programmable logic device, so that the processor can have a plurality of I2C bus channels. Multiple different units can be hung on each I2C bus, and the units can be master units as well as slave units to meet the requirements of certain specific application occasions, particularly monitoring systems. In the programmable logic device, each I2C bus controller only uses four registers, and therefore, the control complexity is largely reduced, the system can run stably runs and achieve high execution efficiency.

Description

Device, processor, system board and industrial computer with multipath I 2 C bus
Technical field
The present invention relates to processor, more particularly, relate to a kind of device, processor, system board and industrial computer with multipath I 2 C bus.
Background technology
The I2C bus is the two-wire system bus that connects between the IC device of being used for by Philips company exploitation; Two-way, two lines, serial, many master controls (multi-master) interface standard; Have bus arbitration mechanism, be fit to very much between the device closely, non-recurrent data communication.It transmits data through SDA (serial data line) and two lines of SCL (serial time clock line) between the device of linking on the bus; And according to each device of Address Recognition, each device that is connected to bus can concern that software set address main frame can be used as main frame transmitter or main frame receiver through unique address and the simple main frame slave that exists always.It is real many host buses, if two or more main frames while initialize data transfer can prevent that data are destroyed through collision detection and arbitration.The I2C bus can be used for the parallel bus of alternate standard, can connect various integrated circuit and functional module.Support the equipment of I2C that microcontroller, ADC, DAC, reservoir, lcd controller, led driver etc. are arranged.The transfer rate of data can reach 100kbit/s on the I2C bus under mode standard, under quick mode, can reach 400kbit/s, under fast mode, can reach 3.4Mbit/s.The burr ripple of wave filter on the sheet on can the elimination bus data line guarantees data integrity, and the IC quantity that is connected to same bus only receives the maximum capacitor 400pF restriction of bus.Because it uses the hardware interface of two lines simple, the application of I2C bus more and more widely.
The MPC8245 processor has only one road I2C bus controller, in the application of reality, especially in supervisory system, needs the function that the multipath I 2 C bus controller is accomplished monitoring.
Aspect the realization of I2C bus controller; Also can utilize the I/O pin of CPU to come Simulation with I 2C bus timing through software programming, with the method realization I2C interface of complete software, but this will take more cpu resource; And receive the stability influence of running software, inefficiency easily.In addition, the I2C bus controller on the IC chip also capable of using is realized a plurality of I2C from the device read-write operation, and it is stable, but can only on the ASIC stone veneer of I2C interface is supported in special use, use, and the single board design cost is high, can not realize the multipath I 2 C bus flexibly.
Summary of the invention
The technical matters that the present invention will solve is, can not realize the multipath I 2 C bus to the processing of prior art; After the realization of pure software I2C interface, it will occupy more cpu resource, inefficiency; Or realizing a plurality of I2C when device is read and write with the IC chip, defectives such as single board design cost height provide a kind of device, processor, system board and industrial computer with multipath I 2 C bus.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of device with multipath I 2 C bus, it comprises PLD, and said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with ppu, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
In the device with multipath I 2 C bus of the present invention, each I2C bus controller comprises:
Main control unit is used for the communication process at I2C, controls whole communications, and controls the main mode of operation of the I2C bus controller under it and switch from the state between the mode of operation;
The clock generation unit when being used for I2C bus controller under it and being in main mode of operation, for main control unit provides the clock input, and provides clock output for exterior I 2C slave unit; Wherein,
When this I2C bus controller was in from mode of operation, main control unit received the clock that exterior I 2C main equipment provides.
In the device with multipath I 2 C bus of the present invention, have four I2C bus controllers to form four road I2C buses.
In the device with multipath I 2 C bus of the present invention, said ppu is the MPC8245 processor, and it is connected with said PLD through address wire, data line, chip selection signal line and reading writing signal line.
According to another aspect of the present invention, a kind of processor with multipath I 2 C bus is provided, it comprises the processor main body, it is characterized in that, also comprises the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
In the processor with multipath I 2 C bus of the present invention, each I2C bus controller comprises:
Main control unit is used for the communication process at I2C, controls whole communications, and controls the main mode of operation of the I2C bus controller under it and switch from the state between the mode of operation;
The clock generation unit when being used for I2C bus controller under it and being in main mode of operation, for main control unit provides the clock input, and provides clock output for exterior I 2C slave unit; Wherein,
When this I2C bus controller was in from mode of operation, main control unit received the clock that exterior I 2C main equipment provides.
In the processor with multipath I 2 C bus of the present invention, have four I2C bus controllers to form four road I2C buses.
In the processor with multipath I 2 C bus of the present invention, said processor main body is the MPC8245 processor, and it is connected with said PLD through address wire, data line, chip selection signal line and reading writing signal line.
According to another aspect of the present invention, a kind of system board with multipath I 2 C bus is provided, said system board is provided with processor, and said processor comprises processor main body and the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
According to a further aspect of the invention; A kind of industrial computer with multipath I 2 C bus is provided; In the main frame of said industrial computer, be provided with system board; Said system board is provided with processor, and said processor comprises processor main body and the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
Device with multipath I 2 C bus, processor, system board and the industrial computer of embodiment of the present invention; Has following beneficial effect: utilize PLD; Accomplish expansion, make this processor that a plurality of I2C bus runs can be arranged, can hang a plurality of different equipment on each road I2C bus processor main body I2C bus; Can be main equipment, also can make slave unit.Satisfy some particular application, especially in supervisory system.In PLD, each I2C bus controller only uses four registers, thereby greatly reduces the complexity of control, need not to take more cpu resource, and system is stable, and it is high to carry out efficient.
Description of drawings
To combine accompanying drawing and embodiment that the present invention is described further below, in the accompanying drawing:
Fig. 1 is the system chart that the present invention has the processor of multipath I 2 C bus;
Fig. 2 is the theory diagram of I2C bus controller shown in Figure 1;
Fig. 3 is the process flow diagram of the data transmit-receive control method of the industrial computer of the present invention with multipath I 2 C bus;
Fig. 4 is the process flow diagram of the communication clock control method of the industrial computer of the present invention with multipath I 2 C bus;
Fig. 5 is the process flow diagram of steps A 4 shown in Figure 4.
Embodiment
As illustrated in fig. 1 and 2, in the processor with multipath I 2 C bus of the present invention, it mainly comprises the processor main body; Innovative point of the present invention is, the PLD that is connected with the processor main body is set, and the I2C bus of processor main body is expanded; Make this processor main body that a plurality of I2C bus runs can be arranged; Can hang a plurality of different equipment on each road I2C bus, can be main equipment, also can make slave unit.The processor main body is utilized local bus; Communicate through address wire, data line, reading writing signal line and chip selection signal line and PLD; Inner at PLD through carrying out the communication function of Control Software completion and processor main body; Deal with simultaneously, accomplish complete I2C agreement, in the inner function of accomplishing the I2C bus controller of PLD; Thereby accomplished conversion, utilized PLD to accomplish expansion the I2C bus controller of processor main body from the local bus of processor main body to the I2C agreement.Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises data register, address register, control register and status register.In concrete design, PLD can be FPGA, CPLD or else can realize the logical device of programmable applications, and the processor main body can be selected the MPC8245 processor for use.
System accomplishes the read-write to the PLD internal register through the local bus of processor main body; Each I2C bus controller is inner through the software realization at PLD; Can hang a plurality of I2C equipment on each road I2C bus; Can be main equipment, also can be slave unit.Through the inner register of PLD; Accomplish communicating by letter and exchanges data between each I2C bus controller and the processor main body in the FPGA; And then realized that the processor main body through the communication of PLD with the I2C equipment of a plurality of different passages, accomplished the expansion of the I2C bus of a plurality of autonomous channels of processor main body.
Because processor main body speed is far longer than the transmission speed of I2C bus; Thus the processor main body can be simultaneously with the multipath I 2 C bus on devices communicating; And the parallel processing of realization multipath I 2 C bus, but can only there be an I2C equipment to communicate by letter on the I2C bus of the every road of synchronization with the processor main body.
When I2C devices communicating on processor main body and one road I2C bus; Through being operated, realizes by the set register in PLD inside; Need operate 48 register altogether; Each register has a unique address, and this address obtains through the address wire decoding of processor main body.This register of 4 eight is respectively: data register, address register, control register and status register.
Just need 4 * N eight bit register be arranged through PLD to processor main body expansion N road I2C bus in the PLD set inside; Be N 8 bit data register, N 8 a bit address register, individual 8 control registers of N, N 8 bit status register, corresponding outside N road I2C bus.
The speed of the data processing of processor main body is far longer than the transmission speed of I2C bus; And the processor main body can multithreading multitask time-slotting deal with data, thus can be simultaneously with the multipath I 2 C bus on devices communicating, but according to I2C bus transfer agreement; For the road I2C bus of confirming; The processor main body can only with an I2C devices communicating on it, this equipment can be main equipment, also can be slave unit; Here, the processor main body is equivalent to an equipment on the I2C bus of this road; When the processor main body simultaneously with the multipath I 2 C bus on devices communicating the time, the processor main body is equivalent to be divided into a plurality of equipment simultaneously, becomes the equipment on each the road I2C bus on the multipath I 2 C bus, one by one with the I2C bus on other devices communicatings.
When the processor main body as main equipment; During with I2C devices communicating on one road I2C bus; Data register, address register, control register, status register that the processor main body realizes PLD inside through software driver are operated; At first these 4 registers are carried out initialization, afterwards the inner I2C bus controller of realizing of PLD according to the different value in data register, control register, the status register come with the I2C bus on I2C equipment communicate, address register need not; It only just uses during as slave unit in the processor main body, self address when being processor response I2C main equipment.Data register is used for depositing the data of sending or receiving, control register be used for indicating the inner I2C bus controller of realizing of PLD data transmission, produce each protocol command, response actions and mode of operation according to being provided with.Status register is used for indicating the state of the inner I2C bus controller of realizing of PLD, carries out handshake communication with the processor main body.I2C equipment on the I2C bus of the I2C bus controller of PLD control is realized and its communicate by letter, thus indirect realization the processor main body during as main equipment with the I2C bus on the communicating by letter of I2C slave unit.
When processor main body during as the devices communicating on slave unit and another road I2C bus; The processor main body is operated data register, address register, control register, the status register of PLD inside through software driver; At first these four registers are carried out initialization; The I2C bus controller of this road I2C bus communicates according to the I2C equipment on the different value in data register, control register, the status register and this road I2C bus afterwards; Made comparisons in packet header that receives and the address in the own address register: 8 header data that receive, the address of preceding 7 slave units that will visit for the I2C main equipment, the 8th is to read and write to indicate; 0 for writing, and 1 for reading; When storage addresses is mated in address of sending and the own address register; The response main equipment; Transmission should signal; According to the read-write zone bit I2C main equipment is sent or receive data afterwards, the metadata cache that sends or receive and carries out corresponding set operation to status register in data register; Send or receive data according to the read-write zone bit, when carrying out read operation, whenever read the data of a byte, send an answer signal afterwards and give main equipment, carry out the read operation of next byte afterwards; When carrying out write operation, whenever write the data of a byte, wait for that main equipment sends answer signal, receive after the answer signal, carry out the write operation of next byte.
The workflow of this processor is: after system powers on, and the I2C devices communicating that the processor main body is connected with PLD through PLD.When if the slave unit of being hung on the I2C bus that the processor main body realizes as main equipment and PLD communicates; Then the processor main body according to the I2C bus communication protocol, produces start signal through the relevant register of this road I2C bus controller of PLD inside is operated; Clock signal; And the query State position, the slave unit on the I2C bus of this road is sent or receives the operation of data, after exchanges data is accomplished; Produce stop signal, accomplish whole communication; When if the main equipment of being hung on the I2C bus that the processor main body realizes as slave unit and PLD communicates; The main equipment of being hung on the I2C bus that then PLD is realized produces start signal; Clock signal; Data are sent or received to the processor main body through the relevant data register of this road I2C bus controller in the PLD is operated; After communication was accomplished, the main equipment of being hung on the I2C bus that PLD is realized produced stop signal, accomplishes whole communication.Can hang a plurality of equipment through each road on the multipath I 2 C bus of PLD realization, can be slave unit, also can be main equipment, and the number of devices that specifically can hang receives the restriction of bus capacitance.
In a preferred embodiment, this processor main body is that MPC8245 handles, and realizes that through PLD this MPC8245 processor has four road I2C buses; PLD adopts the chip of the SPARTAN3A series of XILINX company, and development platform is ISE10.1.This PLD comprises MPC8245 processor interface module and four I2C bus controllers.
The MPC8245 processor interface module is mainly accomplished the interface function of MPC8245 processor and PLD and is realized the handshake communication with inner four the I2C bus controller data transmission of PLD.In PLD, realize four I2C bus controllers, the corresponding register that has four 8 of each I2C bus controller, i.e. data register, address register, control register and status register.
Data register is actually two registers, shares an address, distinguishes according to read/write signal, and one is to send data buffer register, and another is to receive data buffer register.Data length is 8.Address register is used for preserving the current address.When this I2C bus controller as from node communication the time, what preserve in the address register is the address of himself, this address is unique on bus; After receiving header from node, with wherein address and own address relatively, if unanimity; Then respond host node, begin transmission.The address is 7, and in the I2C register, having only preceding 7 is effectively, last 1 invalid.Control register is used for controlling the data transmission of I2C bus, produces each protocol command, response actions and mode of operation according to being provided with.Status register shows the state of current bus.Through the different state in status register indication, realize and the shaking hands of MPC8245 processor.
The MPC8245 processor utilizes that address wire, data line, chip selection signal line and reading writing signal line come 16 the register exchange data relevant with 4 I2C bus controllers of PLD inside, reading state, response address and control each I2C bus controller during as slave unit.
The MPC8245 processor judges through the MCF position in the corresponding status register in each I2C bus controller of inquiry whether a byte data transmission is accomplished in this I2C bus controller.When transmission was accomplished, MCF was set 1, and system clear 0 begins the transmission of a new byte data to this.
The MPC8245 processor utilizes address wire decoding, reads or write data to relevant register, and each register has a unique address.Low 5 address wire of MPC8245 processor is connected with PLD, through decoding, 32 address spaces can be arranged at most, can satisfy the demand of 16 needed 16 address spaces of register.When the data of register are carried out read operation in the MPC8245 processor will be to PLD; Through address wire gating address; Read signal effectively is a low level; Write signal is invalid to be high level, and chip selection signal effectively is a low level simultaneously, then system's reading of data from the register of inner this address of PLD; When the data of register are carried out write operation in the MPC8245 processor will be to PLD; Through address wire gating address; Write signal effectively is a low level; Read signal is invalid to be high level, and chip selection signal effectively is a low level simultaneously, and then system writes data in the register of inner this address of PLD.
This PLD is mainly realized 4 I2C bus controllers walking abreast; Each I2C bus controller is connected to the outside independently I2C bus that realizes separately through the I/O pin of PLD; Independently can there be a plurality of I2C equipment on each road on the I2C bus, can be main equipment, also can be slave unit; The separate work of each road I2C bus is not disturbed and influence each other.
The I2C bus controller mainly through main control unit and clock generation unit, is realized its function.The principle of 4 I2C bus controller realizations is identical, and main control unit is mainly accomplished the conversion between each state in the I2C communication process, is the core of entire I 2C bus controller.The clock generation unit is only only worked under the pattern of I2C bus controller during as main equipment, and effect is for main control unit provides the clock input, and clock output, the clock when being the I2C bus communication is provided for outside slave unit.When the I2C bus controller was communicated by letter as slave unit, the I2C main equipment of being hung on the I2C bus that the clock of main control unit is realized by PLD provided, the SCL clock that the clock during entire I 2C bus communication provides for outside main equipment.
No matter the state machine of main control unit is controlled to be any I2C bus controller as main equipment or as slave unit, and the control of the state machine of main control unit all is identical.At each state, pattern all can be to be detected, with decision output and next state.If arbitration failure or this I2C bus controller are confirmed as slave unit, this main control unit can be switched to from mode of operation by main mode of operation automatically.When detecting the START signal, the main control unit machine gets into the HEADER state.At the HEADER state, if this I2C bus controller is a main equipment, then the HEADER in the data register is sent out, and transfers to ACK HEADER state afterwards.
Whole state machine control is described below:
IDLE state (idle condition): after the I2C bus controller powered on or resets, main control unit just was in this state.By the time be checked through commencing signal detect_start and equal at 1 o'clock, transfer to the HEADER state;
HEADER state (send the packet header state, promptly send first frame data): at this state, system sends or receives header according to control register position MSTA value, and SCL is begun counting, after satisfying condition, transfers to the ACK_HEADER state; The address that the I2C bus controller of depositing in HEADER shift register in the I2C bus controller and the address register responds during as slave unit compares; If coupling; Show that then this I2C bus controller is by the slave unit of main equipment addressing; Pattern switches to the slave unit pattern at once, and the MAAS position in the status register is set simultaneously, and data line SDA will reply current main equipment according to the setting among the TXAK;
ACK_HEADER state (to replying of packet header frame data): when this I2C bus controller during,, then send end signal, turn back to the IDLE state if do not receive the ACK that slave unit sends as main equipment; If receive ACK, confirm that arbitration do not lose, forward XMIT_DATA or RCV_DATA state to according to control register position TX value; When this I2C bus controller during as slave unit, if matching addresses is then sent ACK, the value of last in first byte of sending according to main equipment forwards XMIT_DATA or RCV_DATA state to;
XMIT_DATA state (transmission data): when this state, shift register moves on to data on the sda line.After sending a byte completion, transfer to the WAIT_ACK state;
WAIT_ACK state (when sending data, waiting for that receiving equipment sends answer signal): when this state,, then turn back to the XMIT_DATA state if receive ACK; If arbitration is lost, then forward the IDLE state to; If do not receive ACK, then send end signal, transfer to the IDLE state;
RCV_DATA state (reception data): when this state, restart signal, then return the HEADER state if detect; Otherwise shift register moves into data from sda line, reads for the MPC8245 processor, move into a byte after, forward the ACK_DATA state to, the TXAK position in the control register is outputed to data line SDA;
ACK_DATA state (when receiving data, receive frame data transmitting apparatus is sent answer signal): the IIC controller sends ACK, turns back to the RCV_DATA state.
The state machine of clock generation unit is controlled to be it and under the pattern of I2C bus controller during as main equipment, works, and effect is for the main control state machine provides the clock input, and clock output, the clock when being the I2C bus communication is provided for outside slave unit.Whole state machine control is as shown in Figure 4:
Have 7 state: SCL_IDLE, START, SCL_LOW_EDGE, SCL_LOW, SCL_HIGH_EDGE, SCL_HIGH, STOP_WAIT.Be specially:
SCL_IDLE state (idle condition): behind electrification reset, state machine just is in this state.After the I2C bus controller is host node and bus when idle, receives opening flag, transfer to START state (initial state is when detecting commencing signal);
START state: when at this state,, need to keep the regular hour, when the duration meets the demands, transfer to SCL_LOW_EDGE state (the low level clock is along state), otherwise remain on the START state according to the I2C agreement;
SCL_LOW_EDGE state: when at this state, when next system clock, transfer to the SCL_LOW state;
SCL_LOW state (clock low level state): when this state,, the output of SDA is set according to control signal; When at this state, according to the I2C agreement, need to keep the regular hour, when the duration meets the demands, transfer to the SCL_HIGH_EDGE state, otherwise remain on this state; If when 7 bytes are lost and transmitted in arbitration, transfer to the SCL_IDLE state;
SCL_HIGH_EDGE state (the high level clock is along state): when this state, accomplish certain operation, after the lasting clock period, transfer to the SCL_HIGH state; If SCL be input as 0 or status register in the position MCF=1, then rest on this state always;
SCL_HIGH state (clock high level state): when this state, if the repetition start signal is arranged, the SCL high level continues half the time, transfers to the START state; If end signal is arranged, the SCL high level continues half the time, transfers to the STOP_WAIT state; According to the I2C agreement, need to keep the regular hour, when the duration meets the demands, transfer to the SCL_LOW_EDGE state, otherwise remain on current state;
The STOP_WAIT state (finishes waiting status.When producing end signal, need the regular hour at this state): when this state,, need to keep the regular hour, when the duration meets the demands, transfer to the SCL_IDLE state according to the I2C agreement.
The I/O of data relies on bidirectional shift register to realize.The function that two special modules realize bidirectional shift register is set in program, and one of them sends/receives newspaper (HEADER) specially, and another is responsible for transmission/reception data.The former only is shifted under the HEADER state, and the latter is shifted under XMIT_DATA and RCV_DATA state.
When having a plurality of main equipments simultaneously on the same road I2C bus that PLD is realized, comprise that also the MPC8245 processor possibly confirm that through bus arbitration which main equipment takies bus as main equipment.The arbitration of each road I2C bus is in the inner realization of PLD.When the arbitration failure, the MAL position in the pairing status register of this road I2C bus controller is changed to 1.
Different values is put in different position in the status register that each I2C controller is correlated with when satisfying different condition in this module.When a byte transmission is accomplished, be 1 to MCF set, otherwise be 0.When the value in the relevant address register of the address on the I2C bus and this I2C bus controller was identical, this I2C bus controller can be used as slave unit and switch to the slave unit pattern, and the MAAS position in this moment status register is changed to 1.
In the data transmit-receive control method process flow diagram of the industrial computer with multipath I 2 C bus as shown in Figure 3, it is used for the data transmit-receive of wherein I2C bus controller is controlled, and specifically may further comprise the steps:
S1, system power on, and get into init state;
S2, read the mode bit in the control register, judge whether said I2C bus controller is main mode of operation, if get into step S3; Otherwise, get into step S6; In a preferred embodiment, judge, when being 1, represent that this I2C bus controller is a main equipment, when being 0, represent that this I2C bus controller is a slave unit through the MSTA position of reading in the control register;
S3, send header data, and wait for the response signal that exterior I 2C equipment sends to outside I2C equipment;
S4, judge whether to receive response signal and exist arbitration to lose, if, get into step S5, otherwise, step S1 got into; In a preferred embodiment, send header data and also wait for exterior I 2C device responds: sending header data is 8, preceding 7 addresses for the exterior I 2C equipment that will visit, and the 8th is the read-write sign, and 0 for writing, and 1 for reading; Send when finishing when 8 header data, wait for that exterior I 2C equipment sends response signal,, turn back to the state when just powering on, promptly get into step S1 when not having response signal or determining arbitration when losing; When receiving that response signal and arbitration are not lost, carry out read-write operation, promptly get into next step; For the judgement that arbitration is lost, when following situation took place, will arbitrate zone bit set: 1, host node sent high level to sda line, and the sampling sda line obtains low level; When 2, bus is busy, monitor commencing signal; 3, restart signal under node mode, receiving; 4, the host node accident detects end signal.
S5, to the operation that reads and writes data of outside I2C equipment; Get into step S9; In a preferred embodiment, come outside I2C slave unit is carried out read-write operation, when carrying out read operation, whenever read the data of a byte, send an answer signal afterwards and give slave unit, carry out the read operation of next byte afterwards according to the read-write zone bit; When carrying out write operation, whenever write the data of a byte, wait for that slave unit sends answer signal, receive after the answer signal, carry out the write operation of next byte; When read-write is accomplished, send end signal, finish transmission, wherein each is counted through communication clock in the read-write operation.
S6, this moment, the I2C bus controller be from mode of operation, and it receives the header data of exterior I 2C equipment transmission;
S7, judge whether address and the address in the address register in the header data mate, if, get into step S8, otherwise, step S9 got into;
S8, sending answer signal to outside I2C equipment, is main equipment to respond it, carries out data transmit-receive;
In a preferred embodiment; The I2C bus controller receives header data and makes comparisons with the address in the own address register: 8 header data that receive, and preceding 7 addresses for the slave unit that will visit as the exterior I 2C equipment of main equipment, the 8th is the read-write sign; 0 for writing, and 1 for reading; When storage addresses was mated in address of sending and the own address register, the response main equipment sent answer signal, main equipment was sent or receives data according to the read-write zone bit afterwards; For read-write operation, send or receive data according to the read-write zone bit, when carrying out read operation, whenever read the data of a byte, send an answer signal afterwards and give main equipment, carry out the read operation of next byte afterwards; When carrying out write operation, whenever write the data of a byte, wait for that main equipment sends answer signal, receive after the answer signal, carry out the write operation of next byte.
S9, end.
In the communication clock control method process flow diagram of the industrial computer with multipath I 2 C bus shown in Figure 4 and 5, it is used for the communication clock of wherein I2C bus controller is controlled, and specifically may further comprise the steps:
A1, system power on, and get into init state;
A2, read the mode bit in the control register, judge whether said I2C bus controller is main mode of operation, if after receiving commencing signal, get into steps A 3; Otherwise, get into steps A 8;
A3, according to transmission speed, produce the clock low level of certain hour; As shown in Figure 5, this step can be divided into three sub-steps:
The high level state of A31, maintenance certain hour; In a preferred embodiment, when receiving commencing signal, begin to produce communication clock, keep the high level time of 4us again;
A32, generation clock low level, and the negative edge of maintenance certain hour; In a preferred embodiment, begin to produce the clock low level after, at first keep the negative edge of 300ns;
A33, afterwards according to transmission speed, produce the clock low level of certain hour.
A4, judge whether to exist arbitration to lose and transmitted a preset clock period, if, get into steps A 1, otherwise, steps A 5 got into; In a preferred embodiment, lose if determine arbitration, and transmitted time, then turn back to the state when powering on, promptly get into steps A 1 greater than 7 clock period;
A5, according to transmission speed, produce the clock high level of certain hour; In a preferred embodiment, at first keep the rising edge of 300ns,, keep the high level state of certain hour afterwards according to the needs of transmission speed;
A6, judge whether that transmission accomplishes, if, get into steps A 7, otherwise, steps A 3 got into;
A7, maintenance clock high level state when receiving the end mark signal, get into steps A 8; A byte transmission complement mark position MCF if it equals 1, then rests on the clock high level state always in the read status register, otherwise, get into clock and finish SBR, promptly get into steps A 8;
A8, clock finish.
The present invention describes through several specific embodiments, it will be appreciated by those skilled in the art that, without departing from the present invention, can also carry out various conversion and be equal to alternative the present invention.In addition, to particular condition or concrete condition, can make various modifications to the present invention, and not depart from the scope of the present invention.Therefore, the present invention is not limited to disclosed specific embodiment, and should comprise the whole embodiments that fall in the claim scope of the present invention.

Claims (7)

1. the device with multipath I 2 C bus is characterized in that, comprises PLD, and said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with ppu, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
2. the device with multipath I 2 C bus according to claim 1 is characterized in that, each I2C bus controller comprises:
Main control unit is used for the communication process at I2C, controls the main mode of operation of the I2C bus controller under it and switches from the state between the mode of operation;
The clock generation unit when being used for I2C bus controller under it and being in main mode of operation, for main control unit provides the clock input, and provides clock output for exterior I 2C slave unit; Wherein,
When this I2C bus controller was in from mode of operation, main control unit received the clock that exterior I 2C main equipment provides.
3. the device with multipath I 2 C bus according to claim 1 is characterized in that, has four I2C bus controllers to form four road I2C buses.
4. the device with multipath I 2 C bus according to claim 1 is characterized in that, said ppu is the MPC8245 processor, and it is connected with said PLD through address wire, data line, chip selection signal line and reading writing signal line.
5. the processor with multipath I 2 C bus comprises the processor main body, it is characterized in that, also comprises the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
6. system board with multipath I 2 C bus, said system board is provided with processor, and said processor comprises the processor main body, it is characterized in that, also comprises the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
7. industrial computer with multipath I 2 C bus; In the main frame of said industrial computer, be provided with system board; Said system board is provided with processor; Said processor comprises the processor main body, it is characterized in that, also comprises the PLD that is connected with said processor main body; Said PLD comprises:
A plurality of I2C bus controllers, each the I2C bus controller I/O pin through said PLD is connected to outside forming one road I2C bus, thereby is used to articulate a plurality of exterior I 2C equipment;
Processor interface module is used for being connected with the processor main body, and carries out the handshake communication of data transmission with each I2C bus controller; Wherein,
Each I2C bus controller has main mode of operation and from two kinds of duties of mode of operation, and each I2C bus controller disposes a registers group, and each registers group comprises:
Data register is used to deposit the buffered data of transmitting-receiving;
Address register is used to preserve the current address;
Control register is used to control the data transmission of corresponding I2C bus;
Status register is used to indicate the current state of corresponding I2C bus.
CN2009101904619A 2009-09-17 2009-09-17 Device with multiple I2C buses, processor, system main board and industrial controlled computer Active CN102023954B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101904619A CN102023954B (en) 2009-09-17 2009-09-17 Device with multiple I2C buses, processor, system main board and industrial controlled computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101904619A CN102023954B (en) 2009-09-17 2009-09-17 Device with multiple I2C buses, processor, system main board and industrial controlled computer

Publications (2)

Publication Number Publication Date
CN102023954A CN102023954A (en) 2011-04-20
CN102023954B true CN102023954B (en) 2012-08-22

Family

ID=43865266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101904619A Active CN102023954B (en) 2009-09-17 2009-09-17 Device with multiple I2C buses, processor, system main board and industrial controlled computer

Country Status (1)

Country Link
CN (1) CN102023954B (en)

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102243619A (en) * 2011-06-23 2011-11-16 天津光电通信技术有限公司 FPGA (Field Programmable Gate Array)-based method for realizing multi-path I2C (Inter-Integrated Circuit) bus port expansion
CN102662452A (en) * 2012-03-30 2012-09-12 中兴通讯股份有限公司 Method, device and system for controlling inter-integrated circuit (I2C) master device to reset
CN102841869B (en) * 2012-07-03 2015-06-03 深圳市邦彦信息技术有限公司 Multi-channel I2C controller based on FPGA
WO2014079034A1 (en) * 2012-11-23 2014-05-30 华为技术有限公司 Control circuit and control method for inter-integrated circuit bus
CN104571294A (en) * 2013-10-22 2015-04-29 英业达科技有限公司 Server system
CN104298158A (en) * 2014-10-21 2015-01-21 许继电气股份有限公司 Intelligent device address encoding method based on input-output structure
CN104503934B (en) * 2014-12-02 2017-10-24 天津国芯科技有限公司 A kind of expansible serial transmission device
CN105760332B (en) * 2014-12-19 2019-06-04 青岛海尔科技有限公司 A kind of more plate means of communication and system
CN104598418A (en) * 2015-01-27 2015-05-06 北京奥普维尔科技有限公司 System and method for controlling I2C communication based on FPGA (Field Programmable Gate Array)
CN105488004A (en) * 2015-11-27 2016-04-13 山东超越数控电子有限公司 I2C line multiplexing control logic method under startup and shutdown states of server
CN106681953B (en) * 2016-12-09 2020-04-10 合肥杰发科技有限公司 Slave connected with host by using I2C bus and communication method thereof
CN106598888B (en) * 2016-12-22 2019-07-12 广东威创视讯科技股份有限公司 A kind of more board communication systems and method using RS485 agreement
CN106649159B (en) * 2016-12-23 2019-03-15 中国电子科技集团公司第五十四研究所 A kind of radio frequency component and its dedicated SPI data transmission method
CN106951377A (en) * 2017-05-24 2017-07-14 南京典格通信科技有限公司 A kind of device based on the multiple I2C interface standards group equipment of SoC supports
CN108763139A (en) * 2018-04-20 2018-11-06 青岛海信电器股份有限公司 A kind of control method and device of I2C communications
CN109446144A (en) * 2018-10-29 2019-03-08 北京控制与电子技术研究所 A kind of general purpose I 2C bus control unit for supporting User Agreement
CN109491946A (en) * 2018-11-12 2019-03-19 郑州云海信息技术有限公司 A kind of chip and method for I2C bus extension
CN111355252B (en) * 2018-12-20 2024-06-21 南京四象新能源科技有限公司 Distributed energy storage system and charging and discharging method thereof
CN113906402B (en) * 2019-05-31 2023-10-27 ams国际有限公司 Inter-integrated circuit (I2C) device
CN110795382A (en) * 2019-10-09 2020-02-14 广东高云半导体科技股份有限公司 Universal asynchronous receiving and transmitting transmitter based on FPGA and system on chip
CN110781119B (en) * 2019-10-22 2023-07-04 广东高云半导体科技股份有限公司 I2C bus expansion interface, control method thereof and system on chip
CN111488175B (en) * 2019-12-29 2023-07-14 北京浪潮数据技术有限公司 Access control method, device, equipment and readable storage medium
KR20220158814A (en) * 2020-04-07 2022-12-01 후아웨이 테크놀러지 컴퍼니 리미티드 Data transmission method and transmission device according to inter-integrated circuit protocol
CN112540952B (en) * 2020-12-18 2021-09-17 广东高云半导体科技股份有限公司 System on chip with on-chip parallel interface
CN116132383B (en) * 2023-04-13 2023-07-18 苏州浪潮智能科技有限公司 Information transmission device, system and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231467B2 (en) * 2003-11-17 2007-06-12 Agere Systems Inc. Method and apparatus for providing an inter integrated circuit interface with an expanded address range and efficient priority-based data throughput
CN101114251A (en) * 2006-07-28 2008-01-30 鸿富锦精密工业(深圳)有限公司 Computer system status monitoring circuit
CN101158932A (en) * 2007-08-31 2008-04-09 上海广电(集团)有限公司中央研究院 Method for accessing on-site programmable gate array internal memory through I*C interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231467B2 (en) * 2003-11-17 2007-06-12 Agere Systems Inc. Method and apparatus for providing an inter integrated circuit interface with an expanded address range and efficient priority-based data throughput
CN101114251A (en) * 2006-07-28 2008-01-30 鸿富锦精密工业(深圳)有限公司 Computer system status monitoring circuit
CN101158932A (en) * 2007-08-31 2008-04-09 上海广电(集团)有限公司中央研究院 Method for accessing on-site programmable gate array internal memory through I*C interface

Also Published As

Publication number Publication date
CN102023954A (en) 2011-04-20

Similar Documents

Publication Publication Date Title
CN102023954B (en) Device with multiple I2C buses, processor, system main board and industrial controlled computer
CN102023953B (en) Control method of system having many inter-integrated circuit (I2C) buses
KR101429782B1 (en) Low power and low pin count bi-directional dual data rate device interconnect interface
CN106453383B (en) UART-based master-slave multi-machine communication system and method
CN100496048C (en) Multi-host communication system
EP1002275B1 (en) A universal serial bus device controller
CN100573382C (en) Based on I 2The communication system of C and communication means
CN102420877B (en) Multi-mode high-speed intelligent asynchronous serial port communication module and realizing method thereof
CN102253913B (en) Device for carrying out state acquisition and output control on multi-board-card port
CN103454996A (en) Master-slave computer system and control method thereof
CN108111382B (en) Communication device based on I3C bus and communication method thereof
CN102088386A (en) Universal serial bus (USB) for master-slave interconnection module of circuit system
CN102243619A (en) FPGA (Field Programmable Gate Array)-based method for realizing multi-path I2C (Inter-Integrated Circuit) bus port expansion
US20090271557A1 (en) Non-volatile memory storage device with high transmission rate
CN101901202A (en) Circuit and method for cross clock domain accessing of AHB bus equipment to APB bus equipment
CN104484306A (en) Master-slave synchronous serial communication bus based on differential signal and realization method of master-slave synchronous serial communication bus
CN107643993B (en) Bus conversion interface, working method of bus conversion interface and communication equipment
CN117215977B (en) I3C concentrator and interrupt arbitration digital implementation method
WO2012013080A1 (en) Data transparent transmission method and system
CN116566761B (en) SPI dual-host sharing arbitration system and method
CN107370651A (en) A kind of communication means between SPI slaves
CN107239423A (en) A kind of device based on extension IIC interfaces
CN208477514U (en) A kind of SPI of intelligent temperature controller turns the analog circuit of UART
CN101281510B (en) Double-I2C bus setting method and double I2C bus system
CN207367195U (en) A kind of IIC interface expansion boards

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230705

Address after: 518000 Shenzhen, Futian District, Guangdong Futian street Gangxia community Shennan Road No. 1003 Dongfang Xintiandi Plaza 5 floor 502F

Patentee after: Guangdong Industrial edge intelligent Innovation Center Co.,Ltd.

Address before: 518057 Guangdong city of Shenzhen province Nanshan District high in the four EVOC Technology Building No. 31

Patentee before: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd.