CN114595182A - Bidirectional conversion circuit and method for multiple communication serial ports - Google Patents

Bidirectional conversion circuit and method for multiple communication serial ports Download PDF

Info

Publication number
CN114595182A
CN114595182A CN202210207651.2A CN202210207651A CN114595182A CN 114595182 A CN114595182 A CN 114595182A CN 202210207651 A CN202210207651 A CN 202210207651A CN 114595182 A CN114595182 A CN 114595182A
Authority
CN
China
Prior art keywords
serial port
data
module
fifo
decoder
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
CN202210207651.2A
Other languages
Chinese (zh)
Other versions
CN114595182B (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.)
Zhuhai Shengsheng Microelectronic Co ltd
Original Assignee
Zhuhai Shengsheng Microelectronic 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 Zhuhai Shengsheng Microelectronic Co ltd filed Critical Zhuhai Shengsheng Microelectronic Co ltd
Priority to CN202210207651.2A priority Critical patent/CN114595182B/en
Publication of CN114595182A publication Critical patent/CN114595182A/en
Application granted granted Critical
Publication of CN114595182B publication Critical patent/CN114595182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • 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/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • 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/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Communication Control (AREA)
  • Information Transfer Systems (AREA)

Abstract

A multi-communication serial port bidirectional conversion circuit and a method thereof are provided, the circuit comprises: the device comprises a selection controller module, an FIFO module, a first serial port compiling module, a second serial port compiling module and a decoder selection module; the selection controller module comprises an encoder selection module and an FIFO configuration selection module; the FIFO module consists of a plurality of FIFO units; the decoder selection module comprises a first decoder selection unit and a second decoder selection unit; the method comprises the following steps: setting communication requirements of software according to conversion requirements of serial port data, receiving serial data to be converted by a decoder selection module, automatically identifying a serial form, determining a conversion form and a transmission direction of the data by the decoder selection module in cooperation with an encoder selection module, and matching an encoder and a decoder for data conversion; the FIFO configuration selection module can set the allocation of data storage and transmission of the FIFO unit; and the automatic data conversion in three serial port modes of UART, I2C and SPI is realized.

Description

