Design of Dual CAN Port Synchronous Communication Board Based on TMS320LF2407A

Publisher:数字冲浪Latest update time:2010-01-25 Source: 国外电子元器件 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

As modern warfare requires weapon systems to be more reliable and maintainable under battlefield conditions, the rapid guarantee of traditional separate control systems is difficult to meet the requirements. The integrated vehicle-mounted PLC controller is used in air defense weapon fire control due to its high reliability and modular characteristics. In order to expand it to weapon systems with TTCAN (Time Trigger CAN) networks, the data synchronization problem between PLC and TTCAN networks needs to be solved. Here, a dual CAN port synchronous communication board design based on TMS320LF2407A is proposed, which solves the problem of linking the vehicle-mounted PLC with the TTCAN network of air defense weapons.

2 Overall design of dual CAN port synchronous communication board

Since the system TTCAN network is a time-triggered real-time communication, the communication interface of the integrated vehicle PLC is a standard CAN, which does not have the ability to receive synchronization signals and send data in a specified time sequence, so it cannot be directly connected to the TTCAN network. The data sent by the PLC must be synchronized before being sent to the TTCAN network, and the data from the TTCAN network must be buffered and sent to the PLC. Figure 1 is the schematic diagram of the dual CAN port synchronous communication board.

Schematic diagram of dual CAN port synchronous communication board

Considering the cyclic working mode of PLC, the randomness of data transmission time and the non-real-time nature of data transmission, the MPC2515 CAN independent controller is used as the internal communication interface between PLC and synchronous communication board. In view of the characteristics of the system TTCAN network that must complete data reception, transmission, exchange and processing in real time within the specified time slot, only the internal CAN controller of TMS320LF2407 can meet the requirements of TTCAN network with the internal high-speed bus, high-speed RAM and powerful computing power of DSP. Therefore, the internal CAN controller of TMS320LF2407 is selected as the communication interface of TTCAN network.

3 Dual CAN port synchronous communication board interface hardware design

3.1 Synchronous signal interface

Since the synchronization signal provides a time reference for the entire TTCAN network, its failure will cause the entire network to fail, so the system synchronization signal is transmitted using RS485 differential mode. In order to further improve the anti-interference ability of the synchronization signal, magnetic beads are used at the input ends of the two differential transmission lines to eliminate the common-mode interference superimposed on the synchronization signal, and high-speed optical couplers are used to isolate the interference to other devices on the communication board, which can ensure the reliability of the synchronization signal interface. The circuit design is shown in Figure 2.

Synchronous signal interface circuit

3.2 Synchronous communication board and PLC CAN interface

The interface circuit uses CAN2.0B protocol to realize data communication with PLC. TMS320LF2407 configures the parameters of MPC2515 through 10 MHz SPI interface. Data receiving/transmitting control uses hardware to connect the signal to the external interrupt sources INT2 and INT3 of TMS320LF2407. When RX0BF and RX1BF are low, it indicates that MCP2515 has received data and TMS320LF2407 can read MCP2515; when RX0BF and RX1BF are high, it indicates that MCP2515 has not received valid data. The sending request control uses the IO interface of TMS320LF2407 to send hardware request commands TX0RST, TX1RST, TX3RST to MCP2515 to realize fast sending request. The interface circuit uses optocoupler isolation and common mode choke coil method to improve the anti-interference performance of the interface circuit. Its circuit design is shown in Figure 3.

Synchronous communication board and PLC CAN interface circuit

4 Dual CAN port synchronous communication board software design

The dual CAN port synchronous communication board software is divided into 3 modules:

(1) The CAN random communication module is responsible for random CAN communication with the PLC, receiving burst data from the PLC, and sending data from the TTCAN network;

(2) The TTCAN communication module is responsible for communicating with the TTCAN network, sending data to the TTCAN network according to the timing requirements under the control of the synchronization signal and receiving random CAN data from the PLC:

(3) The data buffer module is responsible for the synchronization of PLC and TTCAN network data and completes the necessary communication processing tasks. Figure 4 shows the collaborative workflow between the modules.

Collaborative workflow between modules

