Nothing Special   »   [go: up one dir, main page]

CN117349208A - Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure - Google Patents

Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure Download PDF

Info

Publication number
CN117349208A
CN117349208A CN202311319142.XA CN202311319142A CN117349208A CN 117349208 A CN117349208 A CN 117349208A CN 202311319142 A CN202311319142 A CN 202311319142A CN 117349208 A CN117349208 A CN 117349208A
Authority
CN
China
Prior art keywords
daisy chain
daisy
frame structure
read
serial interface
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.)
Pending
Application number
CN202311319142.XA
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.)
Xinsiyuan Microelectronics Co ltd
Original Assignee
Xinsiyuan Microelectronics 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 Xinsiyuan Microelectronics Co ltd filed Critical Xinsiyuan Microelectronics Co ltd
Priority to CN202311319142.XA priority Critical patent/CN117349208A/en
Publication of CN117349208A publication Critical patent/CN117349208A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • 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/4247Bus transfer protocol, e.g. handshake; Synchronisation on a daisy chain bus
    • 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

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)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides an isolated serial interface bidirectional communication method, a system, a medium and a master controller based on a daisy chain frame structure. Through adopting the bidirectional daisy chain communication mode of the isoSPI, CRC check is added to the command and the data in the communication process, so that the safety and the correctness of the data and the command are ensured; when the daisy chain is broken, the broken position can be checked, and meanwhile, the MCU can continue to communicate with the broken daisy chain through a bidirectional daisy chain communication mode.

