WO2014056323A1 - 一种采用串行通信接口的同步时分多路复用总线通信方法 - Google Patents

一种采用串行通信接口的同步时分多路复用总线通信方法 Download PDF

Info

Publication number
WO2014056323A1
WO2014056323A1 PCT/CN2013/075926 CN2013075926W WO2014056323A1 WO 2014056323 A1 WO2014056323 A1 WO 2014056323A1 CN 2013075926 W CN2013075926 W CN 2013075926W WO 2014056323 A1 WO2014056323 A1 WO 2014056323A1
Authority
WO
WIPO (PCT)
Prior art keywords
slave
data message
bus
host
communication 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.)
Ceased
Application number
PCT/CN2013/075926
Other languages
English (en)
French (fr)
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.)
Jiangsu Xidiannanzi Smart Electric Power Equipment Co ltd
State Grid Zhejiang Electric Power Co Ltd
Wenzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
State Grid Corp of China SGCC
Original Assignee
Jiangsu Xidiannanzi Smart Electric Power Equipment Co ltd
State Grid Zhejiang Electric Power Co Ltd
Wenzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
State Grid Corp of China SGCC
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 Jiangsu Xidiannanzi Smart Electric Power Equipment Co ltd, State Grid Zhejiang Electric Power Co Ltd, Wenzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd, State Grid Corp of China SGCC filed Critical Jiangsu Xidiannanzi Smart Electric Power Equipment Co ltd
Priority to AU2013330114A priority Critical patent/AU2013330114B2/en
Priority to US14/401,086 priority patent/US20150103845A1/en
Publication of WO2014056323A1 publication Critical patent/WO2014056323A1/zh
Priority to ZA2014/09131A priority patent/ZA201409131B/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • H04L12/4035Bus networks with centralised control, e.g. polling in which slots of a TDMA packet structure are assigned based on a contention resolution carried out at a master unit
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Definitions

  • the invention relates to a synchronous time division multiplexing bus communication method using a serial communication interface.
  • the present invention relates to a bus communication method, and in particular to a synchronous time division multiplexing bus communication method using a serial communication interface.
  • each channel of the input and output boards is directly connected to the MCU pin of the main control board. This requires that the MCU pins of the main control board must meet the requirements of the quantity, and the input interfaces required for different applications. The number of output interfaces is also different, which causes the versatility of the main control board to decrease.
  • the automatic device has generally adopted the bus as a bridge for communication between the input and output boards and the main control board.
  • An MCU is set on the input and output boards to process various input and output signals and communicate with the MCU of the main control board. Therefore, the structure of the internal bus determines the timeliness and stability of the automatic device.
  • the "Time Division Multiple Real-Time Communication Bus" which is a time division multiple real-time communication bus using SPI, is used by the master, the slave, and the SPI communication bus: MOSI data line, MISO data line, SCK data clock signal
  • the line and the SS slave SPI communication chip select control line comprise a determination module, wherein the MOSI data line, the MISO data line and the SCK data clock signal line of the host are respectively associated with the MOSI data line and the MISO data line of each slave and The SCK clock signal lines are connected, wherein the SCK clock signal lines of the master are connected to the SCK clock signal lines of the slaves, and are additionally introduced to the judgment modules to which the slaves belong, and the output control lines of the respective judgment modules correspond to the respective The slave's SPI communication chip select control line SS is connected
  • the communication bus utilizes the intersection of each signal in time to transmit multiple digital signals on a single physical channel, thereby increasing the versatility of the automation device, especially in applications requiring a large number of switching inputs and outputs.
  • the communication bus achieves the purpose of real-time communication, due to the complicated hardware circuit and the complicated circuit, the implementation of the bus has high hardware requirements for the MCU, and the implementation method is complicated, the usage cost is greatly increased, and the real-time communication is difficult to control.
  • the real-time communication is affected by the hardware circuit, which affects the reliability of the communication and the speed of the bus.
  • the present invention aims to provide a synchronous time division multiplexing bus communication method using a serial communication interface.
  • a serial communication interface On the basis of most MCUs, only two physical connections are utilized.
  • the line realizes a highly reliable differential connection, and at the same time satisfies the high-speed real-time requirement of the synchronous time division multiplexing bus communication method, solves the bus communication problem of the internal module of the device, realizes real-time communication controllable, and reduces hardware circuit complexity. Degree, enhance versatility and reliability.
  • Embodiments of the present invention provide a synchronous time division multiplexing bus communication using a serial communication interface
  • the method is applied to a system including a host and a plurality of slaves, wherein the master and the slave both comprise a serial communication interface SCI and a micro control unit of a timer, and the receiving and transmitting data lines of the master and the slave are respectively
  • the bus is connected, including:
  • the slaves When the host sends a downlink data message corresponding to each slave, the slaves receive the downlink data packet through the serial communication interface SCI. After waiting for a predetermined time interval, the slave starts to send uplink data packets. After the last slave sends the uplink data packet, waiting for the same predetermined time interval, the next slave starts to send the uplink data packet, and so on.
  • the specific information that the slave sends the uplink data packet is:
  • the slave device After receiving the data packet, the slave device determines whether it is a downlink data packet sent by the host.
  • the slave device determines that the received data packet is not a downlink data packet sent by the host, the received data packet is not processed, and the slave device continues to receive the data packet;
  • the slave device determines that the received data packet is a downlink data packet sent by the host, starts a timer, performs data verification on the received data packet, and closes the timer if the check fails. And continuing to receive the bus data message; if the check passes, the slave starts data packet processing, and when the timer expires, the slave sends the data message through the serial communication interface SCI.
  • the bus is physically converted to a differential line by a single-ended differential signal conversion chip on the bus, and both the master and the slave are connected to the bus through the differential line.
  • the time interval at which the host and the slave send the data is the predetermined time interval.
  • the bus adopts a half-duplex communication mode.
  • the present invention has the following advantages:
  • the bus physically constitutes a single unit, and only two differential lines are used, so that high-reliability real-time bus communication can be realized, and at the same time, high-speed real-time requirements can be met, and even in the case of less external interference, It can be realized by a single signal line.
  • the implementation of the bus has lower hardware requirements for the MCU. MCUs with SCI interfaces and timers can be implemented. Different slaves can select different baud rates and wait according to actual conditions. Time, complete real-time requirements, using synchronous time division multiplexing, the host fills the data memory according to the time interval, and processes the bus data program of the slave; the host sends the text as the beat of the slave, each time the host transmits The text is all right for the slave.
  • the slave sends the accuracy of the beat, and can select the period of variable length according to the task quantity of the host, without causing the slave to lose the step, solve the bus communication problem of the internal module of the device, and realize the real-time controllability of the communication. Reduce hardware circuit complexity and enhance versatility and reliability.
  • FIG. 1 is a system diagram of an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a format of a message frame with address bits according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a communication process according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a slave device transmitting an uplink data packet according to an embodiment of the present invention.
  • FIG. 1 a schematic diagram of a system for applying the method provided by the present invention is shown.
  • a synchronous time division multiplexing bus communication method using a serial communication interface that solves the bus communication problem of the internal modules of the device is provided.
  • the bus adopts a half-duplex communication mode, which can achieve highly reliable real-time bus communication while meeting the high-speed real-time requirements.
  • the receiving and transmitting data lines of the host and the plurality of slaves of the embodiment are respectively connected to the bus, and only one device occupies bus resources at any time, transmits data, and other devices receive data.
  • the bus physically converts the bus into a differential line through a single-ended differential signal conversion chip, that is, the receiving and transmitting data lines are differential lines, and the master and the plurality of slave differential lines pass. Connected to the bus.
  • FIG. 2 the figure is a schematic diagram of a format of a message frame with address bits according to an embodiment of the present invention.
  • 1 bit start bit (Start) 8 data bits, where LSB is the first bit in the data bit, 2-7 represents the 2-7th bit in the data bit, and MSB represents the low bit in the data bit.
  • the communication provided in this embodiment uses a message frame with an address bit, and the implementation method is as follows:
  • the communication loop is divided into an uplink packet and a downlink packet, where the content of the address bit is 1 when the downlink packet is received, indicating that the packet is From the host to the slave.
  • each slave reads the required information in the received message. Information.
  • the frequency of the downlink message is used as the working beat of the slave.
  • TDM Time division multiplexing
  • the slave When the slave receives a packet with the address bit content of 1, it delays a certain time according to its own address number and then sends an uplink packet to implement multiplexing.
  • the duration of the downlink packet sent by the host in this embodiment is: T ⁇ ; the duration of each uplink packet sent by the slave: ⁇ slave; the waiting time between two transmissions: Idle.
  • FIG. 3 the figure is a schematic diagram of a synchronous time division multiplex bus communication method using a serial communication interface according to an embodiment of the present invention.
  • the host sends a downlink data packet.
  • the slave After receiving the downlink data packet through the serial communication interface, that is, the SCI interface, the slave waits for the Idle interval.
  • the slave 1 starts to send the uplink data packet and waits for the Idle interval.
  • the slave No. 2 starts to send the uplink data>3 ⁇ 4text, waits for the Idle interval, and so on, waits for the Idle interval, the N slave starts to send the uplink data packet, waits for the Idle interval, and the host sends the downlink again. Data message, thus completing data communication.
  • Idle indicates the interval at which the master slave sends data packets.
  • the slave SCI starts to receive the data message, and determines whether the received data message is a data message sent by the host through the content of the address bit in the data message. If it is not a data packet sent by the host, but a data packet sent by another slave, it will not be processed. If it is a data message sent by the host, the timer is started (the time length is determined by Idle, T, and N). Data verification is performed on the received host data message. If the check fails, the timer is turned off and the bus data continues to be received. If the check passes, the slave starts data processing. When the timer interrupt occurs, the slave sends a data message through the SCI.
  • a communication cycle T is obtained by the following formula (2):
  • T T ⁇ + Idle + ( ⁇ + ⁇ ⁇ ) * ⁇ ( 2 )
  • is the address number ( 1... ⁇ )
  • the host downlink packet is 16 bytes
  • the slave uplink packet is 10 bytes.
  • FIG. 4 the figure is a schematic flowchart of a slave device transmitting an uplink data packet according to an embodiment of the present invention.
  • S401 SCI receives data
  • S402 Determine whether it is host data, if yes, execute S403; otherwise, execute S408; S403: enable timer;
  • S404 Determine whether the data check is passed, if yes, execute S405; otherwise, execute S408; S405: slave data processing;
  • S406 Determine whether the timer time has arrived, if yes, execute S407; otherwise, execute S405; S407: SCI sends data;
  • the bus physical structure of the present invention constitutes a single tube, and only two differential lines are used, so that high-reliability real-time bus communication can be realized, and even in the case of small external interference, a single signal line can be realized.
  • the implementation of the bus has lower hardware requirements for the MCU, and the MCU with the SCI interface and the timer can be implemented. Different slaves can select different baud rates and waiting times according to actual conditions to complete real-time requirements.
  • the host fills the data memory according to the time interval, and processes the bus data program of the slave.
  • the message sent by the host is the beat of the message sent by the slave. Each time the host sends a message, it is the time of the slave, and the slave is guaranteed. Send the accuracy of the beat. It is possible to select a period of variable length according to the amount of tasks of the host without causing the slave to lose synchronization.
  • the invention is based on the fact that most of the MCUs are provided on the internal bus, and only two physical connections are used to achieve a highly reliable differential connection, while at the same time meeting the high-speed real-time requirements.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Information Transfer Systems (AREA)