Bidirectional conversion circuit and method for multiple communication serial ports
Technical Field
The invention relates to the technical field of electronics, in particular to a multi-communication serial port bidirectional conversion circuit and a method.
Background
In the electronic field, UART, I2C and SPI are used as communication serial ports, and because of their advantages such as stability and normalization, they are usually applied to various MCU chips for data transmission, so to speak, they are an indispensable part of MCU chips; the FPGA verification is one of important verification means in the chip development process, and as the FPGA verification is closer to the real running environment of a chip, and is cheaper than other verification devices and more convenient to use, the qualification of each index of the chip can be ensured by means of the FPGA verification before Tape-out of most chip design companies;
in the process of FPGA verification, when data transmission needs to be carried out between the same chip or different chips, a chip design company may not simultaneously contain the three types of communication interface modules due to the consideration of the problem of chip development cost (area and power consumption), but data exchange needs to be carried out between different serial port modules under a certain specific verification condition, so that the problem of communication serial port non-adaptation is caused, at this time, a verifier usually uses a serial port tool and the chip to carry out data receiving and sending at a pc end for assisting verification, but because the verifier is not a real hardware environment and has certain ideality, the verification result is not reliable, so that the precision problem of design cannot be accurately verified, and the verification result may have certain deviation.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a multi-communication serial port bidirectional conversion circuit and a method, and aims to solve the problem of data conversion of three communication serial ports, namely UART, I2C and SPI.
In order to solve the problems, the technical scheme adopted by the invention is as follows:
a multi-communication serial port bidirectional conversion circuit comprises a selection controller module, an FIFO module, a first serial port compiling module, a second serial port compiling module and a decoder selection module; the selection controller module comprises an encoder selection module and an FIFO configuration selection module; the FIFO module consists of a plurality of FIFO units; the decoder selection module comprises a first decoder selection unit and a second decoder selection unit; the selection controller module is connected with the first serial port compiling module and the second serial port compiling module through the encoder selection module, and the selection controller module is connected with the FIFO units of the FIFO module through the FIFO configuration selection module.
Further, the first serial port compiling module is composed of a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; the second serial port compiling module consists of a second SPI coder/decoder, a second I2C coder/decoder and a second UART coder/decoder; the FIFO module is provided with three FIFO units, namely a first FIFO unit, a second FIFO unit and a third FIFO unit; the transmission data types among the encoder/decoder of the first serial port module, the encoder/decoder of the second serial port module, the three FIFO units of the FIFO module and the decoder selection module comprise SPI data, I2C data and UART data.
The first decoder selection unit is connected with the first chip through an MOSI/MOSO serial port, an SDA serial port and an RX/TX serial port; the second decoder selection unit is connected with the second chip through an MOSI/MOSO serial port, an SDA serial port and an RX/TX serial port; the first decoder selection unit is connected with a first SPI codec, a first I2C codec and a first UART codec of the first serial port codec module; the second decoder selection unit is connected with a second SPI codec, a second I2C codec and a second UART codec of the second serial port codec module.
The FIFO module is connected with the first serial port compiling module and the second serial port compiling module; three units of a first FIFO unit, a second FIFO unit and a third FIFO unit of the FIFO module are all connected with a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; and the first FIFO unit, the second FIFO unit and the third FIFO unit of the FIFO module are all connected with the second SPI coder/decoder, the second I2C coder/decoder and the second UART coder/decoder.
A multi-communication serial port bidirectional conversion method, the multi-communication serial port bidirectional conversion circuit carries on the mutual conversion transmission of three kinds of data of UART, I2C and SPI;
the serial port data of treating serial port form conversion is sent by first chip, and the circuit carries out serial port form conversion to serial port data, and the serial port data after the second chip receives the conversion, its step is:
a first decoder selecting unit of the decoder selecting module receives serial port data sent by a data serial port end of a first chip, identifies a serial port form of the serial port data, and automatically selects a serial port form corresponding to a first SPI/I2C/UART decoder; setting and selecting a conversion requirement of a serial port form of the controller module through software; the encoder selection module configures a second SPI/I2C/UART encoder according to conversion requirements and determines the transmission direction of data by matching with the decoder selection module; the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to the conversion requirement and the transmission direction of the data;
the first SPI/I2C/UART decoder receives the serial data sent by the first decoder selection module, converts the serial data into standard binary data and sends the standard binary data to the FIFO module; the FIFO module stores the binary number data and sends the binary number data to a corresponding second SPI/I2C/UART encoder; the second SPI/I2C/UART encoder converts the system number data into corresponding serial port data and sends the serial port data to the second decoder selecting unit; and the second decoder selection unit sends the serial port data to the second chip.
The second chip sends serial port data to be converted in serial port mode, the circuit converts the serial port data in serial port mode, the first chip receives the converted serial port data, and the method comprises the following steps:
a second decoder selecting unit of the decoder selecting module receives serial port data sent by a data serial port of a second chip, identifies the serial port form of the serial port data, and automatically selects a serial port form corresponding to a second SPI/I2C/UART decoder; setting and selecting a conversion requirement of a serial port form of the controller module through software; the encoder selection module configures a first SPI/I2C/UART encoder according to conversion requirements and determines the transmission direction of data by matching with the decoder selection module; the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to the conversion requirement and the transmission direction of the data;
the second SPI/I2C/UART decoder receives the serial data sent by the second decoder selection module, converts the serial data into standard binary data and sends the standard binary data to the FIFO module; the FIFO module stores the data of the binary system number and sends the data to a corresponding first SPI/I2C/UART encoder; the first SPI/I2C/UART encoder converts the system number data into corresponding serial port data and sends the serial port data to the first decoder selecting unit; the first decoder selection unit sends serial port data to the first chip.
Further, the FIFO configuration selection module configures the binary numerical data to any one or more FIFO units in non-data transmission for data storage and transmission according to the conversion requirement and the transmission direction of the data and the storage depth and the transmission state of each FIFO unit of the FIFO module;
when the first FIFO unit/the second FIFO unit/the third FIFO unit carry out serial port form conversion of serial port data from the first chip to the second chip according to the configuration information of the FIFO configuration selection module, one or more FIFO units receive the data sent by the first SPI/I2C/UART compiler, store the data according to the storage depth of each FIFO unit, and send the stored data to the second SPI/I2C/UART encoder; when the second chip performs serial port form conversion of serial port data to the first chip, one or more FIFO units receive data sent by the second SPI/I2C/UART decoder, perform data storage according to the storage depth of each FIFO unit, and send the stored data to the first compiler SPI/I2C/UART encoder.
Furthermore, in the FIFO configuration selection module, a user can configure the data input bit width, the storage depth, and the data output bit width of each FIFO unit in the FIFO module through software according to the size of the actual transmission data frame number and the bit width of the data.
Compared with the prior art, the invention has the beneficial effects that: the serial port form conversion of the serial port data is set through software, the encoder selection module automatically identifies the serial port form of the serial port data when receiving the serial port data, selects a corresponding decoder, matches the encoder corresponding to the serial port form conversion through the encoder selection module and determines the transmission direction of the data, and automatic decoding of the decoder and automatic encoding of the encoder are achieved; the FIFO configuration selection module can set the storage depth and the data bit width of each FIFO unit of the FIFO module through software according to the data volume of data transmission so as to be compatible with systems with different bit numbers such as 8 bits, 16 bits, 32 bits and the like; meanwhile, the FIFO configuration selection module can automatically configure one or more FIFO units in a non-transmission state for data storage and transmission according to the storage depth and the transmission state of each FIFO unit, and each FIFO unit can also independently transmit data, so that the data storage and transmission efficiency is greatly improved.
The invention is described in further detail below with reference to the drawings and the detailed description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a circuit structure of an embodiment of the present invention.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes in detail may be made without departing from the spirit of the disclosure, from various aspects and applications of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
A multi-communication serial port bidirectional conversion circuit comprises a selection controller module, an FIFO module, a first serial port compiling module, a second serial port compiling module and a decoder selection module; the selection controller module comprises an encoder selection module and an FIFO configuration selection module; the FIFO module consists of a plurality of FIFO units; the decoder selection module comprises a first decoder selection unit and a second decoder selection unit; the first serial port compiling module consists of a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; the second serial port compiling module consists of a second SPI coder/decoder, a second I2C coder/decoder and a second UART coder/decoder; the FIFO module is provided with three FIFO units, namely a first FIFO unit, a second FIFO unit and a third FIFO unit;
the encoder selection module is connected with the first serial port compiling module and the second serial port compiling module; the FIFO configuration selection module is connected with the FIFO module;
the data types needing serial port form conversion between the first chip and the second chip can comprise SPI, I2C and UART; the transmission of SPI type data corresponds to MOSI/MISO serial ports of the first chip and the second chip, the transmission of I2C type data corresponds to SDA serial ports of the first chip and the second chip, and the transmission of UART type data corresponds to TX/RX serial ports of the first chip and the second chip;
the first decoder selection unit is connected with the first chip through an MOSI/MISO serial port, an SDA serial port and an RX/TX serial port; the second decoder selection unit is connected with the second chip through an MOSI/MISO serial port, an SDA serial port and an RX/TX serial port;
the first decoder selection unit is correspondingly connected with a decoder and an encoder of the first serial port compiling module according to a serial port form connected with the first chip; the first SPI coder/decoder is connected with the MOSI/MISO serial port of the first chip through a first decoder selection unit; the first I2C coder/decoder is connected with the SDA serial port of the first chip through a first decoder selection unit; the first UART coder/decoder is connected with an RX/TX serial port of the first chip through a first decoder selection unit;
the second decoder selection unit is correspondingly connected with a decoder and an encoder of the second serial port compiling module according to the serial port form connected with the second chip; the second SPI coder/decoder is connected with the MOSI/MISO serial port of the second chip through a second decoder selection unit; the second I2C coder/decoder is connected with the SDA serial port of the second chip through a second decoder selection unit; the second UART coder/decoder is connected with the RX/TX serial port of the second chip through a second decoder selection unit;
the FIFO module is connected with the first serial port compiling module and the second serial port compiling module; three units of a first FIFO unit, a second FIFO unit and a third FIFO unit of the FIFO module are all connected with a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; and three units of the first FIFO unit, the second FIFO unit and the third FIFO unit of the FIFO module are all connected with the second SPI coder/decoder, the second I2C coder/decoder and the second UART coder/decoder.
A multi-communication serial port bidirectional conversion method, the multi-communication serial port bidirectional conversion circuit carries on the mutual conversion transmission of three kinds of data of UART, I2C and SPI;
sending serial port data to be converted in a serial port form by a first chip, wherein the serial port data in the SPI serial port form is sent by an MOSI/MISO serial port of the first chip, the serial port data in the I2C serial port form is sent by an SDA serial port of the first chip, and the serial port data in the UART serial port form is sent by a TX/RX serial port of the first chip; the circuit carries out serial port form conversion on serial port data, and the second chip receives the converted serial port data, and the method comprises the following steps:
the serial port data is received by a first decoder selecting unit of the decoder selecting module, serial port forms of the serial port data are identified, the serial port forms comprise three types of SPI/I2C/UART, and the decoder selecting module automatically selects the serial port form to correspond to a first SPI/I2C/UART decoder;
setting and selecting a conversion requirement of a serial port form of the controller module through software; the serial port forms of SPI, I2C and UART are converted two by two respectively, and the conversion requirements comprise: six conversion requirements of SPI converting to I2C, SPI converting to UART, I2C converting to SPI, I2C converting to UART, UART converting to SPI and UART converting to I2C; the encoder selection module configures a second SPI/I2C/UART encoder of a second serial port compiling module according to conversion requirements; the encoder selection control module is matched with the decoder selection module to determine the transmission direction of the data, namely, the decoder of the first serial port compiling module and the encoder of the second serial port compiling module are determined according to one of six conversion requirements, and then the conversion form and the transmission direction of the serial port data are determined;
the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to one of the six conversion requirements and the transmission direction of data;
the first SPI/I2C/UART decoder receives the serial port data sent by the first decoder selection module and converts the serial port data into unified binary number data, wherein the unified standard binary number data comprise common binary number data types such as 8 bits, 16 bits and 32 bits; the first SPI/I2C/UART decoder transmits the converted binary number data to the FIFO module; the FIFO module stores the binary digit data and sends the binary digit data to a corresponding second SPI/I2C/UART encoder; the second SPI/I2C/UART encoder converts the binary number data into serial port data in a serial port form corresponding to the conversion requirement and sends the serial port data to the second decoder selecting unit; and the second decoder selection unit sends the serial port data to the second chip through the corresponding serial port.
The serial port data to be converted in the serial port form is sent by the second chip, wherein the serial port data in the SPI serial port form is sent by an MOSI/MISO serial port of the second chip, the serial port data in the I2C serial port form is sent by an SDA serial port of the second chip, and the serial port data in the UART serial port form is sent by a TX/RX serial port of the second chip; the circuit carries out serial port form conversion to serial port data, and first chip receives serial port data after the conversion, and its step is:
a second decoder selecting unit of the decoder selecting module receives serial port data sent by a data serial port of a second chip and identifies serial port forms of the serial port data, wherein the serial port forms include three types of SPI/I2C/UART, and the decoder selecting module automatically selects a serial port form corresponding to a second SPI/I2C/UART decoder;
setting and selecting a conversion requirement of a serial port form of the controller module through software; the serial port forms of SPI, I2C and UART are converted two by two respectively, and the conversion requirements comprise: six conversion requirements of SPI converting to I2C, SPI converting to UART, I2C converting to SPI, I2C converting to UART, UART converting to SPI and UART converting to I2C; the encoder selection module configures a first SPI/I2C/UART encoder of the first serial port compiling module according to conversion requirements; the encoder selection control module is matched with the decoder selection module to determine the transmission direction of the data, namely, the decoder of the second serial port compiling module and the encoder of the first serial port compiling module are determined according to one of six conversion requirements, and then the conversion form and the transmission direction of the serial port data are determined;
the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to one of the six conversion requirements and the transmission direction of data;
the second SPI/I2C/UART decoder receives the serial port data sent by the second decoder selection module and converts the serial port data into unified binary number data, wherein the unified standard binary number data comprise common binary number data types such as 8 bits, 16 bits, 32 bits and the like; the second SPI/I2C/UART decoder transmits the converted binary number data to the FIFO module; the FIFO module stores the binary digit data and sends the binary digit data to a corresponding first SPI/I2C/UART encoder; the first SPI/I2C/UART encoder converts the system number data into serial port data in a serial port form corresponding to the conversion requirement and sends the serial port data to the first decoder selecting unit; and the first decoder selection unit sends the serial port data to the first chip through the corresponding serial port.
Specifically, in the encoding and decoding processes of the first serial port compiling module and the second serial port compiling module, the first SPI decoder converts serial port data of the MOSI serial port of the first chip into binary number data; the first SPI encoder sends the converted serial port data to the MISO serial port of the first chip; the first I2C decoder converts serial port data of the SDA serial port of the first chip into binary number data; the first I2C encoder sends the converted serial port data to an SDA serial port of the first chip; the first UART decoder converts serial port data of a TX serial port of a first chip into binary number data; the first UART encoder transmits the converted serial port data to an RX serial port of the first chip; the second SPI decoder converts serial port data of the MOSI serial port of the second chip into binary number data; the second SPI encoder sends the converted serial port data to the MISO serial port of the second chip; the second I2C decoder converts serial port data of the SDA serial port of the second chip into binary number data; the second I2C encoder sends the converted serial port data to an SDA serial port of a second chip; the second UART decoder converts serial port data of a TX serial port of the second chip into binary number data; and the second UART encoder transmits the converted serial port data to an RX serial port of a second chip.
In the data transmission process from the first SPI/I2C/UART decoder of the first serial port compiling module to the second SPI/I2C/UART encoder of the second serial port compiling module, and in the data transmission process from the second SPI/I2C/UART decoder of the second serial port compiling module to the first SPI/I2C/UART encoder of the first serial port compiling module, the first FIFO unit/the second FIFO unit/the third FIFO unit of the FIFO module stores the data of the binary number.
Specifically, in the FIFO configuration selection module, a user can configure, by software, a data input bit width, a storage depth, and a data output bit width of each FIFO unit in the FIFO module according to the size of the actual transmission data frame number and the bit width of the data; meanwhile, the FIFO configuration selection module configures the binary numerical data to any one or more FIFO units in non-data transmission for data storage and transmission according to the conversion requirement set by the software and the transmission direction of the data and the storage depth and the transmission state of each FIFO unit of the FIFO module;
the first FIFO unit, the second FIFO unit and the third FIFO unit are three independent data storage and transmission units, one FIFO unit can only receive one transmission data and send one transmission data at the same time, and meanwhile, the three FIFO units can simultaneously and independently transmit three groups of data.
The first/second/third FIFO elements select the configuration information of the module according to the FIFO configuration, such as: the method comprises the following steps that a first chip sends SPI serial port data, a second chip receives I2C serial port data as an example, the first chip sends the SPI serial port data to a first decoder selecting unit of a decoder selecting module through an MOSI serial port, the first decoder selects a serial port form for automatically identifying the serial port data and sends the serial port data to a first SPI decoder of a first serial port compiling module, and meanwhile, the encoder selecting module cooperates with the decoder selecting module to determine a second I2C encoder of the second serial port compiling module as a compiling end of the data and determine the transmission direction of the data; the FIFO configuration selection module automatically identifies that a first FIFO unit and a second FIFO unit of the FIFO module are in a non-data transmission transition state, and configures the first FIFO unit and the second FIFO unit as data storage units according to the data volume of transmission data and the storage depth of each FIFO unit; the first SPI decoder converts SPI serial data into 16-system numerical data, the first FIFO unit and the second FIFO unit receive the 16-system numerical data output by the first SPI decoder, sequentially store the 16-system numerical data according to the storage depth, and sequentially send the 16-system numerical data to the second I2C encoder according to the FIFO storage and transmission protocol; the second I2C encoder receives the 16-system number data sent by the first FIFO unit and the second FIFO unit, converts the 16-system number data into I2C serial data and sends the data to the second decoder selecting unit; the second decoder selection unit identifies the serial port form of the serial port data according to the received I2C serial port data, and sends the I2C serial port data to an SDA serial port of the second chip; the second chip receives I2C serial port data through the SDA serial port; and completing the serial port form conversion of the serial port data.
The invention provides a multi-communication serial port bidirectional conversion circuit and a method, wherein serial port form conversion of serial port data is set through software, an encoder selection module automatically identifies the serial port form of the serial port data when receiving the serial port data, selects a corresponding decoder, matches the encoder corresponding to the serial port form conversion through the encoder selection module and determines the transmission direction of the data, and automatic decoding of the decoder and automatic encoding of the encoder are realized; the FIFO configuration selection module can set the storage depth and the data bit width of each FIFO unit of the FIFO module through software according to the data volume of data transmission so as to be compatible with systems with different bit numbers such as 8 bits, 16 bits, 32 bits and the like; meanwhile, the FIFO configuration selection module can automatically configure one or more FIFO units in a non-transmission state for data storage and transmission according to the storage depth and the transmission state of each FIFO unit, and each FIFO unit can also independently transmit data, so that the data storage and transmission efficiency is greatly improved.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

