Selection of core components
SPC3 protocol chip
SPC3 is an intelligent communication chip specially developed for slave stations. It supports PROFIBUS-DP protocol. Figure 1 shows the structure of SPC3. Its main features are as follows: 44-pin, PQFP package; automatic detection of baud rate on PROFIBUS, from 9.6kbps to 12Mbps; RS-485 transmission; complete PROFIBUS-DP protocol; internal integrated monitoring timer; 5V DC power supply.
Figure 1 SPC3 structure diagram
SPC3 integrates 1.5KB dual-port RAM, and its address space is from 00H to 5FFH. It is divided into 192 segments with 8 bytes as a unit. It can be divided into 3 areas according to function:
00H to 015H is the mode setting and status indication register area. 016H to 03FH is the parameter configuration area, where the pointers and lengths of various BUFs are set. 040H to 5FFH is the user area, which is used to receive data from IO applications and master stations. The configuration of these BUFs, including the length and initial address of the BUF, must be completed in the "offline" state of SPC3; during operation, except for the variable length of the input and output BUFs, other configurations cannot be changed. In addition, a watchdog timer is integrated inside the SPC3, which can work in 3 different states: baud rate monitoring, baud rate control and DP control.
TMS320F206
TMS320F206 is a 16-bit fixed-point DSP with an operation rate of 40MIPS. It is manufactured using static CMOS integrated circuit technology, and its structure is based on 'C5x, using an improved Harvard structure, with a program bus and 3 data buses, pipeline operation, parallel 32-bit arithmetic logic unit, 16×16-bit parallel hardware multiplier, on-chip memory, on-chip peripherals and highly specialized instruction set. The on-chip resources include: an internal clock generator, which can be connected to an external clock source to generate the CPU clock with ×1, ×2, ×4 and /2; there are also 4.5KB RAM and 32KB FLASH on the chip, which are suitable for many engineering applications. The 32KB FLASH can be used as a program memory, which greatly facilitates system design and program debugging; 3 external interrupts INT1, INT2, INT; 1 synchronous serial port and one asynchronous serial port; 1 software programmable timer; 4 independently programmable I/O pins, 1 output pin XF and 1 input pin B IO; JTAG scan simulation interface, which is used to realize online simulation testing.
Hardware system composition
Figure 2 is the hardware block diagram of the PROFIBUS-DP slave station. The system consists of MAX125, TMS320F206, SPC3, EPM7128SQC100, DS1286, HK1225, external RAM and address dial switch to form a PROFIBUS-DP slave station for railway signal power supply fault diagnosis. The three-phase AC voltage and current signals are synchronously sampled by MAX125, and the DSP performs data processing and data calculation through a certain algorithm, and then makes a diagnosis based on the relevant switch signal conditions to control the power equipment. At the same time, according to the requirements of the PROFIBUS master station, the necessary data and fault information will be transmitted to the master station through the protocol chip SPC3. The master station also uses SPC3 to set the slave station and remotely control the power equipment.
Figure 2 Hardware circuit diagram
In the design, the 8-bit SPC3 uses the lower 8-bit data line of TMS320F206 and maps it to the global data space; at the same time, the digital input and digital output of DS1286 and HK1225 are also mapped to the global data space. In this way, the DSP can operate them as easily as operating external RAM. In the program design, when the 16-bit DSP writes to SPC3, DS1286, and HK1225, it writes the lower 8 bits first and then the upper 8 bits.
System software implementation
The PROFIBUS-DP slave station (i.e., the terminal unit for fault diagnosis ) mainly completes data acquisition, data processing, fault judgment, and transmits the necessary power parameters and fault information to the master station according to the requirements of the master station. At the same time, the master station can assign values to the slave station.
Design of SPC3 communication software
In the design, the electric energy parameters are regarded as the input data of the slave station, the assignment of the master station to the slave station is regarded as the output data, and the fault information is treated as external diagnosis. The SPC3 interrupt method is used to process the master station assignment so that real-time performance can be achieved. In addition, the processing of parameterization messages and configuration messages is also completed in the SPC3 interrupt program. The flow chart of the SPC3 interrupt program is shown in Figure 3.
3 SPC3 interrupt program flow chart
Since SPC3 integrates the complete DP protocol, standard diagnostic information is automatically generated and transmitted by SPC3, so the user only needs to store the information communicated with the DP master station in the specified buffer; when the user needs to receive information from the master station, he only needs to access the specified buffer.
Design of Intelligent Software for TMS320F206
Data collection, data processing, fault judgment, and recording of necessary information are completed in the TMS320F206 program. In order to continuously monitor the system, data collection uses the interrupt method to continuously collect data. For fault information, the soft interrupt method is used to send the fault alarm information to the diagnostic buffer of SPC3 as soon as possible so that it can wait for the polling of the master station in time. Figure 4 shows the main program flow chart of the system.
Figure 4 Main program flow chart
SPC3 Software Operation
Since TMS320F206 is fast, the speed must be consistent when exchanging data with SPC3. We set the waiting time of F206 through software to match the speed of the two. In the design, the method of register of structure type is used to operate SPC3. First, define a structure type data "SPC3" corresponding to 1.5KB dual-port RAM, and then define a register "spc3" of type "SPC3" in the header file of F206 register, so that it can be operated conveniently and flexibly. The software is written in C language, and the initialization part of SPC3 is as follows:
The "spc3" register is defined in the header file
.
#define spc3 ( * ( ( volatile SPC3) 0xE800) )
/*SPC3 is mapped to 0xE800 of the global data space* /
.
Initialization operation:
GREG = GLOBAL 16K; /*Map to 16KB global data space* /
.
spc3. mode_ reg0_ L = 0x00d3;
spc3. mode _reg0 _H = 0x0003; /*Set the working mode of SPC3* /
spc3. is reg. mask[ 0 ] = 0x001e;
spc3. is reg. mask[ 1 ] = 0x002d; /*Set the interrupt source of SPC3 and set the output
data processing to SPC3 hardware interrupt* /
spc3. r len diag buf[ 0 ] = 16;
spc3. r len diag buf[ 1 ]
= 16;
spc3. r len prm buf = 10;
spc3. r len cfg buf = 2;
spc3. r len read cfg buf = 2;
spc3. r len din buf = 244;
spc3. r len dout buf = 244; /* Initialize the length of each buffer/*
UserInputBufferPtr = DPS2 GET D IN BUF PTR ( ) ; /* Get the address of the first input buffer*/
UserDiagBufferPtr = DPS2 GET D IAG BUF PTR ( ) ; /* Get the address of the first diagnostic buffer*/
UserDiagFlag = TRUE;
......
This paper uses a 16-bit DSP with fast computing speed to design a PROF IBUS2DP intelligent slave station , which makes the application of fieldbus more extensive.
Previous article:Parallel Processing Methods of DSP
Next article:Comment: DSP is everywhere, but the name is going out of fashion
- Popular Resources
- Popular amplifiers
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- [Help] Matrix Theory by Huang Tingzhu pdf
- The difference between ADS1247 temperature conversion and actual temperature is 3-4℃
- Prize-winning live broadcast: Application of Infineon Industrial Semiconductors in the Motor Drive Industry Registration is now open!
- Amplifier
- Multi-cell 36-48V Battery Management System Reference Design
- EBAZ4205 mining board transformation based on Z7010
- Samsung closes another factory in China! N+5 compensation higher than national standards
- Summary of msp430 built-in functions __bic_SR_register(), __delay_cycles(x)
- IMX6-A9 series: display function test
- Flathead RVB2601 board ultrasonic ranging