4.1 CAN random communication module software

First, initialize the SPI interface of TMS320LF2407, and then set the communication parameters of MCP2515 CAN to complete the initialization of the module. Function SPI_WRITE_COMMAND (unsigned int ADDRESS, unsigned intDATA) updates the content in the specified register of MCP2515; function SPI_READ_COMMAND (unsigned int ADDRESS) reads the specified register of MCP2515; function RTS_123 (unsigned int NUM) extracts data from the data buffer and sends it to PLC according to the specified channel data; function RANDOM_RCV() stores the data from PLC in the data buffer after query and reception. The above functions realize the data transmission and reception function of synchronous communication board and PLC CAN port.

4.2 TTCAN communication module software

This module uses CAN_INIT() to initialize the internal CAN controller of TMS320LF2407 and set the communication parameters; the function dsp_can_send(unsigned int IDH, unsigned int IDL, unsigned int*data1) extracts data from the data buffer and sends it to the TTCAN network; the receiving interrupt service function CAN_RCV_ISR() receives data from the TFCAN network and stores it in the data buffer; and the synchronization signal receiving function sytem_syn() realizes synchronization with the TTCAN network and controls the sending time slot.

4.3 Data buffer module software design

This module is the core of the dual CAN port synchronous communication board. Its purpose is to ensure that the random data from the PLC can be transmitted to the TTCAN network after passing through the module. The data sent from the TTCAN network is sent according to the specified time slot under the control of the synchronization signal. The data from the TTCAN network is forwarded to the PLC after necessary analysis by the module. For this purpose, two circular queue buffers mcp2515_rcv_buffer and dsp_rcv_buffer are designed to synchronize the PLC data with the TTCAN network. The implementation method is as follows:

(1) After the communication board receives the PLC data, it stores the data in the mcp2515_rcv_buffer buffer, and then the MCP2515 indicates that the index mep2515_rcv_index is increased by 1; when the DSP CAN synchronous data is sent, the transmission data is extracted from the corresponding position of the mcp2515_rcv_buffer buffer according to the value of the index dsp_send_index, and then the index value is increased by 1. When (mcp2515_rcv_index+1)%FIFOMAX==dsp_send_index, it indicates that the MCP2515 receive buffer queue is full (the maximum length of the FIFOMAX buffer is defined); dsp_send_index==mcp2510_rcv_index, it indicates that the MCP2515 buffer is full.

(2) The data received by the synchronous CAN port is stored in the dsp_rcv_buffer buffer, and then the index dsp_rcv_index is indicated to be increased by 1; the MCP2515 data transmission uses the index mcp2510_send_index to extract the corresponding data in the circular buffer dsp_rcv_buffer and send it to the PLC CAN. When mcp2510_send_index==dsp_rcv_index, it indicates that the DSP receive buffer is empty; (dsp_rcv_index+1)% FIFOMAX==mcp2510_send_index indicates that the DSP buffer queue is full.

5 Conclusion

The dual CAN port synchronous communication board performed well in the test of 600 hours of continuous and different data flow without any abnormality. It has been successfully applied to a certain type of air defense weapon fire control subsystem. Practice shows that this design can well expand the application of PLC on the TTCAN network of the air defense weapon system, greatly improve the reliability and maintainability of the fire control system under battlefield conditions, and meet the general requirements of modular design. At the same time, the dual CAN port synchronous communication board can also be widely used in the access application of event-triggered data and TTCAN network.

Reference address:Design of Dual CAN Port Synchronous Communication Board Based on TMS320LF2407A

Previous article:Research on DSP in online UPS uninterruptible power supply control system
Next article:Research on Ship Collision Avoidance System Based on AIS

Recommended ReadingLatest update time:2024-11-17 01:50

Control of Ultrasonic Power Supply System Based on DSP Chip TMS320LF2407A
This paper uses the high-speed TMS320LF2407A DSP control chip to design the system control circuit , and uses a full-bridge inverter as the main power conversion circuit of the ultrasonic vibration system to solve the drift of the resonant frequency caused by load temperature changes an
[Power Management]
Latest Embedded 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号