Claims (8)

1. The utility model provides a two-way converting circuit of many communication serial ports which characterized in that: the device comprises a selection controller module, an FIFO module, a first serial port compiling module, a second serial port compiling module and a decoder selection module; the selection controller module comprises an encoder selection module and an FIFO configuration selection module; the FIFO module consists of a plurality of FIFO units; the decoder selection module comprises a first decoder selection unit and a second decoder selection unit; the selection controller module is connected with the first serial port compiling module and the second serial port compiling module through the encoder selection module, and the selection controller module is connected with the FIFO units of the FIFO module through the FIFO configuration selection module.
2. The multi-communication serial port bidirectional conversion circuit according to claim 1, characterized in that: the first serial port compiling module consists of a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; the second serial port compiling module consists of a second SPI coder/decoder, a second I2C coder/decoder and a second UART coder/decoder; the FIFO module is provided with three FIFO units, namely a first FIFO unit, a second FIFO unit and a third FIFO unit; the transmission data types among the encoder/decoder of the first serial port module, the encoder/decoder of the second serial port module, the three FIFO units of the FIFO module and the decoder selection module comprise SPI data, I2C data and UART data.
3. The multi-communication serial port bidirectional conversion circuit according to claim 2, characterized in that: the first decoder selection unit is connected with the first chip through an MOSI/MOSO serial port, an SDA serial port and an RX/TX serial port; the second decoder selection unit is connected with the second chip through an MOSI/MOSO serial port, an SDA serial port and an RX/TX serial port; the first decoder selection unit is connected with a first SPI codec, a first I2C codec and a first UART codec of the first serial port codec module; the second decoder selection unit is connected with a second SPI codec, a second I2C codec and a second UART codec of the second serial port codec module.
4. The multi-communication serial port bidirectional conversion circuit according to claim 3, characterized in that: the FIFO module is connected with the first serial port compiling module and the second serial port compiling module; three units of a first FIFO unit, a second FIFO unit and a third FIFO unit of the FIFO module are all connected with a first SPI coder/decoder, a first I2C coder/decoder and a first UART coder/decoder; and three units of the first FIFO unit, the second FIFO unit and the third FIFO unit of the FIFO module are all connected with the second SPI coder/decoder, the second I2C coder/decoder and the second UART coder/decoder.
5. A multi-communication serial port bidirectional conversion method is characterized in that: the multi-communication serial port bidirectional conversion method adopts the multi-communication serial port bidirectional conversion circuit of claims 1 to 4: the multi-communication serial port bidirectional conversion circuit performs mutual conversion and transmission of three data, namely UART, I2C and SPI;
the serial port data of waiting serial port form conversion is sent by first chip, and the circuit carries out serial port form conversion to serial port data, and the serial port data after the second chip receiving conversion, its step is:
a first decoder selecting unit of the decoder selecting module receives serial port data sent by a data serial port end of a first chip, identifies a serial port form of the serial port data, and automatically selects a serial port form corresponding to a first SPI/I2C/UART decoder;
setting and selecting a conversion requirement of a serial port form of the controller module through software; the encoder selection module configures a second SPI/I2C/UART encoder according to conversion requirements and determines the transmission direction of data by matching with the decoder selection module;
the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to the conversion requirement and the transmission direction of data;
the first SPI/I2C/UART decoder receives the serial data sent by the first decoder selection module, converts the serial data into standard binary data and sends the standard binary data to the FIFO module; the FIFO module stores the binary number data and sends the binary number data to a corresponding second SPI/I2C/UART encoder; the second SPI/I2C/UART encoder converts the system number data into corresponding serial port data and sends the serial port data to the second decoder selecting unit; and the second decoder selection unit sends the serial port data to the second chip.
6. The method of claim 5, wherein the method comprises the following steps:
the second chip sends serial port data to be converted in serial port mode, the circuit converts the serial port data in serial port mode, the first chip receives the converted serial port data, and the method comprises the following steps:
a second decoder selecting unit of the decoder selecting module receives serial port data sent by a data serial port of a second chip, identifies the serial port form of the serial port data, and automatically selects a serial port form corresponding to a second SPI/I2C/UART decoder;
setting and selecting a conversion requirement of a serial port form of the controller module through software; the encoder selection module configures a first SPI/I2C/UART encoder according to conversion requirements and determines the transmission direction of data by matching with the decoder selection module;
the FIFO configuration selection module configures data storage and transmission of a plurality of FIFO units of the FIFO module according to the conversion requirement and the transmission direction of the data;
the second SPI/I2C/UART decoder receives the serial data sent by the second decoder selection module, converts the serial data into standard binary data and sends the standard binary data to the FIFO module; the FIFO module stores the data of the binary system number and sends the data to a corresponding first SPI/I2C/UART encoder; the first SPI/I2C/UART encoder converts the system number data into corresponding serial port data and sends the serial port data to the first decoder selecting unit; the first decoder selection unit sends serial port data to the first chip.
7. The method of claim 5 and claim 6, wherein the method comprises the following steps: the FIFO configuration selection module configures the binary numerical data to any one or more FIFO units in non-data transmission for data storage and transmission according to the conversion requirement and the transmission direction of the data and the storage depth and the transmission state of each FIFO unit of the FIFO module;
when the first FIFO unit/the second FIFO unit/the third FIFO unit carry out serial port form conversion of serial port data from the first chip to the second chip according to the configuration information of the FIFO configuration selection module, one or more FIFO units receive the data sent by the first SPI/I2C/UART compiler, store the data according to the storage depth of each FIFO unit, and send the stored data to the second SPI/I2C/UART encoder; when the second chip performs serial port form conversion of serial port data to the first chip, one or more FIFO units receive data sent by the second SPI/I2C/UART decoder, perform data storage according to the storage depth of each FIFO unit, and send the stored data to the first compiler SPI/I2C/UART encoder.
8. The method of claim 7, wherein the method comprises the following steps: in the FIFO configuration selection module, a user can configure the data input bit width, the storage depth and the data output bit width of each FIFO unit in the FIFO module through software according to the frame number of actual transmission data and the bit width of the data.
CN202210207651.2A 2022-03-03 2022-03-03 Bidirectional conversion circuit and method for multiple communication serial ports Active CN114595182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210207651.2A CN114595182B (en) 2022-03-03 2022-03-03 Bidirectional conversion circuit and method for multiple communication serial ports

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210207651.2A CN114595182B (en) 2022-03-03 2022-03-03 Bidirectional conversion circuit and method for multiple communication serial ports

