CN2788463Y - Communication transmission control device - Google Patents

Communication transmission control device Download PDF

Info

Publication number
CN2788463Y
CN2788463Y CN 200420122257 CN200420122257U CN2788463Y CN 2788463 Y CN2788463 Y CN 2788463Y CN 200420122257 CN200420122257 CN 200420122257 CN 200420122257 U CN200420122257 U CN 200420122257U CN 2788463 Y CN2788463 Y CN 2788463Y
Authority
CN
China
Prior art keywords
communication
data
controller
communication module
spi
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.)
Expired - Fee Related
Application number
CN 200420122257
Other languages
Chinese (zh)
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.)
Vimicro Corp
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CN 200420122257 priority Critical patent/CN2788463Y/en
Application granted granted Critical
Publication of CN2788463Y publication Critical patent/CN2788463Y/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The utility model discloses a communication transmission control device which comprises an I2C communication module, an SPI communication module and a controller, wherein the I2C communication module is used for completing data transmission by adopting I2C protocol according to control signals of the controller, the SPI communication module is used for completing data transmission by adopting SPI protocol according to the control signals of the controller, the controller is used for receiving data transmission command, determining the communication protocol adopted at present and transmitting the control signals to the communication module corresponding to the determined communication protocol. The I2C communication module and the SPI communication module interact with external devices through the same communication port. The device of the utility model can simultaneously support the communication of the I2C protocol and the SPI protocol, and a user can select optionally and switch quickly between the I2C protocol and the SPI protocol according to different requirements conveniently.

Description

