mCPC
User Manual
mCPC
micro C-Programmable Controller
Revision History
Rev. h.h.d
- h.h : hardware revision - d : user manual revision Rev. 1.0.1 Initial Version
Rev. 1.1.1 Minor changes regarding mechanical assembly Rev. 1.2.1 Power supply circuit: R6 = R7 = 4.7 KΩ
Elcost Company srl. Tel: +40232765881
Morilor 8 Fax: +40232765883
705200, Pascani Company website:
http://www.elcost.ro
mCPC
micro C-Programmable Controller
1. Brief description
mCPC is an industry ready, freely C-programmable controller, based on MSP430 processor. It offers the flexibility of C programming language using integrated development environment from Texas Instruments. The main advantage of using this device is that it can take a product from concept to market in a short time by investing only in writing the application code. Thus, the product designer will focus on writing the application code, based on an already designed and tested hardware system.
1.1 Applications
The main applications of this device are:
- temperature/pressure/level measuring and controlling - data logger
- small automation
- flow metering for gas, steam, water - gas volume corrector
- utility metering - telemetry/SCADA - heat metering
1.2 Technical data
The main technical characteristics are shown in the table below:
Table 1: mCPC technical characteristics
Model mCPC
Microcontroller MSP430F6736A 25 MHz system clock, 128 KB Flash, 8 KB SRAM, 24-bit Sigma-Delta ADC, RTC, 32-bit hardware multiplier
RTC 32.768 kHz, ±20 ppm
Digital inputs 2 digital inputs
Digital outputs 2 digital outputs, optically isolated, open-collector Analog inputs 2 universal analog inputs (differential 24-bit)
- thermistor, RTD Pt100, Pt500, Pt1000, 2 or 4 wire - bridge sensor
- electronic device 2 analog 4-20/2-10 mA (10-bit) Communication interface - 2 x RS232, ultra-low power
- RS485, MAX3471, 1.6 μA with receiver enabled Memory archives EEPROM, 25LC256, 32768 x 8-bit organization
Power supply Battery 3.6V, A, AA and/or external power supply 5 ... 27VDC, or photovoltaic panel
Backup power 330 mF supercapacitor Ambient temperature -25 … +55 °C
Housing Polycarbonate UL 94 V0, crystal-clear lid, Bocube Protection Class IP66
mCPC
micro C-Programmable Controller
2. Design
The structure of the device consists of assembling two circuit boards in a plastic housing: the CPU board and the power supply board.
2.1 CPU board
CPU board is based on MSP430F6736A microcontroller with a maximum clock frequency of 25 MHz, with three high-performance 24-bit sigma-delta ADCs with differential PGA inputs, a 10-bit ADC, four Enhanced Universal Serial Communication (three eUSCIs are used in this design), four 16-bit timers, a hardware multiplier, a DMA module, an RTC module with alarm capabilities, an LCD driver with integrated contrast control and an auxiliary supply system.
Flash memory size is 128 KB and RAM size is 8 KB. Flash memory programming can be done via Spy-Bi-Wire interface (2-wire).
The CPU Board features an on-board LCD. This LCD is driven by the internal LCD driver on the MSP430F6736A device. There are many available LCD segments, including 8 digits in 7-segment format, decimal points and 8 arrows.
There are many occasions when there is a need for additional external memory to store data associated with a data logger. For this purpose, an EEPROM type memory with a 32768 x 8-bit capacity is mounted on the board. Writing and reading this memory is done by the microcontroller through the SPI interface.
For communication, this board is equipped with two RS232 serial interfaces and an RS485 interface. Both types of interfaces are extremely low power consumption.
In the analogue side of the board there are two universal analog inputs. They are based on two differential inputs of the 24-bit Sigma-Delta Analog-to-Digital Converter (SD0P0/SD0N0 and SD2P0/SD2N0).
At both inputs, several types of sensors can be connected: voltage source, RTD types (Pt100, Pt500 and Pt1000, 2 or 4 wires), thermistors and bridge sensors. Sensor excitement is done via a 4-channel analog multiplexer. The circuit allow ratiometric or non-ratiometric operation in a bridge transducer application. This is possible by using the internal VREF voltage reference or an external reference given by a precision divider (0.1%, 15 ppm). Also for measuring with RTD or thermistor sensors in this circuit there is a precision reference resistor (1k 0.1%, 15 ppm). Also on this board are two digital inputs (DI1 and DI2), two analog inputs (10-bits, A1 and A2) as well as two digital outputs (OUT1 and OUT2). The two SW1-1/2 microswitches can be used to determine different working modes.
2.2 Power supply board
The battery, the power supply circuit and the input/output terminal blocks are mounted on the bottom plate (Power Supply Board, Figures 14 and 17).
Power supply can be done with a 3.6V type A or AA battery. There is an option that the circuit can be powered by an external voltage source of 5…27 VDC. This also enables the power supply from a photovoltaic panel. The use of an external power source has the effect of disconnecting the battery from the circuit via a MOSFET transistor.
mCPC
micro C-Programmable Controller
2.2.1 Terminal blocks
Two rows of terminal blocks are used to connect the external signals. These are arranged as in Figure 1. The name and description of each signal can be seen in Table 2.
Figure 1: PCB Terminal blocks and signals Table 2: mCPC signals description
Connector Signal Name Description J2 +Supply1 Power supply for sensor 1
+Inp1 Positive ADC input for sensor 1 -Inp1 Negative ADC input for sensor 1 RTD-Comm RTD/Thermistor common terminal
GND Ground
J3 +Supply2 Power supply for sensor 2 +Inp2 Positive ADC input for sensor 2 -Inp2 Negative ADC input for sensor 2 RTD-Comm RTD/Thermistor common terminal
GND Ground
J4 PWR Power supply
AI1 2…10/4…20 mA Analog Input 1
GND Ground
PWR Power supply
AI2 2…10/4…20 mA Analog Input 2
GND Ground
J5 DI1 Digital Input 1
GND Ground
DI2 Digital Input 2
GND Ground J6 TXD0 RS232 TX 0 RXD0 RS232 RX 0 GND Ground TXD1 RS232 TX 1 RXD1 RS232 RX 1 GND Ground
J7 OUT1+ Digital Output 1, optically isolated, collector OUT1- Digital Output 1, optically isolated, emitter OUT2+ Digital Output 2, optically isolated, collector OUT2- Digital Output 2, optically isolated, emitter
J8 PWR External Power Supply, 5…27 VDC +3.3V 3.3 VDC for auxiliary devices RS485A RS485 interface, signal A RS485B RS485 interface, signal B
mCPC
micro C-Programmable Controller
2.2.2 Universal analog inputs
Two universal analog inputs are available at J2 and J3 terminal blocks. Different types of sensors can be connected to them as shown in Figure 2. Depending on the type of sensor used, each universal input is required to be configured by the corresponding 4-switching block. The position of the switches according to the sensor type can be seen in Table 3.
Table 3: Sensor settings
Sensor type SW1 SW2 SW3 SW4
Bridge OFF ON OFF OFF
RTD – 4 wires ON OFF OFF OFF
RTD – 2 wires ON OFF ON ON
Figure 2: Universal analog inputs configuration (J2 and J3 terminal blocks)
2.2.3 Digital inputs
Two digital inputs are available at the terminal block J4 as shown in Figure 3. The two digital inputs DI1 and DI2 correspond to the P2.6 and P2.7 ports of the microcontroller. These inputs can connect On / Off sensors (reed relays, contacts ....) or command switches. The On and Off positions correspond to the logical levels "0" and "1".
mCPC
micro C-Programmable Controller
Figure 3: Digital inputs (J4 terminal block)
2.2.4 Analog inputs
Two analogue inputs of 2-10 mA, 4-20 mA, 0-10 mA or 0-20 mA are available at terminal block J5. At these inputs both passive and active current sources are accepted as shown in Figure 4. The analog inputs AI1 and AI2 are corresponding to the P1.1 / A1 and P1.0 / A2 ports of the microcontroller.
Figure 4: Analog inputs (J5 terminal block)
2.2.5 Digital outputs
Two optically isolated digital outputs are available at the terminal block J6 as shown in Figure 5. The open collector outputs are protected at a reverse voltage. OUT1 and OUT2 outputs correspond to ports P2.4 and P2.5 of the microcontroller.
mCPC
micro C-Programmable Controller
2.2.6 RS232 Serial interface
Two RS232 serial interfaces are available at terminal block J7 as shown in Figure 6. These interfaces are of low power and consume battery power only during communication. These can be used for telemetry and parameter configuration. A USB / RS232 adapter cable can be used to communicate with a PC.
Figure 6: RS232 serial interface (J7 terminal block)
2.2.7 RS485 Serial interface and power supply
At the J8 terminal block, an external power supply with a voltage of 5-27 VDC can be applied. Power supply can also be done with a photovoltaic panel. The presence of this voltage interrupts the battery circuit thus preserving its energy. It should be taken into account that the supply voltage of the transducers at the inputs AI1 and AI2 from the terminal block J5 is the same as the power supply voltage, in which case it must be stable.
Also at this terminal block is a two-wire RS485 interface. This allows mCPC to be included in a network. This interface also allows communication with a low-power intelligent transducer, in which case a power supply of 3.3Vac is also provided.
mCPC
micro C-Programmable Controller
2.3 Enclosure
The circuit boards are assembled in a plastic enclosure (Bocube format). The standard model is provided with 4 plastic glands to allow access of 4 multi-wire cables (diameter 3-6.5mm) at terminal blocks. The plastic case is provided with a transparent front cover to which a weatherproof and UV resistant label is attached (Figure 8). The front label has a series of icons to identify the data to be displayed on the LCD. Upon request, custom labels can be made. In the electronic archive sent to each client is also the file of the label in CorelDRAW format.
Figure 8: Standard front label
3. Programming
To program the mCPC you need to install the Code Composer Studio software for MSP430 (CCS tools), a JTAG/Spy-By-Wire interface (MSP-FETUIF) and a 4-wire adapter cable need to be available.
PDF documents describing the CCS tools (CCS IDE, the assembler, the C compiler, the linker, and the librarian) are in the msp430\documentation folder. A Code Composer Studio specific Wiki page (FAQ) is available, and the Texas Instruments E2E Community support forums for the MSP430 and Code Composer Studio provide additional help.
Also, it is necessary a 4-wire adapter cable that will match the 14-pin FET connector to the Spy-By-Wire connector on the mCPC CPU board. The 4-wire adapter cable has the configuration as shown in the Figure 9 below. This adaptation cable is available on request.
mCPC
micro C-Programmable Controller
3.1 Example software and library
For each order is delivered by email an archive containing a sample project. This project is complex and consists of a volume converter for natural gas (PTZ converter). This application uses very complex computational algorithms that convert volume by temperature T, P pressure and Z compressibility factor (SCERG88 and AGA8-92DC standards).
Compiled the project size is about 90 K. To edit and download code to the MSP430, Code Composer Studio must be installed. This project is a good starting example for writing code for a new application.
The sample project provides a function library in the form of C-source that controls the MSP430F6736A chip and external circuits. These functions are summarized as follows:
- Real-Time Clock/Calendar - SPI functions
- LCD functions - V core management - Flash memory functions - UCS settings
- Serial interface/RS232 - ADC10 functions
- Sigma-Delta ADC functions
Also in the same library you can find evolved functions such as: - EEPROM Database
- RTD, Pt100/500/1000 temperature conversion - calculation of atmospheric pressure
- calculation of the compressibility factor (SCERG88 and AGA8-92DC) - formatted printing on the LCD
- flow calculation - serial monitor
- serial parameter setting - calculating polynomials - AUX module management - low power modes management - many other functions
mCPC
micro C-Programmable Controller
4. PTZ Converter, application example
Figure 10 shows the wiring diagram for the PTZ conversion application of the volume of gas flowing through a pipe. Volume pulses are provided by a diaphragm or turbine gas meter. To measure the gas temperature, the converter uses a 2 or 4-wire RTD sensor. Optionally, absolute pressure can also be measured with a 4-20 mA transmitter (calculation method “PT” or “PTZ”).In the absence of this transmitter the absolute pressure can be set as a sum of atmospheric pressure (altitude function) and mean relative pressure (calculation method “T” or “TZ”).
Figure 10: Wiring diagram for PTZ Converter
In this application, a serial monitor is implemented to view or set all measured or calculated variables and process constants. A serial help command is available to show a synthesis of all available commands (Figure 11).
mCPC
micro C-Programmable Controller
- D,d: Display calculated values- F,f: Display factory/service data - H,h: Help
- r[ehdm]: Display database events, hour, day, month - S,s: Display system settings
- T,t: Display time/date
- Z,z: Display Z method and gas composition - ma: Set unconverted counter/clear counters - mb: Set unconverted counter/preserve counters - mc: Clear counters/appl. init
- md: Modify date\n" - me: Clear errors\n");
- mf: Calibrate reference resistor - mg: Modify reference resistor - mh: Reset battery counter - mi: Set counters
- mo: Cold reset\n"); - mp: Pulse simulation - mr: Warm reset
- ms: Modify system settings - mt: Modify time
- mu[ehdm]: Erase the database events, hour, day, month - mv[ehdm]: Delete N records from database
- mz: Modify Z method and gas composition - mx[00,01..]: Modify system settings, 00-Help
Figure 11: RS232 Monitor
4. Custom design
Changes to this project can be made so that it can be personalized to the requirements of a specific application. Thus, the design of the front label can be customized as can be seen in an example in Figure 12. A CorelDRAW format file is available for this purpose. More than that, on request, we can make hardware modifications according to the customer's technical specifications. Following the technical specifications, new printed circuits are designed and made and the final product is assembled.
mCPC
micro C-Programmable Controller
5. Ordering code
mCPC - X - X - X
Cable glands
0, no cable glands
1, one M12 cable glands
2, two M12 cable glands
3, three M12 cable glands
4, four M12 cable glands
5, custom configuration
Front label
0, no front label
1, standard front label
2, custom front label
Two adaptor cables
for programming
(VCC Tool/VCC Target
0, no
1, yes
For each order, besides the product ordered according to the coding, the following will be provided by email:
- schematics of electronic circuits and printed circuits in PDF format,
- front label, standard model, in the form of CorelDRAW, PNG and JPG files,
- inventory lists of materials,
- library source codes and application example,