Publications (2)

Publication Number Publication Date
CN114595182A true CN114595182A (en) 2022-06-07
CN114595182B CN114595182B (en) 2023-04-07

Family

ID=81808191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210207651.2A Active CN114595182B (en) 2022-03-03 2022-03-03 Bidirectional conversion circuit and method for multiple communication serial ports

Country Status (1)

Country Link
CN (1) CN114595182B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020725A1 (en) * 2004-07-20 2006-01-26 Dropps Frank R Integrated fibre channel fabric controller
CN101127023A (en) * 2006-08-17 2008-02-20 四川维肯电子有限公司 Universal asynchronous serial extended chip of multi-bus interface
CN203838699U (en) * 2014-05-29 2014-09-17 国家电网公司 Multifunctional debugging interface conversion device
US20150156060A1 (en) * 2013-11-29 2015-06-04 Lsis Co., Ltd. Bidirectional packet transfer fail-over switch for serial communication
CN106445853A (en) * 2016-08-30 2017-02-22 天津天地伟业数码科技有限公司 Transformation method of SPI (Serial Peripheral Interface) and UART (Universal Asynchronous Receiver/Transmitter) interface on the basis of FPGA (Field Programmable Gate Array)
CN106951386A (en) * 2017-04-21 2017-07-14 济南浪潮高新科技投资发展有限公司 A kind of multifunction converter based on FPGA
CN109885524A (en) * 2019-02-25 2019-06-14 苏州长风航空电子有限公司 A kind of serial ports expansion method of the airborne indicator based on FPGA
CN210804407U (en) * 2019-08-29 2020-06-19 珠海巨晟科技股份有限公司 Serial port-to-single line communication module with level selection function
CN214225912U (en) * 2021-01-26 2021-09-17 张学勤 Serial port level internal selection switching equipment and system
CN113946533A (en) * 2021-09-18 2022-01-18 中国航发南方工业有限公司 Data storage device and serial port communication optimization method thereof
WO2022037176A1 (en) * 2020-08-18 2022-02-24 Oppo广东移动通信有限公司 Inter-core communication method and apparatus, electronic assembly, and electronic device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060020725A1 (en) * 2004-07-20 2006-01-26 Dropps Frank R Integrated fibre channel fabric controller
CN101127023A (en) * 2006-08-17 2008-02-20 四川维肯电子有限公司 Universal asynchronous serial extended chip of multi-bus interface
US20150156060A1 (en) * 2013-11-29 2015-06-04 Lsis Co., Ltd. Bidirectional packet transfer fail-over switch for serial communication
CN203838699U (en) * 2014-05-29 2014-09-17 国家电网公司 Multifunctional debugging interface conversion device
CN106445853A (en) * 2016-08-30 2017-02-22 天津天地伟业数码科技有限公司 Transformation method of SPI (Serial Peripheral Interface) and UART (Universal Asynchronous Receiver/Transmitter) interface on the basis of FPGA (Field Programmable Gate Array)
CN106951386A (en) * 2017-04-21 2017-07-14 济南浪潮高新科技投资发展有限公司 A kind of multifunction converter based on FPGA
CN109885524A (en) * 2019-02-25 2019-06-14 苏州长风航空电子有限公司 A kind of serial ports expansion method of the airborne indicator based on FPGA
CN210804407U (en) * 2019-08-29 2020-06-19 珠海巨晟科技股份有限公司 Serial port-to-single line communication module with level selection function
WO2022037176A1 (en) * 2020-08-18 2022-02-24 Oppo广东移动通信有限公司 Inter-core communication method and apparatus, electronic assembly, and electronic device
CN214225912U (en) * 2021-01-26 2021-09-17 张学勤 Serial port level internal selection switching equipment and system
CN113946533A (en) * 2021-09-18 2022-01-18 中国航发南方工业有限公司 Data storage device and serial port communication optimization method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李文亮等: "用FPGA实现异步串口与同步串口的转换", 《电子工程师》 *