Description

Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, a system, a medium, and a master controller for two-way communication with an isolated serial interface based on a daisy chain frame structure.
Background
For HEVs, PHEVs, and battery packs in EV drivetrains or energy storage, one of the key factors to achieve high reliability and stability is the electronic components used in the Battery Management System (BMS). In larger scale systems, different AFE monitor boards are not grounded together, resulting in signals subject to large differences in common mode voltage during communication. While electrical noise in the battery and associated equipment operating environment places very stringent requirements on the data communication link, the communication link carries the transmission of critical information within the vehicle. Current automotive systems utilize standard serial peripheral interfaces (e.g., SPI) to implement isolated serial communications, thereby meeting the communication requirements of a distributed battery pack BMS architecture.
Conventional slow communication interfaces (e.g., SPI) are typically single-ended unbalanced transmission schemes in which interference in the incoming signal cannot be eliminated or reduced. To achieve complete galvanic isolation while meeting security and data integrity requirements, a dedicated data isolation unit is required between each set of communication interfaces. This may be done magnetically, capacitively or optically from a microprocessor system, but the SPI has to handle 4 signal paths, thus increasing costs.
In view of this, the isolated serial interface is based on a full duplex SPI, which requires only two data lines (clock information is embedded in the data stream) compared to a normal SPI, and the isolated SPI transmits data through the two lines after the communication rate is configured.
The isolated serial interface is designed to solve the complex interference problem, and the main technology adopted is to "balance" the differential signals of two wires (neither of which is grounded), and the noise on the two wires (common mode) is almost the same. When noise is present on the conductors, the transmitted differential mode signals are relatively unaffected with respect to each other. Meanwhile, in order to deal with very large common mode noise invasion, the magnetic coupling is realized by a slim transformer, so that the isolation effect is achieved. The transformer windings couple important differential information across the dielectric barrier but do not introduce strong coupling common mode noise due to the electrical isolation employed. The last aspect is to make corresponding adjustments to the signal transmission scheme to provide a full duplex SPI active conversion that can support signal rates up to 1Mbps, while only a single twisted pair is needed for transmission.
The isolated serial interface and the SPI can adopt a daisy chain integration mode, and any modularization and function can be realized in a distributed network mode. However, when the daisy chain connection is broken, the MCU cannot communicate with the device after the breaking.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, an object of the present application is to provide a method, a system, a medium and a master controller for two-way communication of an isolated serial interface based on a daisy chain frame structure, which are used for solving the technical problem that when a daisy chain connection is broken, an MCU cannot communicate with a device after the breaking.
To achieve the above and other related objects, a first aspect of the present application provides an isolated serial interface bidirectional communication method based on a daisy chain frame structure, which is applied to a master controller; the master is communicatively connected with a plurality of devices to form a daisy chain; the method comprises the following steps: transmitting a read or write operation command to a current device in the daisy chain during a valid period of the chip select enable signal, so that the current device forwards the operation command to a next device in the daisy chain; after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous device by the current device; under the condition that the daisy chain is broken, the single daisy chain is split into two-way daisy chains, and control commands are respectively sent to the two directions to maintain a communication state with the broken devices.
In some embodiments of the first aspect of the present application, the method further comprises: the method comprises the steps of performing daisy chain breakage detection by reading an initial value of a breakage detection register in each device on a daisy chain; and/or performing daisy chain line break detection by writing a device ID into the line break detection registers of the devices on the daisy chain and then reading the value of each device line break detection register.
In some embodiments of the first aspect of the present application, the daisy chain line break detection by reading an initial value of a line break detection register in each device on the daisy chain includes: the main controller sends a read command of the broken line detection register to the devices in the daisy chain, and if the initial values of the broken line detection registers of all the devices are correctly returned, the fact that broken lines do not exist in the daisy chain is judged; if the initial values of the disconnection detection registers of all the devices cannot be correctly returned, judging that disconnection exists in the daisy chain.
In some embodiments of the first aspect of the present application, the method includes determining, by a device that cannot correctly return an initial value of a wire-break detection register, a daisy-chain wire-break position in a case where it is determined that a wire-break exists in the daisy-chain, including: among all the devices which cannot return to the initial value of the broken line register correctly, the device at the forefront position in the daisy chain is positioned, and the device before the device are in the daisy chain broken line position.
In some embodiments of the first aspect of the present application, the daisy chain line break detection by writing a device ID into a line break detection register of each device on the daisy chain and then reading the value of each device line break detection register includes: the main controller firstly writes the device ID into the broken line detection register of each device on the daisy chain; then, a reading command is sent to read the value in the broken line detection register in each device, and whether the read value is the device ID written in at the beginning is judged; if the device ID is the device ID, judging that the disconnection does not exist, otherwise, judging that the disconnection exists.
In some embodiments of the first aspect of the present application, the method includes determining, in a case where it is determined that there is a wire break in the daisy chain, a daisy chain wire break location by a device whose returned device ID is different from the initial write value, including: among all the returned devices whose device IDs are different from the initial write value, the device located at the forefront position in the daisy chain is located, with the daisy chain broken line position between the device and the device preceding it.
In some embodiments of the first aspect of the present application, the method further comprises: when the daisy chain is detected to be disconnected, the main controller splits the unidirectional daisy chain into the bidirectional daisy chain to perform disconnection detection so as to judge the disconnection positions and the number of the disconnection positions.
In some embodiments of the first aspect of the present application, when one or more wire breaks occur, the master splits a single daisy chain into two daisy chains to send control commands of the split daisy chains in two directions, respectively, so that the control commands reach the device at the wire break.
In some embodiments of the first aspect of the present application, the method comprises: the device preceding the first device in the daisy chain is the master; after receiving the read command, the first device returns the read data corresponding to the first device and the read data verification to the master controller.
In some embodiments of the first aspect of the present application, the active period of the chip select enable signal includes a period of time that elapses from when the first device receives the read/write data and the read/write data check bit until the last device completes transmitting the read/write data and the read/write data check bit.
To achieve the above and other related objects, a second aspect of the present application provides an isolated serial interface bidirectional communication system based on a daisy chain frame structure, including a master controller and a plurality of devices communicatively connected to the master controller to build up a daisy chain; wherein: the master controller sends a read or write operation command to a current device in the daisy chain in a valid period of a chip selection enabling signal so that the current device forwards the operation command to a next device in the daisy chain; after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous device by the current device; under the condition that the daisy chain is broken, the single daisy chain is split into two-way daisy chains, and control commands are respectively sent to the two directions to maintain a communication state with the broken devices.
To achieve the above and other related objects, a third aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the daisy chain frame structure based isolated serial interface bi-directional communication method.
To achieve the above and other related objects, a fourth aspect of the present application provides a master controller, including: a processor and a memory; the memory is used for storing a computer program, and the processor is used for executing the computer program stored by the memory, so that the master controller executes the isolated serial interface bidirectional communication method based on the daisy chain frame structure.
As described above, the isolated serial interface bidirectional communication method, system, medium and master controller based on the daisy chain frame structure has the following beneficial effects: the device communication in the invention is based on a daisy chain frame structure, adopts command and data check bits, ensures the quasi-security and correctness of the command and the data, and increases the reliability of the daisy chain communication. Through adopting the bidirectional daisy chain communication mode of the isoSPI, CRC check is added to the command and the data in the communication process, so that the safety and the correctness of the data and the command are ensured; when the daisy chain is broken, the broken position can be checked, and meanwhile, the MCU can continue to communicate with the broken daisy chain through a bidirectional daisy chain communication mode.
Drawings
Fig. 1 is a schematic flow chart of an isolated serial interface bidirectional communication method based on a daisy chain frame structure according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a daisy chain frame structure according to an embodiment of the present application.
FIG. 3 is a timing diagram of a daisy-chained write command according to one embodiment of the present application.
FIG. 4 is a timing diagram of a daisy chain read command according to one embodiment of the present application.
Fig. 5A is a schematic diagram illustrating a daisy chain broken line position detection according to an embodiment of the present application.
Fig. 5B is a schematic diagram illustrating another daisy chain broken line position detection according to an embodiment of the present application.
FIG. 6 is a schematic diagram of bi-directional daisy-chain break recovery in an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a master according to an embodiment of the present application.
Detailed Description
Other advantages and effects of the present application will become apparent to those skilled in the art from the present disclosure, when the following description of the embodiments is taken in conjunction with the accompanying drawings. The present application may be embodied or carried out in other specific embodiments, and the details of the present application may be modified or changed from various points of view and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
It is noted that in the following description, reference is made to the accompanying drawings, which describe several embodiments of the present application. It is to be understood that other embodiments may be utilized and that mechanical, structural, electrical, and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description is not to be taken in a limiting sense, and the scope of embodiments of the present application is defined only by the claims of the issued patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. Spatially relative terms, such as "upper," "lower," "left," "right," "lower," "upper," and the like, may be used herein to facilitate a description of one element or feature as illustrated in the figures as being related to another element or feature.
In this application, unless specifically stated and limited otherwise, the terms "mounted," "connected," "secured," "held," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art as the case may be.
Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes," and/or "including" specify the presence of stated features, operations, elements, components, items, categories, and/or groups, but do not preclude the presence, presence or addition of one or more other features, operations, elements, components, items, categories, and/or groups. The terms "or" and/or "as used herein are to be construed as inclusive, or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; A. b and C). An exception to this definition will occur only when a combination of elements, functions or operations are in some way inherently mutually exclusive.
In order to solve the problems in the background art, the invention provides an isolated serial interface bidirectional communication method, system, medium and master controller based on a daisy chain frame structure, aiming at adopting command and data check bits, ensuring the quasi-safety and correctness of the command and the data and increasing the reliability of the daisy chain communication. Through adopting the bidirectional daisy chain communication mode of the isoSPI, CRC check is added to the command and the data in the communication process, so that the safety and the correctness of the data and the command are ensured; when the daisy chain is broken, the broken position can be checked, and meanwhile, the MCU can continue to communicate with the broken daisy chain through a bidirectional daisy chain communication mode.
Meanwhile, in order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be further described in detail by the following examples with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Before explaining the present invention in further detail, terms and terminology involved in the embodiments of the present invention will be explained, and the terms and terminology involved in the embodiments of the present invention are applicable to the following explanation:
<1> hev (Hybrid Electrical Vehicle): hybrid electric vehicles are vehicles equipped with both a thermal power source and an electric power source. By using the motor on the hybrid electric vehicle, the power system can be flexibly adjusted according to the actual running condition requirement of the whole vehicle, and the engine keeps working in the region with the best comprehensive performance, so that the oil consumption and the emission are reduced.
<2> PHEV (Plug-in Hybrid Electrical Vehicle): a plug-in hybrid electric vehicle is a new energy vehicle between a pure electric vehicle and a fuel oil vehicle, and comprises an engine, a transmission system, an oil way and an oil tank of a traditional vehicle. There are also batteries, motors, control circuits for electric vehicles.
<3> ev (Electrical Vehicle): a pure electric automobile.
<4> daisy chain: a distributed communication technology can connect a plurality of computers together to form a chain, and each computer can send information to other computers in the chain. Daisy-chain communication organizes connected computers in a mesh structure, each of which can receive and transmit information, such a mesh structure resembling a daisy chain.
<5> isospi: and the isolation SPI is only required to be provided with two wires compared with the common SPI, and after the communication rate is configured, the isolation SPI transmits data through the two wires.
<6> CRC (Cyclic Redundancy Check) check: cyclic redundancy check, abbreviated as cyclic code, is a check code with error detection and correction capabilities, and aims to establish a contracted relation between data bits and check bits through a certain mathematical operation.
Embodiments of the present invention provide an isolated serial interface bidirectional communication method based on a daisy chain frame structure, a system of the isolated serial interface bidirectional communication method based on the daisy chain frame structure, and a storage medium storing an executable program for implementing the isolated serial interface bidirectional communication method based on the daisy chain frame structure. With respect to implementation of the isolated serial interface bidirectional communication method based on the daisy chain frame structure, an exemplary implementation scenario of the isolated serial interface bidirectional communication based on the daisy chain frame structure will be described.
Referring to fig. 1, a flow chart of an isolated serial interface bidirectional communication method based on a daisy chain frame structure in an embodiment of the invention is shown.
To facilitate a better understanding of the daisy chain frame structure in embodiments of the present invention by those skilled in the art, fig. 2 is illustrated below. The daisy chain frame structure includes: a 16-bit command bit CMD, a 16-bit command check bit CMDPEC, a 48-bit DATA, a 16-bit DATA check bit DATAPEC; the data and the data check bits of the devices 1 to N are sequentially ordered, and the writing command and the reading command adopt the format; wherein N is an integer greater than or equal to 1. It is worth to describe that the daisy chain frame structure in the embodiment of the invention adopts the command bit and the data check bit, so that the safety and the accuracy of the command and the data can be ensured, and the reliability of the daisy chain communication can be increased.
In the embodiment of the invention, the isolated serial interface bidirectional communication method based on the daisy chain frame structure is applied to a master controller; the master communicatively connects a plurality of devices to build up a daisy chain. The isolated serial interface bidirectional communication method based on the daisy chain frame structure mainly comprises the following steps:
step S1: and transmitting a read or write operation command to the current device in the daisy chain during the valid period of the chip selection enable signal so that the current device forwards the operation command to the next device in the daisy chain.
For ease of description and also for understanding by those skilled in the art, the description below will be provided in connection with fig. 3 and 4, respectively. FIG. 3 shows a timing diagram of a daisy-chain write command, and FIG. 4 shows a timing diagram of a daisy-chain read command.
CS represents a chip selection enabling signal, and in the transmission process of the daisy chain writing command, the chip selection enabling signal CS needs to be kept low and valid until the writing data and the writing data check bit of the last device N are sent completely, and the chip selection enabling signal CS can be pulled high. The active period of the chip select enable signal CS includes the period of time that elapses from the first device receiving the read/write data and the read/write data check bits until the last device finishes transmitting the read/write data and the read/write data check bits.
In fig. 3, the write command is forwarded to device 2 immediately after device 1 receives the write command, and similarly, device N-1 forwards the write command to device N immediately after receiving the write command. In fig. 4, the read command is forwarded to device 2 immediately after device 1 receives the read command, and similarly, device N-1 forwards the read command to device N immediately after receiving the read command.
Step S2: after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous device by the current device; under the condition that the daisy chain is broken, the single daisy chain is split into two-way daisy chains, and control commands are respectively sent to the two directions to maintain a communication state with the broken devices.
Illustratively, referring to FIG. 3, when device 1 receives the write data and write data check bits of device 1, the write data and write data check bits of device 2 are forwarded to device 2, and when device N-1 receives the write data and write data check bits of device N-1, the write data and write data check bits of device N are forwarded to device N. That is, after the current device receives the write command, the write data and the write data check bit corresponding to the current device are received and the write data check bit corresponding to the next device are forwarded to the next device.
In some examples, a device preceding a first device in the daisy chain is a master; after receiving the read command, the first device returns the read data corresponding to the first device and the read data verification to the master controller.
Illustratively, referring to FIG. 4, device 1 returns the read data and read data parity bits of device 1 to the master upon receipt of a read command, device 2 returns the read data and read data parity bits of device 2 to device 1 upon receipt of a read command, and device N returns the read data and read data parity bits of device N to device N-1 upon receipt of a read command. Further, the device 1 forwards the received read data and read data check bits of the device 2 after sending the read data and read data check bits of the device 1, the device 2 forwards the received read data and read data check bits of the device 3 after sending the read data and read data check bits of the device 2, and the same device N-1 forwards the received read data and read data check bits of the device N after sending the read data and read data check bits of the device N-1.
In an embodiment of the present invention, the method further includes performing daisy chain line break detection by reading an initial value of a line break detection register in each device on the daisy chain.
Specifically, the master controller sends a read command of the broken line detection register to the devices in the daisy chain, and if the initial values of the broken line detection registers of all the devices are correctly returned, the fact that broken lines do not exist in the daisy chain is judged; if the initial values of the disconnection detection registers of all the devices cannot be correctly returned, judging that disconnection exists in the daisy chain.
Further, in the case where it is judged that a broken line exists in the daisy chain, the broken line position of the daisy chain is judged by a device which cannot correctly return the initial value of the broken line detection register. The specific method for judging the daisy chain broken line position by the device which can not correctly return the initial value of the broken line detection register comprises the following steps: among all the devices which cannot return to the initial value of the broken line register correctly, the device at the forefront position in the daisy chain is positioned, and the device before the device are in the daisy chain broken line position.
Illustratively, the description is provided in connection with FIG. 5A: the daisy chain is connected with a master controller, a device 1, a device 2, a device 3 and a device 4, wherein each device comprises 48-bit broken line detection registers, and the initial value of each broken line detection register is 0x5A5A5A5A5A. The controller sends a command for reading the initial values of the disconnection detection registers, and if the initial values of the 4 disconnection detection registers can be correctly returned, for example, the 4 initial values are all 0x5A5A5A5A5A, the situation that disconnection exists is indicated; if the initial values of the 4 disconnection detection registers cannot be correctly returned, for example, 2 initial values are returned to be 0x5A, and the other 2 initial values are returned to be 0xFFFFFFFFFF, it is indicated that a disconnection condition exists, and the disconnection position is between the device 2 and the device 3.
In an embodiment of the present invention, the method further includes performing daisy chain line break detection by first writing a device ID into the line break detection registers of the devices on the daisy chain and then reading the value of each device line break detection register.
Specifically, the main controller firstly writes the device ID into the broken line detection register of each device on the daisy chain, and then sends a read command to read the value in the broken line detection register of each device, and judges whether the read value is the device ID written at the beginning; if the device ID is determined, the device ID indicates that the disconnection does not exist, otherwise, the device ID indicates that the disconnection exists.
Further, in the case where it is judged that there is a broken line in the daisy chain, the daisy chain broken line position is judged by a device whose returned device ID is different from the initial writing value. The specific method for judging the daisy chain disconnection position by the returned device ID and the device with different initial writing values comprises the following steps: among all the returned devices whose device IDs are different from the initial write value, the device located at the forefront position in the daisy chain is located, with the daisy chain broken line position between the device and the device preceding it.
Illustratively, the description is provided in connection with FIG. 5B: if there is no disconnection, the master writes ID0, ID1, ID2, and ID3 into the disconnection detection registers of the devices 1, 2, 3, and 4, respectively, and the register values returned to the master by the disconnection detection registers are ID0, ID1, ID2, and ID3, respectively, so that the daisy-chain communication is normal and there is no disconnection. When the wire breakage exists, the main controller writes the ID0, the ID1, the ID2 and the ID3 into the wire breakage detection registers of the device 1, the device 2, the device 3 and the device 4, and the register values returned to the main controller by the wire breakage detection registers are the ID0, the ID1 and the ID FFFFFFFFFF, FFFFFFFFFF respectively, so that the situation that the wire breakage exists in the daisy chain can be judged.
In an embodiment of the present invention, the method further includes: when the daisy chain is detected to be disconnected, the main controller splits the unidirectional daisy chain into the bidirectional daisy chain to perform disconnection detection so as to judge the disconnection positions and the number of the disconnection positions.
Preferably, when one broken line occurs, the master breaks a single daisy chain into two daisy chains, so as to send control commands of the broken daisy chains to two directions respectively, so that the control commands reach devices at the broken line. It should be appreciated that for the case where only one broken line occurs, by splitting a single daisy chain into two daisy chains, it is possible to ultimately communicate with the broken device; for the case of multiple breaks, by splitting a single daisy chain into two daisy chains, communication can be established with at least some broken devices, but still some devices (typically in the middle) may not be able to communicate.
Illustratively, the explanation is as follows in connection with FIG. 6: the daisy chain is connected with a master controller MCU, a device 1, a device 2, a device 3 and a device 4. Before disconnection occurs, the single daisy chain connection mode is that the master MCU is connected with the device 1, the device 1 is connected with the device 2, the device 2 is connected with the device 3, and the device 3 is connected with the device 4 again. After the disconnection, the connection between the device 2 and the device 3 is broken, and the single daisy chain is split into two daisy chains, namely, a left one and a right one which extend from the master in fig. 6, the transmission path of the left daisy chain is from the master MCU to the device 1 and then to the device 2, the transmission path of the right daisy chain is from the master MCU to the device 4 and then to the device 3, and the master MCU sends out commands through the two daisy chains respectively, so that even if the device 2 and the device 3 are disconnected, the control of the master MCU on the two devices is not affected, and the system can continue to work normally.
Notably, the invention adopts the bidirectional daisy chain communication mode of the isoSPI, and the CRC check is added to the command and the data in the communication process, so that the safety and the correctness of the data and the command are ensured; when the daisy chain is broken, the broken position can be checked, and meanwhile, the MCU can continue to communicate with the broken daisy chain through a bidirectional daisy chain communication mode. The isoSPI is an isolated SPI, and compared with a common SPI, the isoSPI only needs two wires, and after the communication rate is configured, the isolated SPI transmits data through the two wires. In isoSPI communication, data 0 consists of one positive pulse and one negative pulse, and data 1 consists of one negative pulse and one positive pulse.
The embodiment of the invention also provides an isolated serial interface bidirectional communication system based on a daisy chain frame structure, which comprises a main controller and a plurality of devices which are in communication connection with the main controller to form a daisy chain; wherein: the master controller sends a read or write operation command to a current device in the daisy chain in a valid period of a chip selection enabling signal so that the current device forwards the operation command to a next device in the daisy chain; after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous and next devices by the current device; under the condition that the daisy chain is broken, the main controller breaks the single daisy chain into a bidirectional daisy chain, and sends control commands to two directions respectively to maintain a communication state with the broken devices.
The master controller in the embodiment of the present invention includes, but is not limited to, for example, a micro control unit (Microcontroller Unit, MCU), a single Chip microprocessor (Microprocessor Unit, MPU), a central processing unit (Central Processing Unit, CPU), a programmable logic device (Field Programmable Gate Array, FPGA), a System on Chip (SoC) in which a plurality of functional modules and peripherals are integrated, and the like.
It should be noted that: in the isolated serial interface bidirectional communication system based on the daisy chain frame structure provided in the above embodiment, when performing isolated serial interface bidirectional communication based on the daisy chain frame structure, only the division of the program modules is used for illustration, and in practical application, the processing allocation can be completed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the isolated serial interface bidirectional communication system based on the daisy chain frame structure provided in the above embodiment and the isolated serial interface bidirectional communication method based on the daisy chain frame structure belong to the same concept, and the detailed implementation process of the system is detailed in the method embodiment, which is not described herein.
Referring to fig. 7, an alternative hardware structure schematic diagram of a master controller 700 according to an embodiment of the present invention may be shown, where the master controller 700 may be a mobile phone, a computer device, a tablet device, a personal digital processing device, a factory background processing device, or the like. The isolated serial interface bidirectional communication master 700 based on the daisy chain frame structure includes: at least one processor 701, memory 702, at least one network interface 704, and a user interface 706. The various components in the device are coupled together by a bus system 705. It is to be appreciated that the bus system 705 is employed to facilitate connection communications between these components. The bus system 705 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as bus systems in fig. 7.
The user interface 706 may include, among other things, a display, keyboard, mouse, trackball, click gun, keys, buttons, touch pad, or touch screen, etc.
It is to be appreciated that the memory 702 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), a programmable Read Only Memory (PROM, programmable Read-Only Memory), which serves as an external cache, among others. By way of example, and not limitation, many forms of RAM are available, such as static random Access Memory (SRAM, staticRandom Access Memory), synchronous static random Access Memory (SSRAM, synchronous Static RandomAccess Memory). The memory described by embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 702 in embodiments of the present invention is used to store various types of data to support the operation of the isolated serial interface bi-directional communication master 700 based on a daisy chain frame structure. Examples of such data include: any executable programs for operating on the daisy chain frame structure based isolated serial interface bi-directional communication master 700, such as the operating system 7021 and the application programs 7022; the operating system 7021 contains various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks. The application programs 7022 may include various application programs such as a media player (MediaPlayer), a Browser (Browser), and the like for implementing various application services. The isolated serial interface bidirectional communication method based on the daisy chain frame structure provided by the embodiment of the invention can be contained in the application program 7022.
The method disclosed in the above embodiment of the present invention may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 may be a general purpose processor, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 701 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. The general purpose processor 701 may be a microprocessor or any conventional processor or the like. The steps of the accessory optimization method provided by the embodiment of the invention can be directly embodied as the execution completion of the hardware decoding processor or the execution completion of the hardware and software module combination execution in the decoding processor. The software modules may be located in a storage medium having memory and a processor reading information from the memory and performing the steps of the method in combination with hardware.
In an exemplary embodiment, the daisy chain frame structure based isolated serial interface bi-directional communication master 700 may be used by one or more application specific integrated circuits (ASICs, application Specific Integrated Circuit), DSPs, programmable logic devices (PLDs, programmable Logic Device), complex programmable logic devices (CPLDs, complex Programmable LogicDevice) for performing the aforementioned methods.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by computer program related hardware. The aforementioned computer program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
In the embodiments provided herein, the computer-readable storage medium may include read-only memory, random-access memory, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, U-disk, removable hard disk, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. In addition, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable and data storage media do not include connections, carrier waves, signals, or other transitory media, but are intended to be directed to non-transitory, tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
In summary, the present application provides a two-way communication method, system, medium and master controller for an isolated serial interface based on a daisy chain frame structure, where the device communication in the present invention is based on the daisy chain frame structure, and command and data check bits are adopted to ensure the quasi-security and correctness of the command and data, and increase the reliability of the daisy chain communication. Through adopting the bidirectional daisy chain communication mode of the isoSPI, CRC check is added to the command and the data in the communication process, so that the safety and the correctness of the data and the command are ensured; when the daisy chain is broken, the broken position can be checked, and meanwhile, the MCU can continue to communicate with the broken daisy chain through a bidirectional daisy chain communication mode. Therefore, the method effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles of the present application and their effectiveness, and are not intended to limit the application. Modifications and variations may be made to the above-described embodiments by those of ordinary skill in the art without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications and variations which may be accomplished by persons skilled in the art without departing from the spirit and technical spirit of the disclosure be covered by the claims of this application.

