Development of high precision Data Collector Based on DSPIC30F

Source: Internet
Author: User
Tags sdo mplab

Development of high precision Data Collector Based on dsPIC30F
[Date:] Source: China Power Grid Author: xiaozhan, Harbin Institute of Technology [Font:Large Medium Small]

 

Introduction

With the increasing requirements of modern industrial production and scientific research on data collection systems, the collection accuracy, anti-interference ability, and ease of operation and installation have become the main concerns of people when collecting data, this makes the high-precision data collection technology the key.

The Data Collector Based on Single-chip Microcomputer or other series of DSP is limited by the functions and structure of the chip. Many peripheral circuits are often required in the hardware design, resulting in a low overall integration of the device, hardware development is relatively complex, which limits the reliability and anti-interference capabilities of data collectors. Based on the dsPIC30F Series Digital Signal Control (DSC) chip, the high-precision Data Collector uses A new type of Delta-Σ A/D converter MCP3551 with high precision, low noise, and 22-bit resolution, it features high data precision, high chip integration, and convenient development.

The dsPIC30F series chip launched by Microchip is a high-performance 16-bit digital signal controller that combines single-chip microcomputer and DSP technology. The dsPIC30F series chip, with 16-bit single-chip microcomputer as its core, not only has powerful peripheral devices and fast interrupt processing capabilities, but also integrates a digital signal processor capable of high-speed computing. In addition, it also shows powerful performance in exception event processing and software development environment. Due to the abundant internal resources of the dsPIC30F chip, only a few peripherals are required for data collectors developed based on the dsPIC30F platform. Not only does the anti-interference and reliability of the device meet the requirements of the Data Collector in various environments, but also increases the system flexibility, shortens the development time, and reduces development costs.

Data Collection System Design

As shown in data collection system 1, it consists of analog signal conditioning circuit, A/D conversion circuit, display circuit and 485 communication circuit. The signal must be processed before it enters the/D converter. analog signal processing is one of the important factors affecting the system performance. signal quality should be taken into consideration during design to improve the signal-to-noise ratio and minimize distortion. In the design, the potentiometer is used in the conditioning circuit for fine-tuning, and the voltage control tube limits the input range. In A/D conversion circuit, the MCP3551 chip of Microchip is used to sample and convert the signal. It is connected to the dsPIC30F microprocessor in A three-line SPI mode. The dsPIC30F Microprocessor controls A/D sampling and conversion, and displays the output and RS485 communication with the computer through the display circuit digital tube. The input signal is 0 ~ 30mA of the current signal, after processing by the conditioning circuit, enters the input of MCP3551E differential signal range is 0 ~ 3 V, with a high signal-to-noise ratio. The A/D conversion circuit is the core part of the data collection system. The system uses the MCP3551 chip of Microchip. The chip uses the delta-Σ conversion method to output up to 22 bits without missing code. Its effective resolution is 21.9 bits, the conversion accuracy is high, and the power consumption is low.

System Hardware Design

The high-precision Data Collector uses the dsPIC30F2010 chip as the core, and the hardware structure is shown in figure 2. First, because dsPIC30F2010 is a 16-bit digital signal controller, its powerful computing and data throughput capabilities allow dsPIC30F2010 to complete data processing, control, communication, human-machine interface, and other functions independently, reduces the number of chips and simplifies the hardware structure. Secondly, because dsPIC30F2010 is integrated with many necessary peripheral devices, such as RAM, FLASH, EEPROM, USART, and MSSP, few peripheral expansion circuits are required, further simplifying the hardware structure. As shown in figure 2, the hardware structure of the device is very simple, which greatly improves the real-time display and anti-interference performance of the data collector.

Design of A/D sampling and conversion module