Abstract

一种采用串行通信接口的同步时分多路复用总线通信方法,主机和从机的收、发数据线均分别与总线相连接,其方法为:当主机每发送一次各从机对应需要的下行数据报文时,各个从机通过SCI接口接收数据,等待一段时间间隔后,从机开始发送上行数据报文,每当上一从机发送上行数据报文后,等待相同的时间间隔,下一从机开始发送上行数据报文,依次类推实现总线通信方法。在绝大多数MCU都具备的基础上,仅利用两根物理连线实现高可靠的差分连接,同时又能满足高速度的实时性要求,解决了装置内部模块的总线通信问题,实现通信实时性可控,减少硬件电路复杂程度,增强通用性和可靠性。

Description

一种釆用串行通信接口的同步时分多路复用总线通信方法 本申请要求于 2012年 10月 11 日 提交中 国专利局、 申请号为 201210382801.X, 发明名称为"一种采用串行通信接口的同步时分多路复用总 线通信方法"的中国专利申请的优先权,其全部内容通过引用结合在本申请中。 技术领域
本发明涉及的是一种总线通信方法,具体涉及的是一种采用串行通信接口 的同步时分多路复用总线通信方法。
背景技术
在工业控制中, 自动装置总会使用大量的输入接口和输出接口, 用来采集 各种传感器信号和开关量信号, 以及用作控制继电器的出口。在形式上大多是 采用主控板、 输入、 输出板实现。
传统中,输入、输出板的每一个通道都是与主控板的 MCU引脚直接相连, 这就需要主控板的 MCU的引脚必须满足量的需求, 同时不同的应用场合需要 的输入接口、 输出接口的个数也不一样, 这样就造成主控板的通用性下降。
目前, 自动装置已经普遍采用总线来做为输入、输出板与主控板之间通信 的桥梁。
在输入、 输出板上设置一个 MCU用来处理各种输入、 输出信号, 并与主 控板的 MCU进行通信, 因而内部总线的结构决定了自动装置的时效性与稳定 性。
然而普通的串行或并行通信方式并不能满足强干扰下的实时通信需求,因 此,各厂家开始开发各自装置的总线来满足强干扰下的实时通信需求。但由于 目前的装置内部总线种类繁多, 如有并行总线, 也有串行总线, 有通过 FPGA 实现的, 也又通过 CPLD实现的, 以及有通过其他 MCU实现的; 有使用 SPI 接口的, 有使用 SCI ( Serial Communication Interface, 串行通信接口) 的, 也 有使用 CAN接口的等繁多复杂。
对于这种输入、输出板与主控板之间通信报文不长且长度固定的场合,很 难开发出结构筒单合乎要求的总线, 难以满足实时通信的要求。
为满足上述要求, 目前很多也都使用了 TDM (时分多路复用) 的总线技 术来开发总线, 如中国专利申请号 200420025265.9, 公开号为 CN2710264公 开的 《时分多路实时通讯总线》, 其是采用 SPI的时分多路实时通讯总线, 它 是由主机、从机, 以及 SPI通讯总线中的: MOSI数据线、 MISO数据线、 SCK 数据时钟信号线和 SS从机 SPI通讯片选控制线构成, 包括一个判断模块, 所 述的主机的 MOSI数据线、 MISO数据线以及 SCK数据时钟信号线分别与各 从机的 MOSI数据线、 MISO数据线以及 SCK时钟信号线相连接, 其中主机 的 SCK时钟信号线在各从机的 SCK时钟信号线相连接的同时还额外引入到各 从机所属的判断模块,而各判断模块的输出控制线与各对应从机的 SPI通讯片 选控制线 SS相连。
该通讯总线利用每个信号在时间上的交叉,就可以在一条物理信道上传输 多个数字信号,从而使自动装置的通用性得以扩大,特别是在需要大量开关量 输入输出的应用场合。
而这种通讯总线虽然达到了实时通讯的目的,但其由于硬件电路以及线路 复杂, 总线的实现对 MCU的硬件要求较高, 其实现方法复杂, 大大增加了使 用成本, 通信实时性难以可控, 通信实时性受到硬件电路的影响, 同时影响通 信的可靠性和总线的速度。
因此, 基于上述, 无论是哪种内部总线方式, 要么是采用了额外的高速逻 辑芯片来提高总线的速度和可靠性,要么是采用了多根数据线或者额外的电路 来对总线进行控制以保证速度和可靠性, 或者是在速率和可靠性上做一个取 舍, 其均对 MCU的硬件要求较高, 硬件电路复杂, 受到硬件设备影响度大, 使其通信的可靠性和总线的速度受到了局限性,难以实现高可靠性同时又能满 足高速度的实时性要求。
发明内容
针对现有技术上存在的不足,本发明目的是在于提供一种采用串行通信接 口的同步时分多路复用总线通信方法, 在绝大多数 MCU都具备的基础上, 仅 利用两根物理连线实现高可靠的差分连接,同时又能满足高速度的实时性要求 的同步时分多路复用总线通信方法,解决了装置内部模块的总线通信问题, 实 现通信实时性可控, 减少硬件电路复杂程度, 增强通用性和可靠性。
为了实现上述目的, 本发明是通过如下的技术方案来实现:
本发明实施例提供一种采用串行通信接口的同步时分多路复用总线通信 方法,应用于包括主机和多个从机的系统, 所述主机和从机均包括串行通信接 口 SCI和定时器的微控制单元,所述主机和从机的收、发数据线均分别与总线 相连接, 包括:
当主机每发送一次各从机对应需要的下行数据报文时,各个从机通过串行 通信接口 SCI接收所述下行数据报文,等待预定时间间隔后,从机开始发送上 行数据报文,每当上一从机发送上行数据报文后, 等待相同的所述预定时间间 隔, 下一从机开始发送上行数据报文, 依次类推。
优选地, 所述从机发送上行数据报文的具体为:
从机接收数据报文后, 判断是否为主机发送的下行数据报文;
当所述从机判断接收的数据报文为不是主机发送的下行数据报文时,对接 收的所述数据报文不做处理, 从机继续接收数据报文;
当所述从机判断接收的数据报文为主机发送的下行数据报文时,启动定时 器,再对接收的所述数据报文进行数据校验,如果校验不通过则关闭所述定时 器,继续接收总线数据报文;如果校验通过,所述从机开始进行数据报文处理, 等待定时器时间到达时,所述从机通过所述串行通信接口 SCI发送所述数据报 文。
优选地,在所述总线物理上通过单端差分信号转换芯片将总线转换成差分 线, 所述主机和从机均通过所述差分线与所述总线相连接。
优选地,所述主机和从机发送所述数据 文的时间间隔为所述预定时间间 隔。
优选地, 所述总线采用的是半双工的通信模式。
与现有技术相比, 本发明具有以下优点:
本发明通过上述方法, 其总线物理构成筒单, 仅仅使用两根差分线, 即可 实现高可靠的实时总线通信, 同时又能满足高速度的实时性要求,在外部干扰 较小的情况下甚至可以采用单根信号线的方式实现, 总线的实现对 MCU的硬 件要求较低, 有 SCI接口和定时器的 MCU都可以实现; 不同从机的可以根据 实际的情况选择不同的波特率与等待时间, 完成实时性要求, 采用同步时分多 路复用, 主机按照时间间隔来填充数据内存, 处理从机的总线数据程序筒单; 主机发送 文是从机发送 文的节拍,每次主机下传 文,都是对从机的对时, 保证从机发送节拍的准确性, 并且可以根据主机的任务量来选择不定长的周 期, 而不会造成从机的失步, 解决了装置内部模块的总线通信问题, 实现通信 实时性可控, 减少硬件电路复杂程度, 增强通用性和可靠性。
附图说明
图 1为本发明实施例提供的系统图;
图 2为本发明实施例提供的带地址位的报文帧格式示意图;
图 3为本发明实施例提供的一次通讯流程示意图;
图 4为本发明实施例的从机发送上行数据报文的流程示意图。
具体实施方式
为使本发明实现的技术手段、 创作特征、 达成目的与功效易于明白了解, 下面结合具体实施方式, 进一步阐述本发明。
参见图 1 , 该图为本发明提供的方法应用的系统示意图。
本实施例中是提供一种解决了装置内部模块的总线通信问题的采用串行 通信接口的同步时分多路复用总线通信方法。
该方法中, 总线采用半双工的通信模式, 既可以实现高可靠的实时总线通 信, 同时又能满足高速度的实时性要求。
本实施例的主机和多个从机的收、发数据线都分别与总线相连接,在任意 时刻仅有一个设备占用总线资源, 发送数据, 其他设备接收数据。
为了提高通信的可靠性, 减少误码率, 总线物理上通过单端差分信号转换 芯片将总线转换成差分线, 即收、发数据线采用的是差分线, 主机和多个从机 差分线通过与总线相连接。
参见图 2, 该图为本发明实施例提供的带地址位的报文帧格式示意图。 其中, 1位开始位( Start ), 8位数据位, 其中 LSB是数据位中的第 1位, 2-7 表示数据位中的第 2-7 位, MSB 表示数据位中的低位。 1 位地址位 ( Add/data ), 1位停止位( Stop )。
本实施例提供的的通信采用带地址位的报文帧, 其实现方法如下: 通信回路分为上行报文和下行报文,其中下行报文时,地址位的内容为 1 , 表示才艮文由主机发往从机。
采用一主多从、主发从收的方式,各从机在收到的报文中读取自己需要的 信息。 下行报文的频率作为从机的工作节拍。
上行报文时, 地址位的内容为 0, 由从机发往主机。 采用时分多路复用 ( TDM ) 的方式。
当从机收到地址位内容为 1的报文时,按照自己的地址号延时一定时间后 再发送上行报文, 从而实现多路复用。
当从机收到地址位内容为 0的才艮文时, 不做处理。
本实施例中的主机发送下行报文时长: T ±; 每个从机发送上行报文时长: Τ从; 两次发送间的等待时间: Idle。
参见图 3, 该图为本发明实施例提供的采用串行通信接口的同步时分多路 复用总线通信方法示意图。
本实施例提供的采用串行通信接口的同步时分多路复用总线通信方法具 体为:
主机发送下行数据报文, 1号从机通过串行通信接口即 SCI接口接收所述 下行数据报文后, 等待 Idle的时间间隔, 1号从机开始发送上行数据报文, 等 待 Idle的时间间隔, 2号从机开始发送上行数据 >¾文, 等待 Idle的时间间隔, 以此类推, 等待 Idle的时间间隔, N号从机开始发送上行数据报文, 等待 Idle 的时间间隔, 主机再次发送下行数据报文, 从而完成数据通讯。
综上所述, Idle表示主机从机发送数据报文的时间间隔。
从机开放 SCI开始接收数据报文,通过数据报文中地址位的内容来判别接 收的数据报文是否是主机发送的数据报文。如果不是主机发送的数据报文, 而 是其他从机发送的数据报文, 则不做处理。 如果是主机发送的数据报文, 则启 动定时器(定时时间长度由 Idle 、 T 和 N来确定)。 再对接收的主机数据报 文进行数据校验。 如果校验不通过则关闭定时器, 继续接收总线数据。 如果校 验通过, 从机开始进行数据处理。 等待到定时器中断发生时, 从机通过 SCI 发送数据报文。
报文发送时间计算: 第 N个从机发送时刻 tn由以下公式( 1 )获得: tn = Idle + {Idle + Th Y n-\ ~) ( 1 ) 其中, n为地址号 ( 1…… N ) 一次通信周期 T由以下公式(2 )获得:
T = T± + Idle + (ΜΙε + Τμ ) * Ώ ( 2 ) 其中, η为地址号 ( 1…… Ν ) 根据系统的实际需求,确定一次通信周期 Τ和系统中最大从机数目,选择 恰当的波特率和等待时间即可完成规定时间内的数据通讯。 例如: 现在系统通信周期为 500us, 最大从机数目为 10个, 设置波特率
3.75mbps, 主机下行报文为 16个字节, 从机上行报文为 10个字节, 则主从机 发送数据才艮文的时间间隔 Idle = [500— (16 X — 10 χ (10 χ ^)] I (10 + 1) 14.5us。 设置从机的等待时间则可以实现周期为 500us的实时通信。
参见图 4, 该图为本发明实施例提供的从机发送上行数据报文的流程示意 图。
S401: SCI接收数据;
S402: 判断是否为主机数据, 如果是, 执行 S403; 反之, 执行 S408; S403: 启用定时器;
S404: 判断数据校验是否通过, 如果是, 执行 S405; 反之, 执行 S408; S405: 从机数据处理;
S406: 判断定时器时间是否到达, 如果是, 执行 S407; 反之, 执行 S405; S407: SCI发送数据;
S408: 关闭定时器。 综上所述, 本发明的总线物理构成筒单, 仅仅使用两 根差分线, 即可实现高可靠的实时总线通信, 在外部干扰较小的情况下甚至可 以采用单根信号线的方式实现。 总线的实现对 MCU的硬件要求较低, 有 SCI 接口和定时器的 MCU都可以实现。 不同的从机可以根据实际的情况选择不同 的波特率与等待时间, 完成实时性要求。 并且, 采用同步时分多路复用, 主机 按照时间间隔来填充数据内存, 处理从机的总线数据程序筒单。主机发送报文 是从机发送报文的节拍, 每次主机下传报文, 都是对从机的对时, 保证从机发 送节拍的准确性。可以根据主机的任务量来选择不定长的周期, 而不会造成从 机的失步。
本发明在内部总线就是在绝大多数 MCU都具备的基础上, 仅仅利用两根 物理连线实现高可靠的差分连接, 同时又能满足高速度的实时性要求。
以上所述,仅是本发明的较佳实施例而已, 并非对本发明作任何形式上的 限制。 虽然本发明已以较佳实施例揭露如上, 然而并非用以限定本发明。 任何 熟悉本领域的技术人员,在不脱离本发明技术方案范围情况下,都可利用上述 揭示的方法和技术内容对本发明技术方案做出许多可能的变动和修饰,或修改 为等同变化的等效实施例。 因此, 凡是未脱离本发明技术方案的内容, 依据本 于本发明技术方案保护的范围内。

Claims

权 利 要 求
1、 一种采用串行通信接口的同步时分多路复用总线通信方法, 其特征在 于,应用于包括主机和多个从机的系统, 所述主机和从机均包括串行通信接口 SCI和定时器的微控制单元, 所述主机和从机的收、 发数据线均分别与总线相 连接, 包括:
当主机每发送一次各从机对应需要的下行数据报文时,各个从机通过串行 通信接口 SCI接收所述下行数据报文,等待预定时间间隔后,从机开始发送上 行数据报文,每当上一从机发送上行数据报文后, 等待相同的所述预定时间间 隔, 下一从机开始发送上行数据报文, 依次类推。
2、 根据权利要求 1所述的一种采用串行通信接口的同步时分多路复用总 线通信方法, 其特征在于, 所述从机发送上行数据报文的具体为:
从机接收数据报文后, 判断是否为主机发送的下行数据报文;
当所述从机判断接收的数据报文为不是主机发送的下行数据报文时,对接 收的所述数据报文不做处理, 从机继续接收数据报文;
当所述从机判断接收的数据报文为主机发送的下行数据报文时,启动定时 器,再对接收的所述数据报文进行数据校验,如果校验不通过则关闭所述定时 器,继续接收总线数据报文;如果校验通过,所述从机开始进行数据报文处理, 等待定时器时间到达时,所述从机通过所述串行通信接口 SCI发送所述数据报 文。
3、 根据权利要求 1或 2所述的一种采用串行通信接口的同步时分多路复 用总线通信方法, 其特征在于,在所述总线物理上通过单端差分信号转换芯片 将总线转换成差分线, 所述主机和从机均通过所述差分线与所述总线相连接。
4、 根据权利要求 1或 2所述的一种采用串行通信接口的同步时分多路复 用总线通信方法, 其特征在于, 所述主机和从机发送所述数据报文的时间间隔 为所述预定时间间隔。
5、 根据权利要求 1或 2所述的一种采用串行通信接口的同步时分多路复 用总线通信方法, 其特征在于, 所述总线采用的是半双工的通信模式。
PCT/CN2013/075926 2012-10-11 2013-05-20 一种采用串行通信接口的同步时分多路复用总线通信方法 Ceased WO2014056323A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
AU2013330114A AU2013330114B2 (en) 2012-10-11 2013-05-20 Synchronization time-division multiplexing bus communication method adopting serial communication interface
US14/401,086 US20150103845A1 (en) 2012-10-11 2013-05-20 Synchronization time-division multiplexing bus communication method adopting serial communication interface
ZA2014/09131A ZA201409131B (en) 2012-10-11 2014-12-11 Synchronization time-division multiplexing bus communication method adopting serial communication interface

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210382801.XA CN102868584B (zh) 2012-10-11 2012-10-11 一种采用串行通信接口的同步时分多路复用总线通信方法
CN201210382801.X 2012-10-11

Publications (1)

Publication Number Publication Date
WO2014056323A1 true WO2014056323A1 (zh) 2014-04-17

Family

ID=47447189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/075926 Ceased WO2014056323A1 (zh) 2012-10-11 2013-05-20 一种采用串行通信接口的同步时分多路复用总线通信方法

Country Status (5)

Country Link
US (1) US20150103845A1 (zh)
CN (1) CN102868584B (zh)
AU (1) AU2013330114B2 (zh)
WO (1) WO2014056323A1 (zh)
ZA (1) ZA201409131B (zh)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6051547B2 (ja) * 2012-03-15 2016-12-27 オムロン株式会社 制御装置
CN102868584B (zh) * 2012-10-11 2015-05-06 江苏西电南自智能电力设备有限公司 一种采用串行通信接口的同步时分多路复用总线通信方法
CN104283587B (zh) * 2014-05-15 2016-05-18 浙江大学 一种具有共模电流抑制能力的能量与信息时分复合传输系统
CN105577498B (zh) * 2015-12-31 2019-01-25 北京格林伟迪科技股份有限公司 一种板间串行通信方法和装置
KR20170111218A (ko) * 2016-03-25 2017-10-12 엘에스산전 주식회사 전력 계통 감시용 슬레이브 모듈
CN106444535B (zh) * 2016-11-18 2019-12-03 威科达(东莞)智能控制有限公司 一种运动控制器及控制方法
CN107484247A (zh) * 2017-09-21 2017-12-15 天津光电通信技术有限公司 一种新型高可靠性的自组网通信系统
CN107562666B (zh) * 2017-09-26 2020-10-23 威创集团股份有限公司 基于spi总线的设备间通信的方法、系统及相关装置
CN107819659B (zh) * 2017-10-24 2020-09-29 七玄驹智能科技(上海)有限公司 一种基于spi的智能级联通信网络
CN108288371A (zh) * 2017-12-15 2018-07-17 广州智光自动化有限公司 基于总线时分复用的电能量同步采样系统
CN110048825A (zh) * 2019-04-03 2019-07-23 郑州轨道交通信息技术研究院 一种总线复用的方法及其通信方法
CN110554984B (zh) * 2019-07-26 2023-11-03 深圳震有科技股份有限公司 基于cpld的串口桥接方法及系统
CN111277478B (zh) * 2020-02-20 2022-01-18 福建师范大学 一种基于不同波特率从设备的rs485总线复用控制方法
CN113064848A (zh) * 2021-01-23 2021-07-02 河南锐利特计算机科技有限公司 485接口总线采用分时时间窗口法通信的方法
CN113193883B (zh) * 2021-04-25 2022-08-26 西安迅湃快速充电技术有限公司 一种并联型电子电力变换器的通信载波控制方法与系统
CN113259215A (zh) * 2021-05-25 2021-08-13 东莞铭普光磁股份有限公司 一种主从机通信方法和主从机通信系统
CN114665173B (zh) * 2022-05-19 2022-08-26 四川千里倍益康医疗科技股份有限公司 基于单信号线的双向通信方法及装置
CN115001618B (zh) * 2022-05-25 2024-09-06 山东泰开电力电子有限公司 一种应用于高压级联式设备的同步串行分时复用总线方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5737335A (en) * 1994-11-09 1998-04-07 Alps Electric Co., Ltd. Communication system using time division multiplex signal transmission
CN101355482A (zh) * 2008-09-04 2009-01-28 中兴通讯股份有限公司 实现嵌入式设备地址顺序识别的设备、方法和系统
US20090161687A1 (en) * 2006-04-11 2009-06-25 Jin Fei Yu Medium Access Control Method for Data Transmission Through CATV Access Network
CN102404280A (zh) * 2010-09-10 2012-04-04 北京飞利信科技股份有限公司 一种在基于串行总线的流媒体传输系统中的主动延时装置
CN102868584A (zh) * 2012-10-11 2013-01-09 江苏西电南自智能电力设备有限公司 一种采用串行通信接口的同步时分多路复用总线通信方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19505271C1 (de) * 1995-02-16 1996-01-18 Siemens Ag Kommunikationssystem
WO1997022220A2 (en) * 1995-12-11 1997-06-19 Airnet Communications Corporation Multichannel broadband transceiver system making use of a distributed control architecture for digital signal processor array
US6064422A (en) * 1996-04-29 2000-05-16 The Goolcharan Charitable Trust Telecommunication system for broadcast quality video transmission
US6047391A (en) * 1997-09-29 2000-04-04 Honeywell International Inc. Method for strong partitioning of a multi-processor VME backplane bus
TNSN00091A1 (fr) * 1999-04-26 2002-05-30 Int Paper Co Machine de conditionnement
US6954463B1 (en) * 2000-12-11 2005-10-11 Cisco Technology, Inc. Distributed packet processing architecture for network access servers
JP3425947B2 (ja) * 2001-10-19 2003-07-14 沖電気工業株式会社 遷移信号制御回路及びそれを用いた調停装置
CA2503306A1 (en) * 2005-03-30 2006-09-30 Paul J. Harvey System and method for intra-cabinet wireless communication
CN101170472A (zh) * 2007-10-26 2008-04-30 华中科技大学 一种基于以太网技术的数控通信方法
CN101374093B (zh) * 2008-09-27 2011-08-24 华中科技大学 一种现场总线的通信接口及通信数据的实时传输方法
CN101820372B (zh) * 2010-03-17 2012-01-04 浙江大学 电源信号、数据信号和音频模拟信号时分复用的单总线通信系统
WO2012119140A2 (en) * 2011-03-03 2012-09-07 Edwards Tyson Lavar System for autononous detection and separation of common elements within data, and methods and devices associated therewith
US9479275B2 (en) * 2012-06-01 2016-10-25 Blackberry Limited Multiformat digital audio interface
AU2013270397B2 (en) * 2012-06-01 2015-11-12 Blackberry Limited Universal synchronization engine based on probabilistic methods for guarantee of lock in multiformat audio systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5737335A (en) * 1994-11-09 1998-04-07 Alps Electric Co., Ltd. Communication system using time division multiplex signal transmission
US20090161687A1 (en) * 2006-04-11 2009-06-25 Jin Fei Yu Medium Access Control Method for Data Transmission Through CATV Access Network
CN101355482A (zh) * 2008-09-04 2009-01-28 中兴通讯股份有限公司 实现嵌入式设备地址顺序识别的设备、方法和系统
CN102404280A (zh) * 2010-09-10 2012-04-04 北京飞利信科技股份有限公司 一种在基于串行总线的流媒体传输系统中的主动延时装置
CN102868584A (zh) * 2012-10-11 2013-01-09 江苏西电南自智能电力设备有限公司 一种采用串行通信接口的同步时分多路复用总线通信方法

Also Published As

Publication number Publication date
AU2013330114B2 (en) 2015-09-03
ZA201409131B (en) 2015-12-23
CN102868584B (zh) 2015-05-06
US20150103845A1 (en) 2015-04-16
CN102868584A (zh) 2013-01-09
AU2013330114A1 (en) 2014-12-04

Similar Documents

Publication Publication Date Title
WO2014056323A1 (zh) 一种采用串行通信接口的同步时分多路复用总线通信方法
CN102546843B (zh) 一种通过软件模拟实现多个uart通信接口的方法
CN102819512A (zh) 一种基于spi的全双工通信装置及其方法
CN104035901B (zh) 一种ttcan总线对时及发送数据的方法
AU2012250760A1 (en) Methods and apparatus for transporting data through network tunnels
JP2011193227A (ja) 通信ネットワークシステム、中継端末、マイクロコンピュータ、送受信装置
CN102722462A (zh) 一种同步通信装置及其控制方法
CN107622032B (zh) 一种i2c总线的三线扩展方法及电路
CN105993007B (zh) 多点接口最短脉宽优先级解析
CN105306421A (zh) 一种基于pci-e接口的信号处理方法及信号处理装置
CN103441914B (zh) As5643总线中包含等时数据包的传输方法
CN106201971B (zh) 一种基于总线同步校验的铁路信号安全计算机平台
CN108920401B (zh) 多主多从的i2c通信方法、系统及节点设备
CN101917322B (zh) 一种自适应多总线融合方法
CN104243246B (zh) 一种基于ZigBee技术的FlexRay总线测试与优化方法及装置
TW201731272A (zh) 具有自動從屬選擇產生之串列週邊介面
CN101005427A (zh) 一种485总线系统和传送数据的方法
CN100547960C (zh) 一种不对称高速半双工通信系统和通信方法
CN101140558A (zh) 嵌入式系统及其通信方法
CN109474637A (zh) 一种基于固定时间片的争抢型总线协议
CN105141483B (zh) 基于can总线的多节点网络最小通信间隔测定方法
CN110892653A (zh) 用于通信网络的用户站的时间戳单元和通信控制单元
CN210780847U (zh) 一种EtherCAT总线时钟分布系统
CN102447600B (zh) 无时钟同步信号单片机实现homebus总线通信的方法
CN114443551A (zh) 一种单线路实现i2c通信的方法、系统、设备以及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13844816

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14401086

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2013330114

Country of ref document: AU

Date of ref document: 20130520

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13844816

Country of ref document: EP

Kind code of ref document: A1