Claims (10)

1. The isolated serial interface bidirectional communication method based on the daisy chain frame structure is characterized by being applied to a master controller; the master is communicatively connected with a plurality of devices to form a daisy chain; the method comprises the following steps:
transmitting a read or write operation command to a current device in the daisy chain during a valid period of the chip select enable signal, so that the current device forwards the operation command to a next device in the daisy chain;
after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous device by the current device;
under the condition that the daisy chain is broken, the single daisy chain is split into two-way daisy chains, and control commands are respectively sent to the two directions to maintain a communication state with the broken devices.
2. The daisy chain frame structure based isolated serial interface bi-directional communication method of claim 1 wherein said method further comprises: the method comprises the steps of performing daisy chain breakage detection by reading an initial value of a breakage detection register in each device on a daisy chain; and/or performing daisy chain line break detection by writing a device ID into the line break detection registers of the devices on the daisy chain and then reading the value of each device line break detection register.
3. The method for two-way communication of an isolated serial interface based on a daisy-chain frame structure of claim 2 wherein said daisy-chain line break detection is performed by reading an initial value of a line break detection register in each device on the daisy-chain, comprising: the main controller sends a read command of the broken line detection register to the devices in the daisy chain, and if the initial values of the broken line detection registers of all the devices are correctly returned, the fact that broken lines do not exist in the daisy chain is judged; if the initial values of the disconnection detection registers of all the devices cannot be correctly returned, judging that disconnection exists in the daisy chain.
4. A method of two-way communication for an isolated serial interface based on a daisy chain frame structure according to claim 3, wherein the method comprises determining a daisy chain broken line location by a device which cannot correctly return an initial value of a broken line detection register in case of determining that a broken line exists in the daisy chain, comprising: among all the devices which cannot return to the initial value of the broken line register correctly, the device at the forefront position in the daisy chain is positioned, and the device before the device are in the daisy chain broken line position.
5. The method for bidirectional communication of an isolated serial interface based on a daisy chain frame structure of claim 2, wherein the daisy chain line break detection is performed by writing a device ID into a line break detection register of each device on the daisy chain and then reading the value of each device line break detection register, comprising: the main controller firstly writes the device ID into the broken line detection register of each device on the daisy chain; then, a reading command is sent to read the value in the broken line detection register in each device, and whether the read value is the device ID written in at the beginning is judged; if the device ID is the device ID, judging that the disconnection does not exist, otherwise, judging that the disconnection exists.
6. The method of claim 5, wherein the method includes determining a daisy chain broken line location by a device having a returned device ID different from the initial write value if it is determined that a broken line exists in the daisy chain, and the method includes: among all the returned devices whose device IDs are different from the initial write value, the device located at the forefront position in the daisy chain is located, with the daisy chain broken line position between the device and the device preceding it.
7. The daisy chain frame structure based isolated serial interface bi-directional communication method of claim 1 wherein said method further comprises: when the daisy chain is detected to be disconnected, the main controller splits the unidirectional daisy chain into the bidirectional daisy chain to perform disconnection detection so as to judge the disconnection positions and the number of the disconnection positions.
8. An isolated serial interface bidirectional communication system based on a daisy chain frame structure is characterized by comprising a master controller and a plurality of devices which are in communication connection with the master controller to form a daisy chain; wherein:
the master controller sends a read or write operation command to a current device in the daisy chain in a valid period of a chip selection enabling signal so that the current device forwards the operation command to a next device in the daisy chain; after a write command is sent to the current device, transmitting write data and write data check bits corresponding to the current device, and transmitting write data and write data check bits corresponding to a subsequent device in the daisy chain for the current device to forward to the subsequent device; after sending a read command to the current device, receiving read data and read data check bits corresponding to the device returned from the current device, and transmitting the read data and the read data check bits corresponding to the next device in the daisy chain to the current device for forwarding to the previous device by the current device; under the condition that the daisy chain is broken, the main controller breaks the single daisy chain into a bidirectional daisy chain, and sends control commands to two directions respectively to maintain a communication state with the broken devices.
9. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the daisy chain frame structure based isolated serial interface bi-directional communication method of any one of claims 1 to 7.
10. A master, comprising: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory, so that the master controller performs the isolated serial interface bidirectional communication method based on the daisy chain frame structure as claimed in any one of claims 1 to 7.
CN202311319142.XA 2023-10-11 2023-10-11 Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure Pending CN117349208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311319142.XA CN117349208A (en) 2023-10-11 2023-10-11 Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311319142.XA CN117349208A (en) 2023-10-11 2023-10-11 Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure

Publications (1)

Publication Number Publication Date
CN117349208A true CN117349208A (en) 2024-01-05

Family

ID=89362556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311319142.XA Pending CN117349208A (en) 2023-10-11 2023-10-11 Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure

Country Status (1)

Country Link
CN (1) CN117349208A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117931718A (en) * 2024-01-29 2024-04-26 合肥为国半导体有限公司 Daisy chain structure and signal transmission method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117931718A (en) * 2024-01-29 2024-04-26 合肥为国半导体有限公司 Daisy chain structure and signal transmission method thereof

Similar Documents

Publication Publication Date Title
US20080046603A1 (en) Line Diagnostic Device, Bus System, Line Diagnostic Method, Bus System Control Method, and Line Diagnostic Program
US9489328B2 (en) System on chip and method for accessing device on bus
CN103838189A (en) CAN communication monitoring protection device and vehicle
CN112380157A (en) IIC bus communication device with FIFO cache and check function
CN117349208A (en) Isolated serial interface bidirectional communication method, system, medium and master controller based on daisy chain frame structure
US20150052405A1 (en) Data bus network interface module and method therefor
US10341170B2 (en) Method for diagnosing link status in network
CN109213828B (en) Block generation method, device, equipment and storage medium
CN103389923A (en) Random access memory access bus ECC (error checking and correcting) verification device
CN113422738B (en) A kind of MCU communication service method of intelligent host
CN103389924B (en) Be applied to the ECC storage system of random access memory
US20190305983A1 (en) Method and apparatus for configuring backup path in vehicle network
US7213180B2 (en) Bus bridge circuit, bus connection system, and data error notification method for bus bridge circuit
WO2014027223A1 (en) Data bus network interface module and method therefor
US20160364245A1 (en) Operation method of communication node in automotive network
CN110134638B (en) Dual-processor data exchange method
CN114880266A (en) Fault processing method and device, computer equipment and storage medium
US7181640B2 (en) Method for controlling an external storage system having multiple external storage devices
US11861232B2 (en) Storage system and data writing method thereof
CN113037507B (en) Intelligent network card system with error detection function and error detection method
CN112445744A (en) I2C communication
WO2024131848A1 (en) System-on-chip and automobile
CN113535084B (en) Implementation method of high-capacity SAS hard disk
CN114595181B (en) Bus matching realization method for embedded system
JPS58119028A (en) Connecting system of input and output device

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