Design of PLC backplane bus protocol interface chip based on single chip microcomputer and CPLD (Part 1)

Publisher:玄幻剑客Latest update time:2013-05-25 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Abstract: A set of PLC backplane bus protocol interface chips based on CPLD is designed. The protocol chip can distinguish the periodic data and non-periodic data of the PLC backplane bus. The process of designing the state machine, protocol frame controller, and FIFO controller using Verilog HDL language is introduced in detail. The experimental results of stable operation of the backplane bus at 25MHz verify the feasibility of the protocol chip design.

  The programmable logic controller (PLC) host supports the connection of expansion modules through the backplane bus. The backplane bus is a high-speed data path between the PLC host and the I/O expansion module, supporting the I/O data refresh between the host and the expansion module. The technical level of the backplane bus determines the I/O expansion capability of the PLC product and is the core technology of PLC design and manufacturing. At present, most PLCs use serial communication technology to implement the backplane bus. The serial bus has fewer leads and lower hardware cost. Compared with the parallel bus, it is not easily interfered. The serial bus can improve the reliability of automation equipment in harsh factory and industrial environments. The optional types of serial communication technology include I2C, UART, SPI, USB and Ethernet. Generally speaking, many single-chip microcomputers as PLC main chips have integrated these peripheral components. However, the communication rate of the I2C, UART, and SPI peripherals integrated in the single-chip microcomputer is too slow to meet the communication speed requirements of the backplane bus. Although the communication speed of USB and Ethernet is very fast, since they are universal interfaces, the microcontroller needs to intervene in the communication protocol processing. The microcontroller processes data slowly, so the overall communication speed is still very slow. A large PLC generally takes less than 1ms to collect thousands of I/O data points. To meet such high-speed communication requirements, a special backplane bus must be designed.

  1 Backplane bus working principle

  As shown in Figure 1, the data communication process based on the backplane bus is as follows:

  (1) The PLC host's command is sent to the backplane bus through the host protocol chip; (2) The slave protocol chip sends the received command to the expansion module's microcontroller. The microcontroller of one of the expansion modules responds and sends the response data to the backplane bus through the slave protocol chip; (3) The host protocol chip receives the response data and sends it to the microcontroller of the PLC host.

Figure 1 Backplane bus communication block diagram

Figure 1 Backplane bus communication block diagram

  The data sent by the PLC host to the backplane bus can be divided into two categories: one is I/O refresh data, which is periodic and data exchange is very frequent; the other is diagnostic data, which is non-periodic and has a low chance of occurrence.
2 Protocol Chip Design

  This design defines that the backplane bus adopts specifications similar to SPI serial communication. There are 4 leads for communication, including clock signal SCLK, chip select signal SSEL, write data lead MISO and read data lead MOSI; it supports the host and slave to send and receive data at the same time. The data bit format is shown in Figure 2. The data frame is transmitted when the SSEL signal is low.

Figure 2 Backplane bus data specifications

Figure 2 Backplane bus data specifications

  The signals include data/address signal, reset signal Reset, and interrupt signal INT.

  The internal structure block diagrams of the host and slave protocol chips are the same, as shown in Figure 3.

  The protocol chip has a state machine controller, frame controller, shift register, receive/transmit FIFO and read/write cache inside. The periodic and non-periodic data frames sent by the microcontroller are first written to the write cache, queued and sent in the transmit FIFO, and the data frames are converted into serial data and sent to the backplane bus under the drive of the SPI clock SCLK; under the action of the SPI clock, the serial data from the backplane bus is received; under the coordination of the state machine and the frame controller, the valid data frames in the receive FIFO are extracted and put into the read cache area, waiting for the microcontroller to read. If it is non-periodic data, an interrupt signal is sent to notify the microcontroller to fetch the data. The periodic data in the read cache can be overwritten, and the newly received periodic data directly overwrites the old periodic data, while the non-periodic data is stored separately and cannot be overwritten. It is read and cleared by the microcontroller.

Figure 3: Internal structure diagram of the protocol chip

