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.
Maxim Integr ated Products, 12 0 San Gabriel Drive, Sun nyvale, CA 94086 408- 737-7600
2010 Maxim Integrated Products Maxim is a registered trademark of Maxim Integrated Products.
10 Digital IOs .......................................................................................................................................... 34
11 Contact Information .......................................................................................................................... 34
Document Revision History ..................................................................................................................... 35
This document describes the 6613_PSU_1+1S_URT_v1_00 firmware, which is used with the Teridian
78M6613 power and energy measurement IC. This firmware provides simple methods for calibration and
access to measurement data such as Instantaneous Power, Voltage, Current, Power Factor, and Line
Frequency. It is specifically optimized for measurement in single phase AC Power Supplies and
appliances with the following key features:
•Optimized for using current shunt resistors with analog input A0 configured as single-ended Voltage
input and input A1 configured as single-ended Current input. Inputs A2 and A3 unused.
•Phase error calibration routine included for maintaining accuracy over non-ideal power factors
(optional).
•Accumulation or averaging intervals based on fixed number of AC-cycles for compliance with latest
PMBus1.2 recommendations.
• Low-latency SAG status pin for sub-cycle AC fault detection.
• Dual mode host interface (Auto-Reporting or Command Line Interface).
All measurement calculations are computed by the 78M6613 and communicated to the host processor
over a serial interface (UART0) on the TX and RX pins of the 78M6613 device. Digital IOs utilized by this
firmware include:
• DIO17 is a SAG status pin updated every MUX cycle.
• DIO14 is a configurable alarm pin updated every accumulation interval.
Figure 1 shows a simplified connection diagram of the 78M6613 (emulator connections, decoupling
capacitors and 3.3VDC power supply are omitted in this diagram).
Figure 1: 78M6613 Simplified Connection Diagram for 6613_PSU_1+1S_URT_v1_00 Firmware
The Teridian 78M6613 with firmware 6613_PSU_1+1S_URT_v1_00 provides the user with measurement
data referred to as “Wideband” (WB). Wideband measurements are generally of interest when measuring
non-sinusoidal current/voltage, a typical condition in switched mode power supplies or similar systems.
Table 1: Measurement Equations Definitions
Symbol Parameter Wideband Equation
V RMS Voltage
I RMS Current
P Active Power
Q
S
PF Power Factor P/S
PA Phase Angle ACOS (P/S)
Reactive
Power
Apparent
Power
V = √∑
I = √∑
P = ∑
Q = √(S
S = V * I
The measurement outputs are continuously available to the user. To obtain measurement outputs, the
serial UART interface between the 78M6613 and the host processor must be set up and is described in
Section 3.
2.2 Sample Rate and Accumulation Interval
2
v(t)
2
i(t)
(i(t) * v(t))
2
– P2)
This firmware utilizes an effective sampling rate of 6554 samples per second for each input.
The values described in section 2.1 are calculated over a period commonly referred as accumulation
interval. The registers containing the measurements are updated at the completion of every accumulation
time. In firmware 6613_PSU_1+1S_URT_v1_00, the accumulation interval is based on multiples of the
Input Voltage AC cycle. For example if the accumulation interval is set to 30AC cycles, at 50Hz line
frequency, it will result in 20ms * 30 = 600ms. In this case the RMS values will be calculated over 3932
samples.
Accumulation interval can be changed in CLI mode by the following command (see Secti on 6 for details
of the CLI commands):
> ]18=+30 (Changes accumulation interval to 30 AC cycles)
The serial communication with the 78M6613 takes place over a UART (UART0) interface. The default
settings for the UART of the 78M6613, as implemented in this firmware, are given below:
The firmware allows two types of communication protocols (modes) through UART0: CLI (Command Line
Interface) mode and auto-report mode (default operation).
4 Auto-reporting Mode
Upon application of 3.3VDC power, the 78M6613 will operate in Auto-reporting mode.
Data Packet : Auto-reported AC measurement data packet consisting of Voltage, Current, Watt, Power
Factor and Line Frequency send every accumulation cycle. Measurement data packet is send over
UART in ASCII format followed by line feed and carriage return.
Vrms Irms Watts PF Freq LF + CR
Measurement Parameter: The following table lists the measurement parameters and their respective bit
resolutions (LSB) that is sent over UART in ASCII format.
Measurement Parameter Resolution (LSB)
Voltage (Vrms) mV
Current (Irms) mA
Active Power(Watts) mW
Power Factor(PF) Range between 0 and 1000.
1000 indicative of 1.0 PF
Line Frequency(Freq) 0.01 Hz
5 Auto-reporting “Toggle” Command
To change from Auto-reporting mode to CLI mode (see Section 6 for details of the CLI mode), Ctrl Z
command must be sent from the host to the 78M6613 over the UART interface. A subsequent Ctrl Z
command will cause the 78M6613 to toggle back to Auto-Reporting mode.
The 6613_PSU_1+1S_URT_v1_00 firmware implements an instruction set called the Command Line
Interface (CLI), which facilitates communication via UART between the 78M6613 and the host processor.
6.1 Identification and Information Commands
The I command is used to identify the revisions of the 6613_PSU_1+1S_URT_v1_00 firmware code and
the embedded CE code. The host sends the I command to the 78M6613 as follows:
><CR>
The 78M6613 will reply the following:
TSC 78M6613 PSU 1+1S URT V1.00,Oct 15 2010(c) 2010 Teridian Semiconductor Corp.
All Rights Reserved
CEVI4ACF0
>
6.2 Reset Commands
A soft reset of the 78M6613 can be performed by using the Z command. The soft reset restarts code
execution at addr 0000 and does not alter flash contents. To issue a soft reset to the 78M6613, the host
sends the following:
>Z<CR>
The W command acts like a hardware reset. The energy accumulators in XRAM will retain their values.
Z Reset
Description: Allows the user to cause soft resets.
Usage: Z Soft reset.
All the measurement calculations are stored in the MPU data addresses of the 78M6613. The host
requests measurement information using the MPU data access command which is a right parenthesis
)
To request information, the host sends the MPU data access command, the address (in hex) which is
requested, the format in which the data is desired (Hex or Decimal) and a carriage return. The contents
of the addresses that would be requested by the host are contained in Section 7.
6.3.1 Individual Address Read
The host can request the information in hex or decimal format. $ requests information in hex, and ?
requests information in decimal. When requesting information in decimal, the data is preceded by a + or
a -. The exception is )AB? which returns a string (see Table 3, MPU location address 0xAB).
An example of a command requesting the measured power in Watts (located at address 0x08) in decimal
is as follows:
>)08?<CR>
An example of a command requesting the measured power in Watts (located at address 0x08) in hex is
as follows:
>)08$<CR>
6.3.2 Consecutive Read
The host can request information from consecutive addresses by adding additional ? for decimal or
additional $ for hex.
An example of requests for the contents in decimal of ten consecutive addresses starting with 0x12 is:
>)12??????????<CR>
An example of requests for the contents in hex of ten consecutive addresses starting with 0x12 would be:
>)12$$$$$$$$$$<CR>
Note: The number of characters per line is limited to no more than 60.
The block read command can also be used to read consecutive registers: )saddr:eaddr? For decimal
format or )saddr:eaddr$ for hex format where saddr is the start address and eaddr is the final address.
The following block read command requests the information contained in Table 2 in decimal format:
>)20:3D?<CR>
6.3.4 Concatenated Reads
Multiple commands can also be added on a single line. Requesting information in decimal from two
locations and the block command from above are given below:
>)12?)15?)20:3D?<CR>
Note: The number of characters per line is limited to no more than 60.
6.3.5 U Command
The U command is used for updating default values of the MPU Data permanently in the flash. Before
issuing the U command, CE must first be turned off by the disable CE command. An example of a U
command is as follows:
>)U
Additional examples of MPU Data Access commands are provided in the following table:
) MPU Data Access
Description: Allows user to read from and write to MPU data space.
Usage: ) {Starting MPU Data Address} {option}…{option}<CR>
Command
Combinations:
)saddr? <CR> Read the register in decimal.
)saddr?? <CR> Read two consecutive registers in decimal.
)saddr???<CR> Read three consecutive registers in decimal.
)saddr:eaddr?
Block read command in decimal format. Read
consecutive registers starting with starting
address saddr and ending with addres s eaddr.
Results given in decimal.
)saddr$<CR> Read the register word in h ex.
)saddr$$ <CR> Read two consecutive register words in hex.
)saddr$$$<CR> Read three consecutive register words in hex.
)saddr:eaddr$
Block read command in hex format. Read
consecutive registers starting with starting
address saddr and ending with addres s eaddr.
Results given in hex.
)saddr=n<CR> Write the value n to address saddr in hex format.
)saddr=n=m<CR> Write the values n and m to two consecutive
addresses starting at saddr in hex format.
)saddr=+n<CR> Write the value n to address saddr in decim al
format.
)saddr=+n=+m<CR> Write the values n and m to two consecutive
The repeat command can be useful for monitoring measurements and is efficient in demands from the
host.
If the host requests line frequency, alarm status, Irms wb overcurrent event count, Vrms SAG event
count, Vrms overvoltage event count, vo lta ge, po wer, and accumulated energy measurements with the
following command string:
>)20????????<CR>
If the host then desires this same request without issuing another command, the repeat command can be
used:
>, (no carriage return needed for the repeat command)
The host only needs to send one character rather than an entire string.
Auxiliary
Description: Various
Commands: , Typing a comma (“,”) repeats the command
issued from the previous command line. This is
very helpful when examining the value at a
certain address over time, such as the CE
DRAM address for the temperature.
/ The slash (“/”) is useful to separate comments
from commands when sending macro text files
via the serial interface. All characters in a line
after the slash are ignored.
Using the precision source method, the user provides a precision voltage and precision current load to
the device for calibration. The 6613_PSU_1+1S_URT_v1_00 firmware provides commands to calibrate
the measurement units. For linear current sensors, such as current shunt, no phase calibration is
necessary.
There are two types of calibration commands. The first type provides complete calibration. The second
group, called atomic calibration commands, provides calibration for individual portions of the IC.
There are two calibration commands in this first group: CAL and CALW. Only one of these commands
is needed to calibrate the System/Unit.
To use these commands, a precision voltage source and a precision current source are required for the
calibration routine to use as a reference.
6.5.1.1 CAL Command
To use the CAL command, enter the following:
>CAL<CR>
The response is:
TCal OK
VCal OK:
ICal 0 OK:
>
The device would calibrate the temperature (adjust the Temperature Nominal MPU location 0xA6, saves
to flash and will initiate temperature gain compensation), calibrate the voltage (adjusts CAL VA and CAL
VB registers and saves them to flash), and finally calibrate the current (adjusts CAL IA register and saves
to flash).
6.5.1.2 CALW Command
To use the CALW command, enter the following:
>CALW<CR>
The response is:
TCal OK
VCal OK:
WCal 0 OK:
>
The device will calibrate the temperature, calibrate the voltage, and finally calibrate the power and save
all values to flash.
The commands are summarized in the following table:
CALx Complete Calibration Commands
Description: Allows the user to Calibrate the IC.
Usage: CAL Calibrates temperature, then voltage,
The atomic calibration commands provide individual calibration of voltage, current, temperature, watts
and a sequence of these results in providing full calibration for the unit.
6.5.2.1 CLV Command
An example of an atomic calibration command would be to calibrate voltage with the CLV command. The
CLV command calibrates voltage to the target value and tolerance and saves the coefficients to flash.
The CLV command example is given below:
>CLV<CR>
The response is:
VCal OK:
>
6.5.2.2 CLI Command
The user can then calibrate the current using the CLI1 command. The CLI1 command calibrates the
current to the target value and tolerance and saves the coefficients to flash. The CLI1 command example
is given below:
>CLI1<CR>
The response is:
ICal 0 OK:
>
6.5.2.3 CLP Command
The user can calibrate for phase added by a current transformer by using the CLP command. The CLP
command calibrates the phase to the target value and tolerance and saves the coefficient to flash. An
example of the procedure is given below.
Apply a controlled precision voltage and current signal at a set phase angle.
The CLT command is used for the temperature calibration. This command adjusts the Temperature
Nominal at MPU location 0xA6, saves to flash and will initiate temperature gain compensation. The CLT
command example is given below:
>CLT<CR>
The response is:
TCal OK
>
A summary of the atomic calibration commands are given in the table below:
CLxx Atomic Calibration
Commands
Description: Allows the user to Calibrate individual sections of the IC.
Usage: CLV Calibrates voltage only.
CLI1 Calibrate current only.
CLW1 Calibrate for power only.
CLP Calibrate for phase only.
CLT Calibrate temperature only.
The commands that follow are mainly for advanced users and are included for reference only.
6.6 CE Data Access Commands
The CE is the main signal processing unit in the 78M6613. The user writes to the CE data space are
mainly for calibration purposes. For the advanced user, details of CE data access commands are
described. The commands similar to the MPU access except that ] is used for the CE data access
command.
The host requests access to information from the CE data space using the CE data access command
which is a right bracket:
]
To request information, the host sends the CE data access command, the address location (in hex), the
format in which the data is desired (hex or decimal) and a carriage return. The contents of the addresses
that would be requested by the host are contained in Section 8.2.
The host can request the information in hex or decimal format. $ requests information in hex and ?
requests information in decimal.
6.6.1 Single Register CE Access
An example of a command requesting the calibration constant for current (located at address 0x08) in
decimal is as follows:
>]08?<CR>
An example of a command requesting the calibration constant for current (located at address 0x08) in hex
The host can request information from consecutive addresses by adding additional ? for decimal or
additional $ for hex.
An example of requests for the contents in decimal of ten consecutive addresses starting with 0x08 would be:
>]08??????????<CR>
An example of requests for the contents in hex of ten consecutive addresses starting with 0x08 would be:
>]08$$$$$$$$$$<CR>
Note: The number of characters per line is limited to 60 characters. Any character beyond the 60
character limit will be ignored by the CLI command interpreter.
6.6.3 CE Data Write
An example of a command writing to calibration constant for current (located at address 0x08) in decimal
is as follows:
>]08 = +16384 <CR>
An example of a command writing to calibration constant for current (located at address 0x08) in hex is as
follows:
>]08=4000 <CR>
6.6.4 U Command
The U command is used for updating default values of the CE Data permanently in the flash. Before
issuing the U command, CE must first be turned off by the disable CE command.
An example of a U command is as follows:
>CE0
>]U
Additional examples of CE Data Access commands are provided in the following table:
] CE Data Access
Description: Allows user to read from and write to CE data space.
Usage: ] {Starting CE Data Address}{option}…{option}<CR>
Command
Combinations:
]saddr?<CR> Read 32-bit word in decimal.
]saddr??<CR> R ead t wo consecutive 32-bit words in decimal.
]saddr???<CR> Read three consecutive 32-bit words in decimal.
]saddr$<CR> Read 32-bit words in hex.
]saddr$$<CR> R ead t wo consecutive 32-bit words in hex.
]saddr$$$<CR> Read thr ee consecutive 32-bit words in hex.
]U<CR> Update default version of CE Data in
FLASH. Important: The CE must be
stopped (CE0) before issuing this
command! Also, remember to restart
by executing the CE1 command prior to
attempting measurements.
The commands that follow are included for reference only.
6.7 CE Control Comma nds
The most pertinent command is the CE enable command, CEn. It is mainly used to turn the CE on or off.
The CE is normally enabled but in order to update the CE data entry to flash, the CE must first be turned
off using the CE0 command.
6.7.1 Disable CE Command
The CE can be disabled by using the following command:
>CE0<CR>
6.7.2 Turn On CE Command
The CE can be enabled by following command:
>CE1<CR>
Additional examples of CE Control Commands are provided in the following table:
C Compute Engin e Control
Description: Allows the user to enable and configure the compute engine.
Usage: C {option} {argument}<CR>
Command
Combinations:
Examples: CE0<CR> Disables the CE.
CEn<CR> Compute Engine Enable (1 Enable,
0 Disable)
CTn<CR> Select input n for TMUX output pin. Enter n in hex
notation.
CREn<CR> RTM output control (1 Enable, 0 Disable)
CRSa.b.c.d<CR> Selects CE addresses for RTM output. (maximum
of four).
CE1<CR> Enables the CE.
CT1E<CR> Selects the CE_BUSY signal for the TMUX output
This section describes the measurement outputs that can be obtained in Manual CLI Mode. Energy
outputs are accumulated numbers. The host accessing the measurement information from the 78M6613
more frequently than the accumulation interval will not result in any update in the information.
Table 2 lists the wideband measurement outputs.
Table 2: MPU Outputs
Output
Delta
Temperature
Line
Frequency
Alarm Status 22
Irms A
Overcurrent
Event Count
Location
20 0.1 °C
21 0.01 Hz Line Frequency
23
LSB Comment Example
Definition for Status Register
Bit 0: Minimum Temperature Alarm.
Bit 1: Maximum Temperature Alarm.
Bit 2: Minimum Frequency Alarm.
Bit 3: Maximum Frequency Alarm.
Bit 4: SAG Voltage Alarm.
Bit 5: MINVA
voltage on VA input.
Bit 6: MAXVA
voltage on VA input.
Bit 7: Reserved.
Bit 8: MAXIA WB
current exceeded.
Bit 9: Reserved.
Bit 10: Reserved.
Bit 11: PFA negative WB - Power
Factor Negative Threshold Alarm.
Only available if )F2 bit 2 is 1.
Bit 12: PFA positive WB
Factor Positive Threshold Alarm.
Bits 13 - 20: Reserved.
Bit 21 – CREEP Alert.
Bit 22 - 31: Reserved.
21 Line Frequency
22 Alarm Status
23 Over Current Event Count
24 Under Voltage Event Count
25 Over Voltage Event Count
26 Volts
27 Watts (A)
28 Energy (A)
29 Cost (A)
Wideband Data 2A Current (A)
2B VAR (A)
2C VA (A)
2D Power Factor (A)
2E Phase (A)
2F (Reserved for Future)
Min/Max Data 30 Vrms Min
31 Vrms Ma x
32 Watts Min (A)
33 Watts Max (A)
34 Current Min (A)
35 Current Max (A)
36 VAR Min (A)
37 VAR Max (A)
38 VA Min (A)
39 VA Max (A)
3A Power Factor Min (A)
3B Power Factor Max (A)
3C Phase Min (A)
3D Phase Max(A)
3E (Reserved for Future)
3F (Reserved for Future)
A6
A7 Reserved
A8 PPMC
A9 PPMC2
AA
AB Cost Unit s tring
AC - BC
BD
BE Unused
BF Tolerance on Phase Calibration
C0
C1 Calibration Voltage (Target)
C2 Calibration Current (Target)
C3 Calibration Phase
C4 Tolerance on Voltage Calibration
C5 Tolerance on Current Calibration
C6 Average Count for Voltage
C7 Average Count for Current
C8 Max Iterations for Voltage
C9 Max Iterations for Current
CA Tolerance on Watts Calibration
CB Average Count for Watts
CC Max Iterations for Watts
CD Calibration WRATE
DIO17 is a dedicated SAG status pin that is set high when SAG Voltage alarm triggers. SAG Voltage
alarm status is checked every MUX cycle for low latency detection of AC fault conditions. Both the
instantaneous voltage alarm threshold and sample count for the SAG alarm are configurable. See CE
STATE and SAG Threshold registers for more information.
DIO14 is a configurable alarm pin that is an ‘OR function’ of several mask-able alarm bits. The alarm
status is checked and updated following an update of the measurement output registers (once every
Accumulation cycle). See registers E6 and E7 for mask settings.
11 Contact Information
For more information about Maxim products or to check the availability of the 78M6613, contact technical
support at www.maxim-ic.com/support.