LE AVAILAB USER GUIDE 78M6631 Firmware Description Document October 10, 2011 Rev 2 UG_6631_078
78M6631 Firmware Description Document UG_6631_078 Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are implied. Maxim reserves the right to change the circuitry and specifications without notice at any time. The parametric values (min and max limits) shown in the Electrical Characteristics table are guaranteed. Other parametric values quoted in this data sheet are provided for guidance.
UG_6631_078 78M6631 Firmware Description Document Table of Contents 1 Introduction ................................................................................................................................... 5 2 Functional Description .................................................................................................................. 7 2.1 Initialization and Startup ........................................................................................................... 7 2.
78M6631 Firmware Description Document UG_6631_078 Tables Table 1: Measurement Equations Definitions ........................................................................................... 7 Table 2: SPI Command Description ....................................................................................................... 17 Figures Figure 1. Simplified Connection Diagram of a 3-Phase Wye System ........................................................ 5 Figure 2.
UG_6631_078 78M6631 Firmware Description Document 1 Introduction This document describes the 78M6631 firmware (6631_3PH_6S_URT_B21), which can be used with the Teridian™ 78M6631 energy measurement IC. This firmware provides measurements for a 3-phase system along with simple methods for calibration, configuration, and access to metrology data.
78M6631 Firmware Description Document UG_6631_078 A A LOAD A-B B B LOAD A-C LOAD B-C C C IAP IAN IBP IBN ICP ICN V3P3A D/Y VC VB VA 78M 6631 Figure 2. Simplified Connection Diagram of a 3-Phase Delta System All measurement calculations are computed by the 78M6631 and accessible through serial interfaces: UART0 on the TX and RX pins and the Serial Peripheral Interface (SPI). On the UART, the CLI (Command Line Interface) handles the serial communications .
UG_6631_078 78M6631 Firmware Description Document 2 Functional Description This section summarizes the functional operation of the 78M6631 firmware. Refer to the IC data sheet and application notes for more information on terminologies and detailed IC operation. 2.1 Initialization and Startup Upon power-up, both MPU and Compute Engine (CE) cores start executing the application code from designated blocks of flash memory.
78M6631 Firmware Description Document UG_6631_078 At the end of each accumulation interval, these measurements are provided to the MPU for postprocessing. Alternate multiplexer cycles also gather measurements of the IC’s junction temperature for additional compensation in the MPU.
UG_6631_078 2.2.3 78M6631 Firmware Description Document Voltage and Current RMS Calculation As shown in Figure 4, the voltage and current channels ADC output samples are used to continually compute the RMS (root mean square).
78M6631 Firmware Description Document 2.2.4 UG_6631_078 Active, Reactive and Apparent Power Calculation Figure 5 shows the signal processing chain for active and reactive power calculations.
UG_6631_078 2.2.5 78M6631 Firmware Description Document Voltage and Current Harmonics and Fundamental Measurement The 78M6631 firmware allows measurement of the harmonic and fundamental components. To enable the harmonics and fundamental measurements bit 5 of the command register must be set to 1. Harmonic voltage (Vharm) and current (Iharm) are calculated with the quadratic subtraction of the Fundamental results from the RMS results (the square root of RMS squared minus Fundamental squared).
78M6631 Firmware Description Document 2.2.7 UG_6631_078 Power Factor Calculation The 78M6631 provides a direct power factor measurement simultaneously for phase A, phase B, and phase C. Power factor in an AC circuit is defined as the ratio of the active power flowing to the load to the apparent power. The power factor measurement is defined in terms of “import” or “export” referring to the direction of the power in the system.
UG_6631_078 78M6631 Firmware Description Document 2.2.11 Sine and Cosine Reference An internal Sine/Cosine oscillator generates waveforms used by the fundamental and harmonic result calculations. The frequency of this oscillator is set by the FREQ variable. It is generally set to the line frequency. The phase is unrelated and unimportant. 2.2.12 High-Pass Filters An alternative to offset calibration is dynamic offset removal.
78M6631 Firmware Description Document 2.3 UG_6631_078 Configuration and Control 2.3.1 Input Registers The following parameters are configurable by the user via input registers: • • • Sensor range and configuration Calibration targets and coefficients Alarm Thresholds and Mask Settings 2.3.2 Sensors Configuration A few parameters specific to the voltage and current sensors and their connections require one time configuration.
UG_6631_078 2.3.5 78M6631 Firmware Description Document Calibration As with any measurement system, there are also multiple sets of coefficients that are used to compensate for system inaccuracies. Input registers for all coefficients can be manually modified and saved to flash. Alternatively, high level calibration routines can be invoked. These routines automatically determine the coefficients for common parameters and save them to flash memory.
78M6631 Firmware Description Document UG_6631_078 To calibrate the voltage and current the following steps are required: • AC Source and Load: The calibration routine needs a stable source and load. The source and load can be applied to a single phase, two phases or all three phases. • Selection of Target Values: Before launching the calibration the target value (voltage/current) must be set. During calibration the gains will be adjusted to match the target voltage and/or current.
UG_6631_078 78M6631 Firmware Description Document 3 Serial Peripheral Interface (SPI) The 78M6631 has an on-chip SPI interface. The interface is slave (only) and can communicate directly on the MPU data bus without FW overhead. A typical SPI transaction is as follows: While PCSZ is high, the port is held in an initialized/reset state. During this state, PSDO is held in high-Z state and all transitions on PCLK and PSDI are ignored.
78M6631 Firmware Description Document UG_6631_078 4 Serial Communication and CLI The serial communication with the 78M6631 takes place over a UART (UART0) interface. The default settings for the UART of the 78M6631, as implemented in this firmware, are given below: Baud Rate: Data Bits: Parity: Stop Bits: Flow Control: 38400bps 8 None 1 None The host’s serial interface port is required to implement these settings on its UART.
UG_6631_078 78M6631 Firmware Description Document 5 Register Descriptions All register are 32 bits (4 bytes) and are on ”longword” (4 byte) boundaries. All register addresses are the same internally for both SPI and CLI (UART) user interfaces. However, the SPI interface has the ability to address individual bytes while the CLI interface can only address entire longwords. So SPI addresses contain two extra low order bits. 5.
78M6631 Firmware Description Document 5.2 UG_6631_078 Status Register The status register contains alarms and system status flags that can be monitored by the host processor. Alarms thresholds can be set through the corresponding registers. CLI Address SPI Address 0xF5 0x3D4 Description / Comment Not Used Minimum Temperature Alarm (Under Temperature) Status Register Bit 1, 0 2 3 Maximum Temperature Alarm.
UG_6631_078 5.
78M6631 Firmware Description Document 22 UG_6631_078 SPI Address (hex) Output Register CLI Address (hex) PFA PFB PFC 15A 15B 15C 568 58C 570 VfundA 180 600 mVrms VfundB 181 604 mVrms VfundC 182 608 mVrms IfundA 178 5E0 mVrms IfundB 179 5E4 mVrms IfundC 17A 608 mVrms Ifund 17B 5EC mVrms PfundA PfundB PfundC Pfund 170 171 172 189 5C0 5C4 5C8 624 mVrms mVrms mVrms mVrms Power Factor Phase A Power Factor Phase B Power Factor Phase C Fundamental rms voltage Phase A (unsig
UG_6631_078 5.3.1 78M6631 Firmware Description Document High-Rate Results Registers There is a set of registers that are updated at a high rate. Although accessible by both UART and SPI, it is recommended to use SPI. The SPI interface if faster than the UART and does not require any FW overhead and latency, having direct access to the memory.
78M6631 Firmware Description Document 5.4 UG_6631_078 Parameters Configuration These registers are defined as input registers. The values of the input registers can be updated by the user at run-time. A flash update routine is provided to save the values of various registers as default (check the Flash Stored column in the following tables).
UG_6631_078 5.4.4 78M6631 Firmware Description Document Digital I/O Configuration CLI Address (Hex) SPI Address (Hex) Mask1 111 Mask2 Mask3 Input Register Flash Stored Default Phase Compensation Notes 444 DIO3 Control Boolean Y 0 112 448 DIO14 Control Boolean Y 0 113 44C DIO15 Control Boolean Y 0 Mask4 114 450 DIO17 Control Boolean Y 0 Mask5 115 569 DIO43 Control Boolean Y 0 Notes Flash Stored 5.4.
78M6631 Firmware Description Document UG_6631_078 6 System Connection Diagram Examples This section shows supported 3-phase connections and configurations 3-Phase 4-Wire The 3-phase 4-wire configuration has a connection point (neutral) for the three phases, as shown in the following figure. The neutral is connected to the V3P3, the reference potential for voltage and current measurement.
UG_6631_078 78M6631 Firmware Description Document 3-Phase 4-Wire (Shunt) An alternative to the previous configuration, the following figure shows a low-cost solution that is shuntbased. As the previous configuration, the neutral is connected to V3P3 and is the reference potential for both current and voltage measurements. The differential current inputs simplify the connections of the shunt to the system.
78M6631 Firmware Description Document UG_6631_078 Non-Isolated Basic Delta Connection (alternative configuration) The system is referenced to a phase (in this case phase B). The currents are sensed inside the load to determine the individual load current value. A A LO B A- AD A-C AD LO LOAD B-C B B C C LOAD B-C IAP IAN IBN IBP ICP ICN D/Y V3P3A VC VB VA 78M6631 Isolated Basic Delta Connection In this case, the 78M6631 is completely isolated.
UG_6631_078 78M6631 Firmware Description Document 7 Command Line Interface (CLI) Description The 78M6631 firmware implements an interface/protocol to the user or host called Command Line Interface (CLI). This interface facilitates communication via UART between the 78M6631 and the host processor. The CLI provides a set of commands which are used by the host to configure and to obtain information from the 78M6631. 7.
78M6631 Firmware Description Document 7.3.1 UG_6631_078 Individual Address Read The host can request the information in hex or decimal format. In an address read command, the character $ requests the information to be returned in hex format. While the character ?, requests information to be returned in decimal. When requesting information in decimal, the data is preceded by a + or a -. The exception is )AB? which returns a string (see the AB description).
UG_6631_078 7.3.5 78M6631 Firmware Description Document Repeat Command The repeat command can be useful for monitoring measurements and is efficient in demands from the host.
78M6631 Firmware Description Document UG_6631_078 8 Contact Information For more information about Maxim products or to check the availability of the 78M6631, contact technical support at www.maxim-ic.com/support. Revision History Revision Date Description 1.0 7/28/2011 First publication. 1.1 8/11/2011 2 10/10/2011 In Section 5.2, corrected the table. In Section 5.3, changed the CLI Address for Irms from 152 to 153. Also changed the Comment to “rms Current Total”. In Section 5.