A kind of communication transmission control unit
Technical field
The utility model relates to the communications protocol control technology, refers to the communication transmission control unit of a kind of compatible I2C simultaneously and SPI especially.
Background technology
I2C (Inter-IC) and SPI (Serial Peripheral Interface) are the serial port communicating protocols of common two kinds of different mechanisms, wherein, I2C has many master control functions, it is a kind of two-wire bidirectional linked list data highway system with multiterminal control ability, the parallel bus that can be used for alternate standard, the various integrated circuits and the functional module that can connect are usually according to the definite number of devices that can support of the figure place of address code.SPI is a synchronous serial Peripheral Interface, is used for CPU and various peripheral components carries out full duplex, synchronous serial communication, and SPI can send and receive serial data simultaneously, only needs four lines just can finish communication with various peripheral components.Generally speaking, the I2C device is mainly used in the serial communication of low speed small data quantity transmission; And the SPI device is used for the serial communication of high speed big data quantity transmission.
In actual applications, I2C or SPI are controlled by controller and finish data communication, and described controller generally is made up of CPU (CPU) and register.
For the I2C device, the communication modes that adopts is so usually: when data will be transmitted, controller sent the sign that an expression communication begins earlier; Then send the control bit of this communication, comprise address of devices and direction, wherein address of devices is meant the address of target devices, and direction can be by reading or writing expression; Sending device home address more afterwards, i.e. data position that will be stored to or the position of wanting the reading of data place; Then, just carry out data communication transmission data; Behind the DTD, send the sign that an expression communication finishes, finish this communication.
For the SPI device, usually the communication modes that adopts is like this: when data will be transmitted, the controller word of giving an order earlier was such as reading or writing instruction; Then sending device home address, i.e. data position that will be stored to or the position of wanting the reading of data place; Afterwards, just carry out data communication transmission data.When utilizing SPI to carry out serial communication, need before beginning, communication open the SPI passage, and communication is closed the SPI passage after finishing.
In the present concrete application, existing control device can only be supported a kind of in I2C and two kinds of communications protocol of SPI, can not be compatible.So, the user can not select arbitrarily or switches different communication modes according to the needs of actual communication, brings a lot of inconvenience to the user in the use.
The utility model content
In view of this, main purpose of the present utility model is to provide a kind of communication transmission control unit, makes its communication that can support I2C and two kinds of agreements of SPI simultaneously, for the user provides convenience.
For achieving the above object, the technical solution of the utility model is achieved in that
A kind of communication transmission control unit, this device comprises:
The I2C communication module is used for the control signal according to controller, adopts the I2C agreement to finish transfer of data;
The SPI communication module is used for the control signal according to controller, adopts the SPI agreement to finish transfer of data;
Controller is used to receive data transfer command, determines the communications protocol of current employing, and to the communication module of definite communications protocol correspondence transmit control signal;
Described I2C communication module and SPI communication module are undertaken by same PORT COM and external devices alternately.
Wherein, described controller links to each other with the core processor of the communication apparatus at self place, receives the data transfer command that core processor is sent, and produces to core processor and to interrupt.Described controller is made up of CPU and at least one register, and described register comprises the communications protocol register of storing currently used communications protocol at least, and shows the data transfer register that whether has data to send.Configuration in the described communications protocol register is by the selection wire jumper or the selector switch setting of outside.Described controller links to each other with the core processor of the communication apparatus at self place, and comprises the communications protocol register of storing currently used communications protocol in the described controller, and the configuration in this communications protocol register is by the core processor setting.
Communication transmission control unit provided by the utility model, when carrying out communication, bottom still carries out the transmission of data by I2C or SPI agreement, and controller adopts uniform way to carry out communication transmission control, so, make a controller can support I2C and two kinds of agreements of SPI simultaneously, can realize the compatibility of I2C or two kinds of agreements of SPI, make the user to select arbitrarily between two kinds of communications protocol according to different demands easily or to switch fast.
Description of drawings
Fig. 1 is the composition structural representation of the utility model device;
Fig. 2 is the state machine diagram in the utility model controller.
Embodiment
Core concept of the present utility model is: still use I2C and SPI agreement respectively when bottom transmits, but use same controller to carry out unified processing when agreement is controlled.That is to say that the utility model obtains the common trait of two kinds of agreement communication signals at I2C and two kinds of agreements of SPI, in controller, adopt the mode of state machine to realize Communication Control, multiplexing PORT COM then.
Though sequential and response mode on hardware in I2C and the SPI communication process are different, the angle of slave controller, the communication modes of the two can be unified, and has common trait between two kinds of signals that agreement sent.Be embodied as: in controller, communication modes of the present utility model can unify to be the order shown in the table one:
Beginning Control bit The address Data Finish
Table one
Wherein, for the device of I2C, beginning is corresponding to the communication opening flag, and the variation by physical layer data line and clock line realizes; Control bit is corresponding to the control bit of this communication, i.e. address of devices and read/write; The address is corresponding to address in the device, i.e. the data position that will store or read; Data are corresponding to the data communication stage; End realizes by the data wire of physical layer and the variation of clock line corresponding to the communication end mark.For the device of SPI, begin to be equivalent to open the passage of SPI, realize by sheet choosing and clock signal; Control bit is equivalent to command word; The address is corresponding to the device inside address, i.e. the data position that will store or read; Data are corresponding to the data communication stage; Finish to be equivalent to close the SPI passage, also realize by sheet choosing and clock signal.Like this, different communications protocol just can be unified to carry out.Simultaneously, the length of address and the length of transfer of data can be controlled by the register of controller inside, thereby support the I2C device of various different capabilities or the transmission of SPI device and different pieces of information amount.
Based on above-mentioned principle, the utility model provides a kind of communication transmission control unit, as shown in Figure 1, comprises controller 10, I2C communication module 11 and SPI communication module 12.Wherein, I2C communication module 11 and SPI communication module 12 are responsible for respectively adopting I2C agreement or SPI agreement to carry out transfer of data, can directly adopt I2C agreement communication module of the prior art and SPI agreement communication module.Controller is used to receive the transmission data command that the microprocessor (not shown) is sent, such as sending data command or receiving data command, determine that according to the configuration in self register control I2C communication module finishes transfer of data and still control the SPI communication module and finish transfer of data, and control determined communication module by unified communication modes and carry out transfer of data, and behind DTD, finish with this communication of interrupt mode notice microprocessor.Here, described microprocessor is the key process unit of the communication apparatus at the utility model communication transmission control unit place.
Described controller is made up of the register of CPU and several corresponding difference in functionalitys, and wherein, CPU is used to finish all processing operations, comprises the reception order, generates control signal, produces and interrupt or the like; The register of described corresponding difference in functionality includes but not limited to address register, address transfer byte number register, data register, transfer of data byte number register, control bit register etc., store corresponding difference in functionality in the different registers and realize required configuration parameter, when address transfer byte number register and transfer of data byte number register were zero, expression did not have address transfer, does not have transfer of data respectively.In addition, the also special communications protocol configuration parameter corresponding value of using the current selection of a register-stored in the utility model, can claim that this register is the communications protocol register, parameter value in this communications protocol register can be provided with as required by microprocessor, and hardware such as selection wire jumper that also can be by communication transmission control unit outside or selector switch directly is provided with.
No matter this communication transmission control unit all adopts same PORT COM 13 and external devices carry out alternately, i.e. the communication module of two kind agreements multiplexing same PORT COM with I2C protocol transmission data or with SPI protocol transmission data.
According to structure shown in Figure 1, the operation principle of the utility model communication transmission control unit is:
A) behind the transmission data command that controller 10 reception microprocessors are sent, to send data command is example, controller 10 reads the configuration parameter value in self communications protocol register, determine that this secondary data sends employed communications protocol, generate corresponding unlatching control signal then and start corresponding communication module, such as: if the configuration parameter in the communications protocol register represents to adopt the I2C agreement to send data, then controller 10 changes with regard to control data line and clock line, as the signal on data wire and the clock line is changed to height; If the configuration parameter in the communications protocol register represents to adopt the SPI agreement to send data, then controller 10 is just controlled chip selection signal and clock signal variation, as chip selection signal and clock signal are changed to height or the like.
B) after the startup corresponding communication module, controller 10 just sends control bit, is exactly sending device address and read/write for I2C, sends command word exactly for SPI; Afterwards, controller 10 has judged whether that data will send, if do not have, just directly produce corresponding finishing control signal and issue corresponding communication module, if there are data to send, judge whether transfer address information again, if the transfer address just continues to give external devices by corresponding communication module sending device home address, then transmit data, after transfer of data finishes, produce corresponding finishing control signal again and issue corresponding communication module, otherwise, directly transmit data, and after transfer of data finishes, produce corresponding finishing control signal and issue corresponding communication module.
Here, the finishing control signal is to change by control data line and clock line equally, or the variation of chip selection signal and clock signal realizes.The described data that judge whether will send that also to be controller 10 determine by the configuration parameter that reads in self corresponding registers, this register is exactly a transfer of data byte number register, whether configuration parameter wherein represents to have data to transmit, and the configuration parameter in this transfer of data byte number register can be by the microprocessor setting.
For the controller described in the utility model, adopt the mode of state machine to realize control, the controller state machine comprises wait state, starting state, control bit transmission state, address transfer state, data transmission state and done state, and is concrete with reference to shown in Figure 2:
The controller state machine is not having to be in wait state under the situation of communication, under this state, can revise each register of controller inside; And, can decide the communication modes of a communication by the byte number of setting data transmission and address transfer, zero if byte is set to, then there is not corresponding state.Under this kind state, transmit order, then enter starting state if receive data.Specific implementation can be provided with flag bit at the beginning, if position, opening flag position, such as being that height then starts communication with the opening flag position, state machine enters into starting state then, if the opening flag position is in resets, and still rests on wait state.
Under starting state, controller produces opens the communication that control signal starts I2C or SPI communication module, here, controller determines that according to the configuration parameter in self communications protocol register starting the I2C communication module still is the SPI communication module, if start the I2C communication module, then data wire and the clock line by the control physical layer changes as opening control signal, if start the SPI communication module, then changes as opening control signal by control chip selection signal and clock signal; Then, the controller state machine enters the control bit transmission state according to the starting state end signal of I2C communication module or the generation of SPI communication module.
Under the control bit transmission state, I2C communication module or SPI communication module obtain the Communication Control position in the controller and send external devices to, and after having transmitted control bit, I2C communication module or SPI communication module produce control bit and send end signal.At this moment, controller has judged whether that according to the configuration parameter in its data transmission byte number register data need to transmit, and does not need to transmit data if find this communication, and then the controller state machine is directly jumped to done state; If there are data to transmit, need then to judge whether transfer address information, if desired, then enter the address transfer state, otherwise directly jump into data transmission state.Whether whether, have address information to need to transmit here, can be zero next definite according to address transfer byte number register; Whether whether equally, have data to transmit, can be zero next definite according to transfer of data byte number register also.
Under the address transfer state, controller control I2C communication module or SPI communication module transmission apparatus home address are given external devices, enter into data transmission state behind the end of transmission.Wherein, the byte number of transport address can be realized by the address register of revising controller.
Under data transmission state, controller control I2C communication module or SPI communication module transmission data after transfer of data finishes, enter done state.In this state, controller transmits corresponding byte according to predefined transmission byte, and data can be to write or read in from external devices to external devices.Here, an end of transmission flag bit can be set also,, then enter done state if the set of end of transmission flag bit illustrates that transfer of data finishes; If end of transmission flag bit is in reset, illustrate that data have not transmitted, then still rest on data transmission state.
Under done state, controller resets to the beginning flag bit, and produces corresponding communication end mark, puts the end mark position that is:, and I2C is then changed as opening control signal by the data wire and the clock line of control physical layer; SPI is then changed as opening control signal by control chip selection signal and clock signal, jump into wait state then.
Controller can notify the microprocessor communication to finish by interrupt mode when producing the communication end mark, and microprocessor resets to communication end mark position after receiving and interrupting.
The utility model is still finished the transmission of data at bottom by I2C or SPI agreement, and the communication transmission is handled with uniform way by state machine in controller, and then can realize the compatibility of I2C and SPI agreement.
In a word, the above is preferred embodiment of the present utility model only, is not to be used to limit protection range of the present utility model.