Also Published As

Publication number Publication date
CN114595182B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN101937412B (en) System on chip and access method thereof
CN1719363A (en) Hard ware extension method of programmable logic controller
CN105243044B (en) Management system and management method based on serial ports
CN103972909A (en) TSC (thyristor switched capacitor) system and RS485 communication method thereof based on FPGA (Field Programmable Gate Array)
CN101163148A (en) Ethernet transmission method of supporting non-standard velocity and corresponding device and access equipment
KR102146323B1 (en) Apparatus for converting interface of Programmable Logic Controller system and the PLC system
CN114595182B (en) Bidirectional conversion circuit and method for multiple communication serial ports
CN101493806A (en) Communication adapter and data-transmission method thereof
CN105472782A (en) Wireless communication terminal
CN1316387C (en) Series interface bus communications controller
CN202916008U (en) Multichannel optical power meter
CN205249496U (en) Wireless communication terminal
CN210804414U (en) Circuit with reusable communication interface
CN101315615A (en) Multichannel communication system and duplex selection distribution method of communication serial port in system
US5237572A (en) Active remote module for the attachment of user equipments to a communication processing unit
CN112800001A (en) High-performance Internet of things hardware platform and method based on ARM platform architecture
CN115037809B (en) Industrial wireless gateway system supporting multiple protocols
CN101368876B (en) Testing bench frame control system for open type internal combustion engine
CN201178429Y (en) General field bus receiver based on Ternary content addressable memory
CN116614159B (en) Twisted pair isolation type communication transmission method for battery monitoring
CN1964300A (en) A readable-writable communication controller of serial interface bus
CN110232038A (en) A kind of industrial personal computer intelligent communication serial port device
CN220693178U (en) Self-identification station number device
CN216871114U (en) 10Mbps multi-protocol serial port card of PMC specification
CN201118598Y (en) CobraNet dual optical transreceiver with remote monitoring function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant