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