Claims (5)

1, a kind of communication transmission control unit is characterized in that, this device comprises:
The I2C communication module is used for the control signal according to controller, adopts the I2C agreement to finish transfer of data;
The SPI communication module is used for the control signal according to controller, adopts the SPI agreement to finish transfer of data;
Controller is used to receive data transfer command, determines the communications protocol of current employing, and to the communication module of definite communications protocol correspondence transmit control signal;
Described I2C communication module and SPI communication module are undertaken by same PORT COM and external devices alternately.
2, communication transmission control unit according to claim 1 is characterized in that, described controller links to each other with the core processor of the communication apparatus at self place, receives the data transfer command that core processor is sent, and produces to core processor and to interrupt.
3, communication transmission control unit according to claim 1 and 2, it is characterized in that, described controller is made up of CPU and at least one register, described register comprises the communications protocol register of storing currently used communications protocol at least, and shows the data transfer register that whether has data to send.
4, communication transmission control unit according to claim 3 is characterized in that, the configuration in the described communications protocol register is by the selection wire jumper or the selector switch setting of outside.
5, communication transmission control unit according to claim 2, it is characterized in that, described controller links to each other with the core processor of the communication apparatus at self place, and comprise the communications protocol register of storing currently used communications protocol in the described controller, the configuration in this communications protocol register is by the core processor setting.
CN 200420122257 2004-12-31 2004-12-31 Communication transmission control device Expired - Fee Related CN2788463Y (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200420122257 CN2788463Y (en) 2004-12-31 2004-12-31 Communication transmission control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200420122257 CN2788463Y (en) 2004-12-31 2004-12-31 Communication transmission control device

Publications (1)

Publication Number Publication Date
CN2788463Y true CN2788463Y (en) 2006-06-14

Family

ID=36786756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200420122257 Expired - Fee Related CN2788463Y (en) 2004-12-31 2004-12-31 Communication transmission control device

Country Status (1)

Country Link
CN (1) CN2788463Y (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100459612C (en) * 2004-12-31 2009-02-04 北京中星微电子有限公司 A communication transmission control device and method for implementing communication protocol control
CN102064987A (en) * 2010-12-17 2011-05-18 天津曙光计算机产业有限公司 Mixed-mode high-speed front end network access processing method
CN103488600A (en) * 2013-10-08 2014-01-01 江苏物联网研究发展中心 Universal auxiliary machine synchronous serial interface circuit
CN111737177A (en) * 2020-05-18 2020-10-02 大唐微电子技术有限公司 Method and device for identifying communication interface of chip in BOOT state

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100459612C (en) * 2004-12-31 2009-02-04 北京中星微电子有限公司 A communication transmission control device and method for implementing communication protocol control
CN102064987A (en) * 2010-12-17 2011-05-18 天津曙光计算机产业有限公司 Mixed-mode high-speed front end network access processing method
CN102064987B (en) * 2010-12-17 2013-11-06 曙光信息产业股份有限公司 Mixed-mode high-speed front end network access processing method
CN103488600A (en) * 2013-10-08 2014-01-01 江苏物联网研究发展中心 Universal auxiliary machine synchronous serial interface circuit
CN111737177A (en) * 2020-05-18 2020-10-02 大唐微电子技术有限公司 Method and device for identifying communication interface of chip in BOOT state
CN111737177B (en) * 2020-05-18 2022-03-18 大唐微电子技术有限公司 Method and device for identifying communication interface of chip in BOOT state

Similar Documents

Publication Publication Date Title
CN100416536C (en) Bulk memory accessing method for I2C controller in 10-site addressing mode
CN100459612C (en) A communication transmission control device and method for implementing communication protocol control
US5507003A (en) Parallel interface protocol for bidirectional communications between computer and printer using status lines for transmitting data during a reverse channel operation
DE60310586T2 (en) CONNECTION SYSTEM
US20020013880A1 (en) Integrated circuit with flash bridge and autoload
CN102012885A (en) System and method for realizing communication by adopting dynamic I2C bus
CN1776597A (en) Method and apparatus for calibrating random access memory
CN100480923C (en) Controller soft realizing method from I2C bus
CN106354674A (en) Semiconductor device and system
CA2310275C (en) Apparent network interface for and between embedded and host processors
US7664898B2 (en) Method and system for efficient framing on addressed buses
CN2788463Y (en) Communication transmission control device
CN101421705A (en) Multi media card with high storage capacity
US20080215781A1 (en) System including bus matrix
JPH08167921A (en) Communication adaptor,data transfer system and method
CN1178130C (en) Control method and electronic device thereof
CN1969268A (en) Interrupt scheme for bus controller
CN1889666A (en) Interface switching apparatus and method thereof
CN1441566A (en) Communication device using three step communication buffer storage
CN102023823B (en) Communication control method and system for USB printing device
JP2006011926A (en) Serial data transfer system, serial data transfer device, serial data transfer method and image forming apparatus
CN1119004C (en) Method for transferring messages with dual control words
CN1366247A (en) PCI bridge with improved structure
CN219643938U (en) Communication control circuit and communication equipment for carrying IIC communication through UART
CN110399322B (en) Data transmission method and ping-pong DMA framework

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20060614

Termination date: 20101231