Figure 3: Internal structure diagram of the protocol chip

  The protocol chip allows the external MCU to access the read cache and write cache when idle, so the MCU does not have to frequently process periodic data through interrupt technology, and the PLC host can access the periodic data of the slave without waiting.

  3 CPLD-based protocol chip implementation

  3.1 CPLD chip selection

  This design uses the MachXO series chips from Lattice. This series of CPLDs integrates some FPGA functions. In addition to the built-in rich LUT resources, it also has a large number of distributed SRAM bits and embedded SRAM blocks dedicated to FIFO design. It also has an analog phase-locked loop (PLL) to support clock signal multiplication and division, etc. The I/O pins can be configured to be compatible with 1.2/1.5/1.8/3.3V levels.

Keywords:MCU Reference address:Design of PLC backplane bus protocol interface chip based on single chip microcomputer and CPLD (Part 1)

Previous article:Novel LED dot matrix screen design based on Bluetooth technology (Part 2)
Next article:Design of PLC backplane bus protocol interface chip based on single chip microcomputer and CPLD (Part 2)

Recommended ReadingLatest update time:2024-11-16 19:33

Problems with unsigned number operations in single chip microcomputers
In single-chip microcomputer programming, we often use some mixed operations of unsigned numbers and signed numbers. In addition, the single-chip microcomputer we use is likely to be 16-bit or 8-bit. In this way, the value range of some variables used in programming will limit our operations. For example, the maximum
[Microcontroller]
Design of electronic locker system based on 51 single chip microcomputer
Circuit Description: Security is the most important concern in our daily life. Everyone feels that security is very important, and the door and security at home can be as safe as possible. In order to ensure the safety of the door access Therefore, we intend to improve security by introducing an electronic combinati
[Microcontroller]
Design of electronic locker system based on 51 single chip microcomputer
Introduction to PIC microcontrollers_Basics of synchronous/asynchronous communication technology
1 Introduction The Universal Synchronous/Asynchronous Receiver/Transmitter (USART) module is one of the two serial I/O modules (the other is the Synchronous Serial, SSP module). The USART is also known as the Serial Communication Interface (SCI). The USART can be configured as a full-duplex asynchronous system for co
[Microcontroller]
51 MCU running light C language source program
************************************************************** File name: flash_led.c File Description: Flowing Light C Program Date of writing: October 5, 2006 Program description: MCU uses AT89S51, external 12M crystal oscillator, P1 port output   ***********************************************************
[Microcontroller]
PIC16-bit microcontroller - Thoroughly understand the clock
I have always been reading reference materials and books when writing programs. This time, I don't have any information about the 16-bit single-chip dsPIC33EP32GP502. So I took the opportunity to study it in depth! First, let's look at the choice of oscillator. First look at the clock block diagram:   We are using
[Microcontroller]
PIC16-bit microcontroller - Thoroughly understand the clock
About connecting the microcontroller to the ESP8266 module to intercept its echo content
1. First of all, ESP uses the serial port to communicate with the 51 single-chip microcomputer. The control end can use a mobile phone. However, the 51 single-chip microcomputer and the mobile phone are not at the same level, so it is necessary to analyze the operation on the 51 single-chip microcomputer. 2. When ESP
[Microcontroller]
Application of 89C51 Single Chip Microcomputer in Environmental Noise Measuring Instrument
Environmental noise monitoring is an important part of improving the quality of life and strengthening environmental protection. In the busy streets and residential areas of major cities, large environmental noise displays have been erected on the streets. However, most of the portable noise testers in China are e
[Microcontroller]
Application of 89C51 Single Chip Microcomputer in Environmental Noise Measuring Instrument
51 single chip microcomputer serial port receiving and sending C51 program
//Crystal oscillator 11.0592Mhz //Revised on October 9, 2010 for netizens, debugged and passed on hardware #include reg52.h unsigned char a1; bit flag; void main() { TMOD=0x20; TH1=0xfd; TL1=0xfd; TR1=1; REN=1; SM0=0; SM1=1; EA=1; ES=1; while(1) {      if(flag==1)        {          ES=0;        
[Microcontroller]
Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号