The A/D sampling and conversion module uses MCP3551, which is A high precision, low noise, wide dynamic range and uses A single 2.7V ~ 5.5 V power supply Single Channel 22-bit resolution Delta-Σ A/D converter, can be in the extended temperature range (-40oC ~ + 125oC.

The input signal is 0 ~ 30mA current, the precision resistance R3 of the conditioning circuit converts the current signal into a voltage signal, and the difference signal range from 0 ~ + 3 V voltage. The resistance R4 and the potentiometer RP1 are connected in parallel to form a fine-tuning circuit. Resistance R2. Diode D1, regulator D2, and resistor R5 constitute a range limit circuit. When the input signal amplitude exceeds + 5 V, the diode D1 conduction limits the signal to + 5 V, it protects the circuit. The rb0, SDI, and sck pins of the DSPIC30F microprocessor and mcp3551 chip selection end {c}/halfnote _ {}^{-} {s}/halfnote _ {}^ {- }. SDO at the data output end is connected to sck at the serial clock input end. Rb0 controls the startup of the conversion. The conversion status is output by the SDO/r {d}/halfnote _ {}^ {-} {y}/halfnote _ {}^ {-} pin, when rb0 is low, it is obtained by detecting SDI. The high state of the SDI pin indicates that the device is converting, while the low state indicates that the conversion is complete. Use sck to transmit the data that is ready at the same time.

In actual measurement, the reference power supply is one of the important factors that affect the mcp3551 collection accuracy. To reduce the impact, the reference power supply must be stable with low noise. Therefore, the ref3125 is used as a voltage regulator chip with a voltage of V and the filter function of the peripheral capacitor is used to further reduce the effect of voltage fluctuation on mcp3551.

RS485 serial communication module design

The RS485 serial communication module sends and receives signals through the maxcompute chip. The master control machine is in the remote control room and suffers little interference. Therefore, the maxcompute chip is used for data communication. However, the transmission substation works in harsh industrial production environments, causing great interference. Therefore, the dsPIC30F microprocessor and maxcompute adopt photoelectric isolation. Maxcompute is a half-duplex communication chip. Its sending and receiving status is controlled by the RB4 pin of dsPIC30F microprocessor. When RB4 is set to low, the DE-connected second-level tube is turned on, so that the voltage of DI-connected second-level Tube at the signal input end is low, the second-level tube ends, the transmitter does not work, and the chip becomes the RS485 receiver. The differential signal is input from A and B, and the receiver outputs the reverse signal from the RO end. The RXD pin of the dsPIC30F microprocessor is isolated by the photoelectric module to complete the receiving process. When RB4 is set to high, the end of the DE-connected second-level tube is high, which leads to a high voltage at the DI-connected end. The cut-off of the second-level tube is determined by the level of the DI input, and the chip becomes the RS485 transmitter. The signal is sent by the TXD pin of the dsPIC30F microprocessor, Which is isolated by photoelectric. the RS485 differential signal is output from the DI input and from the and B ports to complete the transmission process. In addition, because the dsPIC30F microprocessor can output more than 20mA of the current, you can choose not to add a logical gate circuit in the control line and transmission and receiving line of the dsPIC30F microprocessor and maxcompute.

LED Display Module Design

The LED display module uses the serial interface's 8-bit digital display drive MAX7219. The three-line serial interface with a 10 MHz transmission rate is connected to the dsPIC30F microprocessor. It can drive a maximum of eight common negative digital tubes or 64 light emitting diodes. It contains 8x8 Static RAM, dynamic scanning circuit, segment, and bit drive that can store the display information. MAX7219 data input is mainly completed by three input lines. They are the serial data line DIN, the loading line LOAD and the clock line CLK, respectively, and the dsPIC30F Microcontroller's RB2 and RB3 pins are connected. Serial Data is input from the DIN foot in the form of 16-bit data packets. Each rising edge of the CLK is sent to the chip one by one, when the 16th CLK rising edges appear at the same time or later, but before the next CLK rising edge arrives, the input data will be locked; otherwise, the data sent will be lost.

System Software Design

The software runs in Microchip's mplab ide Visual integrated development environment and is compiled using the C30 compiler. Mplab ide provides a convenient and functional interface. The C30 compiler provides the standard features of C language. The software of high-precision Data Collector mainly implements A/D conversion, LED Display and RS485 communication functions.

The main program flowchart 3 is shown. First, configure the SPI port of the PIC microprocessor to output data in mcp3551 when the clock goes down, and lock the data in the time when the clock goes up. Then configure mcp3551 to work in the Continuous Conversion Mode. After power-on, make rb0 low-level output, that is, {c}/halfnote _ {}^ {-} {s}/halfnote _ {}^ {-} is low and maintained continuously. Query the level status of the SDI pin. If the SDI pin is low, read the data of the receiving buffer spi1buf. If the SDI pin is high, continue the query. Then, it communicates with the PC through the LED Display output and RS485 communication program.

RS485 communication uses the usart serial port interface of DSPIC30F microprocessor to communicate with each other through serial interruption. Serial Port interruption is set to the highest interruption priority, enabling receiving interruption and disabling sending interruption. The baud rate generator value is determined by the formula u1brg = Fcy/(16 × baud rate )? 1 is calculated. Fcy is the instruction cycle clock frequency, and the baud rate is 9600bps. Data is transmitted through the receiver and transmitter.

Conclusion

This paper introduces a high-precision Data Collector Based on DSPIC30F. It uses a high-precision, low-noise, 22-bit resolution new Delta-Σ A/D converter mcp3551 for Data Sampling and conversion, the RS485 communication function between DSPIC30F microprocessor and PC is realized, and the output can be displayed through LED. The system designed according to this scheme is successfully applied to the sensor verification system. The actual debugging and operation shows that the data collector can be in the extended temperature range (-40oC ~ + 125oc) conditions, easy to measure low-frequency and low-voltage signal, it has high precision, strong anti-interference ability, small size, can reach 6 half-LED Display output, has a strong practical value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.