Download 71M652X - Software User`s Guide
Transcript
71M652X Software User’s Guide At the end of each accumulation interval, an MPU interrupt, the "xfer_interrupt" occurs (see ce.c, xfer_busy_isr()) occurs. This is the signal for the MPU to copy the above data to stable storage for further use. At this time, the MPU performs creep detection (meter.c Apply_Creep() ). If the measured voltage, current and/or power is below the minimum, no results for volts, current or watts are reported. If the voltage is below the threshold, no frequency or edge counts are reported. If the current is below the minimum, no current, Wh, VARh or VAh are reported. The MPU's creep thresholds are configurable (VThrshld, IThrshld). The MPU calculates human-readable values, and accumulates cumulative quantities (see meter.c, meter_run.ce.c, ce_update() ). The MPU scales these values to the voltage and current sensors used on the PCB (see VMAX and IMAX). Wh and VARh quantities are signed, permitting the MPU to perform net metering by assigning negative values to "export" and positive values to "import" (see meter.c. Wh.c, VAh.c and VARh.c. Meters require more precision than standard C floating point provides. The Demo Code has reusable calculations for meter math (mmath.c). These automatically convert CE counts into a major running count of Wh, and a minor remainder of CE counts. The MPU also places a scaled value into the CE RAM for each pulse output (meter.c, meter_run(), pulse_src.c, selectpulses() ). This adjusts the pulse output frequency in such a way as to reflect that accumulation's contribution to the total pulse interval. Pulse intervals are cumulative, and cumulatively accurate, even though the frequency is updated only periodically. Placing the pulse value selection logic into the MPU software means that any quantity from any phase or combination of phases can control either pulse output (see PulseSrcFunc[] for a list of transfer functions). The MPU also performs temperature adjustments of the real-time clock (rtc_10.c, RTC_Trim(), RTC_Adjust_Trim() ). The Demo Code can adjust the clock speed to a resolution of 1 part per billion, roughly one second per thirty years. The adjustments include offset (Y_CAL), temperature-linear (Y_CALC) and temperature-squared (Y_CALC2) parameters. Once a human-readable quantity is available, it can be translated into a set of segments (meter.c, lcd.c) to display on the liquid crystal display, or read from a register in memory by means of the command-line interface (cli.c), or possibly some other serial protocol such as Flag (see flag.c) or NEMA. 5.7 CE/MPU INTERFACE The interface between the CE and the MPU is described completely in the 71M6521 Data Sheet. 5.8 BOOT LOADER It is possible to implement code that functions as a boot loader. This feature is useful for field updates and various test scenarios. See the TERIDIAN Application Note number 031 for details. 5.9 SOURCE FILES The functionality of the Demo Code is implemented in the following files and directories: 1. CLI: access.c access_x.c c_serial.c cli.c cmd_ce.c cmd_misc.c help.c io.c load.c profile.c ser0cli.c ser1cli.c sercli.c Revision 1.7 Command Line Interface – General Commands SFR, I/O RAM, MPU and CE memory access routines extended memory access routines parser for command line interface command line interface routines sub-parser for CE commands sub-parser for RTC, EEPROM, trim and PS commands display of help text number conversion functions and auxiliary routines for CLI upload and download data collection for support of profile command buffer serial I/O for the CLI TERIDIAN Proprietary © Copyright 2005-2007 TERIDIAN Semiconductor Corporation 69 of 138