71M6521DE/71M6521FE Energy Meter IC
DATA SHEET
JANUARY 2008
GENERAL DESCRIPTION
The TERIDIAN 71M6521DE/FE is a highly integrated SOC with an MPU core, RTC, FLASH and LCD driver. TERIDIAN’s patented Single Converter Technology™ with a 22-bit delta-sigma ADC, four analog inputs, digital temperature compensation, precision voltage reference, battery voltage monitor, and 32-bit computation engine (CE) supports a wide range of residential metering applications with very few low-cost external components. A 32kHz crystal time base for the entire system and internal battery backup support for RAM and RTC further reduce system cost. The IC supports 2wire, 3-wire and 4-wire single-phase and dual-phase residential metering along with tamper-detection mechanisms. Maximum design flexibility is provided by multiple UARTs, I2C, μWire, up to 18 DIO pins and in-system programmable FLASH memory, which can be updated with data or application code in operation. A complete array of ICE and development tools, programming libraries and reference designs enable rapid development and certification of TOU, AMR and Prepay meters that comply with worldwide electricity metering standards.
FEATURES
• < 0.4% Wh accuracy over 2000:1 current range and over temperature • Exceeds IEC62053 / ANSIC12.20 standards • Voltage reference < 40ppm/°C • Four sensor inputs—VDD referenced • Low jitter Wh and VARh pulse test outputs (10kHz maximum) • Pulse count for pulse outputs • Four-quadrant metering • Tamper detection Neutral current with CT or shunt • Line frequency count for RTC • Digital temperature compensation • Sag detection for phase A and B • Independent 32-bit compute engine • 46-64Hz line frequency range with same calibration • Phase compensation (±7°) • Battery backup for RTC and battery monitor • Three battery modes w/ wake-up on push-button or timer: Brownout mode (48µA) LCD mode (5.7µA) Sleep mode (2.9µA) • Energy display on main power failure • Wake-up with push-button • 22-bit delta-sigma ADC • 8-bit MPU (80515), 1 clock cycle per instruction w/ integrated ICE for MPU debug • RTC with temperature compensation • Auto-Calibration • Hardware watchdog timer, power fail monitor • LCD driver (up to 152 pixels) • Up to 18 general purpose I/O pins • 32kHz time base • 16KB (6521DE) or 32KB (6521FE) FLASH with security • 2KB MPU XRAM • Two UARTs for IR and AMR • Digital I/O pins compatible with 5V inputs • 64-pin LQFP or 68-pin QFN package • Lead-Free packages
A NEUT B
CT/SHUNT LOAD LOAD POWER SUPPLY
CONVERTER IA VA IB VB
V3.3A
V3.3 GNDA GNDD SYS PWR MODE CONTROL WAKE-UP REGULATOR VBAT V2.5 BATTERY
TERIDIAN 71M6521
VOLTAGE REF VREF VBIAS SERIAL PORTS
TEMP SENSOR
DIO, PULSE
RAM FLASH COMPUTE ENGINE
COM0..3 SEG0..18 SEG 24..31/ DIO 4..11 SEG 34..37/ DIO 14..17 SEG 32,33, 38/ICE
3.3V LCD
88.88.8888
IIC or uWire EEPROM TEST PULSES
V3P3D GNDD
AMR
RX/DIO1 TX/DIO2
TX RX SENSE DRIVE/MOD COMPARATOR V1 OSC/PLL XIN XOUT
IR POWER FAULT 32 kHz
MPU
RTC TIMERS
ICE
ICE_E
07/25/2007
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 1 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Table of Contents
GENERAL DESCRIPTION ............................................................................................................................................1 FEATURES......................................................................................................................................................1 HARDWARE DESCRIPTION.........................................................................................................................................9 Hardware Overview..........................................................................................................................................9 Analog Front End (AFE)...................................................................................................................................9 Input Multiplexer ................................................................................................................................9 A/D Converter (ADC) .......................................................................................................................10 FIR Filter..........................................................................................................................................10 Voltage References .........................................................................................................................10 Temperature Sensor........................................................................................................................11 Battery Monitor ................................................................................................................................12 Functional Description .....................................................................................................................12 Digital Computation Engine (CE) ...................................................................................................................12 Meter Equations ..............................................................................................................................13 Real-Time Monitor ...........................................................................................................................14 Pulse Generator ..............................................................................................................................14 CE Functional Overview ..................................................................................................................14 80515 MPU Core ...........................................................................................................................................16 Memory Organization ......................................................................................................................16 Special Function Registers (SFRs)..................................................................................................18 Special Function Registers (Generic 80515 SFRs) .........................................................................19 Special Function Registers Specific to the 71M6521DE/FE ............................................................21 Instruction Set..................................................................................................................................22 UART...............................................................................................................................................22 Timers and Counters .......................................................................................................................25 WD Timer (Software Watchdog Timer)............................................................................................27 Interrupts .........................................................................................................................................29 On-Chip Resources .......................................................................................................................................37 Oscillator..........................................................................................................................................37 PLL and Internal Clocks...................................................................................................................37 Real-Time Clock (RTC) ...................................................................................................................37 Temperature Sensor........................................................................................................................37 Physical Memory .............................................................................................................................38 Optical Interface ..............................................................................................................................39 Digital I/O.........................................................................................................................................39 LCD Drivers .....................................................................................................................................41 Battery Monitor ................................................................................................................................42 EEPROM Interface ..........................................................................................................................42 Hardware Watchdog Timer..............................................................................................................45
Page: 2 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 Program Security.............................................................................................................................45 Test Ports ........................................................................................................................................46 FUNCTIONAL DESCRIPTION.....................................................................................................................................47 Theory of Operation .......................................................................................................................................47 System Timing Summary...............................................................................................................................48 Battery Modes................................................................................................................................................49 BROWNOUT Mode .........................................................................................................................50 LCD Mode .......................................................................................................................................51 SLEEP Mode ...................................................................................................................................51 Fault and Reset Behavior ..............................................................................................................................56 Wake Up Behavior .........................................................................................................................................57 Wake on PB.....................................................................................................................................57 Wake on Timer ................................................................................................................................57 Data Flow.......................................................................................................................................................58 CE/MPU Communication ...............................................................................................................................58 APPLICATION INFORMATION ...................................................................................................................................59 Connection of Sensors (CT, Resistive Shunt)................................................................................................59 Temperature Measurement ...........................................................................................................................60 Temperature Compensation ..........................................................................................................................60 Temperature Compensation and Mains Frequency Stabilization for the RTC ...............................................61 Connecting 5V Devices..................................................................................................................................62 Connecting LCDs...........................................................................................................................................63 Connecting I2C EEPROMs ............................................................................................................................65 Connecting Three-Wire EEPROMs................................................................................................................66 UART0 (TX/RX) .............................................................................................................................................66 Optical Interface.............................................................................................................................................67 Connecting V1 and Reset Pins ......................................................................................................................67 Connecting the Emulator Port Pins ................................................................................................................68 Crystal Oscillator............................................................................................................................................69 Flash Programming........................................................................................................................................69 MPU Firmware Library ...................................................................................................................................69 Meter Calibration............................................................................................................................................69 FIRMWARE INTERFACE ............................................................................................................................................70 I/O RAM MAP – In Numerical Order ..............................................................................................................70 SFR MAP (SFRs Specific to TERIDIAN 80515) – In Numerical Order ..........................................................71 I/O RAM DESCRIPTION – Alphabetical Order ..............................................................................................72 CE Interface Description ................................................................................................................................79 CE Program.....................................................................................................................................79 Formats ...........................................................................................................................................79 Constants ........................................................................................................................................79 Environment ....................................................................................................................................79
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 3 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 CE Calculations ...............................................................................................................................80 CE STATUS ....................................................................................................................................80 CE TRANSFER VARIABLES ..........................................................................................................82 ELECTRICAL SPECIFICATIONS ................................................................................................................................86 ABSOLUTE MAXIMUM RATINGS ................................................................................................................86 RECOMMENDED EXTERNAL COMPONENTS ...........................................................................................87 RECOMMENDED OPERATING CONDITIONS ............................................................................................87 PERFORMANCE SPECIFICATIONS ............................................................................................................88 INPUT LOGIC LEVELS ...................................................................................................................88 OUTPUT LOGIC LEVELS ...............................................................................................................88 POWER-FAULT COMPARATOR....................................................................................................88 BATTERY MONITOR ......................................................................................................................88 SUPPLY CURRENT ........................................................................................................................89 V3P3D SWITCH ..............................................................................................................................89 2.5V VOLTAGE REGULATOR ........................................................................................................89 LOW POWER VOLTAGE REGULATOR.........................................................................................89 CRYSTAL OSCILLATOR ................................................................................................................90 VREF, VBIAS ..................................................................................................................................90 LCD DRIVERS ................................................................................................................................90 ADC CONVERTER, V3P3A REFERENCED...................................................................................91 OPTICAL INTERFACE....................................................................................................................91 TEMPERATURE SENSOR .............................................................................................................91 TIMING SPECIFICATIONS ...........................................................................................................................92 FLASH MEMORY TIMING ..............................................................................................................92 EEPROM INTERFACE....................................................................................................................92 RESET and V1 ................................................................................................................................92 RTC .................................................................................................................................................92 TYPICAL PERFORMANCE DATA ..................................................................................................93 PACKAGE OUTLINE (LQFP 64) ...................................................................................................................94 PACKAGE OUTLINE (QFN 68) .....................................................................................................................95 PINOUT (LQFP-64) .......................................................................................................................................96 PINOUT (QFN 68) .........................................................................................................................................96 Recommended PCB Land Pattern for the QFN-68 Package .........................................................................97 PIN DESCRIPTIONS .....................................................................................................................................98 Power/Ground Pins:.........................................................................................................................98 Analog Pins: ....................................................................................................................................98 Digital Pins:......................................................................................................................................99 I/O Equivalent Circuits: .................................................................................................................. 100 ORDERING INFORMATION ....................................................................................................................... 101
Page: 4 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
List of Figures
Figure 1: IC Functional Block Diagram...........................................................................................................................8 Figure 2: General Topology of a Chopped Amplifier ....................................................................................................11 Figure 3: AFE Block Diagram.......................................................................................................................................12 Figure 4: Samples from Multiplexer Cycle....................................................................................................................15 Figure 5: Accumulation Interval....................................................................................................................................15 Figure 6: Interrupt Structure .........................................................................................................................................36 Figure 7: Optical Interface ...........................................................................................................................................39 Figure 8: Connecting an External Load to DIO Pins.....................................................................................................41 Figure 9: 3-Wire Interface. Write Command, HiZ=0. ....................................................................................................43 Figure 10: 3-Wire Interface. Write Command, HiZ=1 ...................................................................................................44 Figure 11: 3-Wire Interface. Read Command...............................................................................................................44 Figure 12: 3-Wire Interface. Write Command when CNT=0 .........................................................................................44 Figure 13: 3-Wire Interface. Write Command when HiZ=1 and WFR=1.......................................................................44 Figure 14: Functions defined by V1..............................................................................................................................45 Figure 15: Voltage. Current, Momentary and Accumulated Energy .............................................................................47 Figure 16: Timing Relationship between ADC MUX, Compute Engine, and Serial Transfers. .....................................48 Figure 17: RTM Output Format ....................................................................................................................................49 Figure 18: Operation Modes State Diagram.................................................................................................................51 Figure 19: Functional Blocks in BROWNOUT Mode (inactive blocks grayed out)........................................................52 Figure 20: Functional Blocks in LCD Mode (inactive blocks grayed out)......................................................................53 Figure 21: Functional Blocks in SLEEP Mode (inactive blocks grayed out) .................................................................54 Figure 22: Transition from BROWNOUT to MISSION Mode when System Power Returns .........................................55 Figure 23: Power-Up Timing with V3P3SYS and VBAT tied together ..........................................................................55 Figure 24: Power-Up Timing with VBAT only ...............................................................................................................56 Figure 25: Wake Up Timing..........................................................................................................................................57 Figure 26: MPU/CE Data Flow .....................................................................................................................................58 Figure 27: MPU/CE Communication ............................................................................................................................58 Figure 28: Resistive Voltage Divider (Left), Current Transformer (Right) .....................................................................59 Figure 29: Resistive Shunt ...........................................................................................................................................59 Figure 30: Crystal Frequency over Temperature..........................................................................................................61 Figure 31: Crystal Compensation .................................................................................................................................62 Figure 32: Connecting LCDs ........................................................................................................................................63 Figure 33: I2C EEPROM Connection............................................................................................................................65 Figure 34: Three-Wire EEPROM Connection...............................................................................................................66 Figure 35: Connections for the RX Pin .........................................................................................................................66 Figure 36: Connection for Optical Components ...........................................................................................................67 Figure 37: Voltage Divider for V1 .................................................................................................................................68 Figure 38: External Components for the RESET Pin: Push-Button (Left), Production Circuit (Right)...........................68 Figure 39: External Components for the Emulator Interface ........................................................................................69 Figure 40: Wh Accuracy, 0.1A to 200A at 240V/50Hz and Room Temperature...........................................................93 Figure 41: Meter Accuracy over Harmonics at 240V, 30A............................................................................................93 Figure 42: Typical Meter Accuracy over Temperature Relative to 25°C.......................................................................94
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 5 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
List of Tables
Table 1: Inputs Selected in Regular and Alternate Multiplexer Cycles .........................................................................10 Table 2: CE DRAM Locations for ADC Results............................................................................................................13 Table 3: Meter Equations. ...........................................................................................................................................13 Table 4: Memory Map ..................................................................................................................................................16 Table 5: Stretch Memory Cycle Width ..........................................................................................................................17 Table 6: Internal Data Memory Map.............................................................................................................................18 Table 7: Special Function Registers Locations ............................................................................................................18 Table 8: Special Function Registers Reset Values ......................................................................................................19 Table 9: PSW Register Flags .......................................................................................................................................20 Table 10: PSW Bit Functions .......................................................................................................................................20 Table 11: Port Registers ..............................................................................................................................................21 Table 12: Special Function Registers...........................................................................................................................22 Table 13: Baud Rate Generation..................................................................................................................................23 Table 14: UART Modes................................................................................................................................................23 Table 15: The S0CON Register ...................................................................................................................................23 Table 16: The S1CON register.....................................................................................................................................24 Table 17: The S0CON Bit Functions ............................................................................................................................24 Table 18: The S1CON Bit Functions ............................................................................................................................24 Table 19: The TCON Register......................................................................................................................................25 Table 20: The TCON Register Bit Functions................................................................................................................25 Table 21: The TMOD Register .....................................................................................................................................26 Table 22: TMOD Register Bit Description ....................................................................................................................26 Table 23: Timers/Counters Mode Description ..............................................................................................................26 Table 24: Timer Modes ................................................................................................................................................27 Table 25: The PCON Register .....................................................................................................................................27 Table 26: PCON Register Bit Description.....................................................................................................................27 Table 27: The IEN0 Register (see also Table 32) ........................................................................................................28 Table 28: The IEN0 Bit Functions (see also Table 32).................................................................................................28 Table 29: The IEN1 Register (see also Tables 30/31) .................................................................................................28 Table 30: The IEN1 Bit Functions (see also Tables 30/31) ..........................................................................................28 Table 31: The IP0 Register (see also Table 45)...........................................................................................................28 Table 32: The IP0 bit Functions (see also Table 45)....................................................................................................29 Table 33: The WDTREL Register.................................................................................................................................29 Table 34: The WDTREL Bit Functions .........................................................................................................................29 Table 35: The IEN0 Register........................................................................................................................................30 Table 36: The IEN0 Bit Functions ................................................................................................................................30 Table 37: The IEN1 Register........................................................................................................................................30 Table 38: The IEN1 Bit Functions ................................................................................................................................30 Table 39: The IEN2 Register........................................................................................................................................31 Table 40: The IEN2 Bit Functions ................................................................................................................................31 Table 41: The TCON Register......................................................................................................................................31 Table 42: The TCON Bit Functions ..............................................................................................................................31 Table 43: The T2CON Bit Functions ............................................................................................................................31 Table 44: The IRCON Register ....................................................................................................................................32 Table 45: The IRCON Bit Functions.............................................................................................................................32 Table 45: External MPU Interrupts ...............................................................................................................................32
Page: 6 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 Table 46: Interrupt Enable and Flag Bits .....................................................................................................................33 Table 48: Priority Level Groups....................................................................................................................................34 Table 49: The IP0 Register ..........................................................................................................................................34 Table 50: The IP1 Register: .........................................................................................................................................34 Table 51: Priority Levels...............................................................................................................................................34 Table 52: Interrupt Polling Sequence ...........................................................................................................................35 Table 53: Interrupt Vectors...........................................................................................................................................35 Table 54: Data/Direction Registers and Internal Resources for DIO Pin Groups .........................................................40 Table 55: DIO_DIR Control Bit .....................................................................................................................................40 Table 56: Selectable Controls using the DIO_DIR Bits ................................................................................................41 Table 57: EECTRL Status Bits .....................................................................................................................................42 Table 58: EECTRL bits for 3-wire interface .................................................................................................................43 Table 59: TMUX[4:0] Selections...................................................................................................................................46 Table 60: Available Circuit Functions (“—“ means “not active).....................................................................................50 Table 61: Frequency over Temperature .......................................................................................................................61 Table 62: LCD and DIO Pin Assignment by LCD_NUM for the QFN-68 Package .......................................................64 Table 63: LCD and DIO Pin Assignment by LCD_NUM for the LQFP-64 Package......................................................65
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 7 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
VREF V3P3A GNDA V3P3SYS
IA VA IB VB
ΔΣ ADC CONVERTER MUX VBAT VBIAS VBIAS V3P3A + ADC_E TEMP MUX MUX CTRL EQU MUX_ALT CHOP_E MUX_DIV VREF VREF_CAL VREF_DIS CROSS CK32 VOLT REG VREF VBAT FIR_LEN FIR
V3P3D
V3P3D
VBAT
X4MHZ XIN XOUT CKTEST/ SEG19
OSC (32KHz)
RTCLK (32KHz)
MCK PLL
CK32 32KHz
DIV ADC CKADC
LCD_ONLY SLEEP CKFIR 4.9MHz 2.5V to logic V3P3D LCD_GEN VLC2 VLC1 LCD_MODE LCD_E LCD DISPLAY DRIVER MEMORY SHARE LCD_NUM LCD_MODE LCD_CLK LCD_E LCD_BLKMAP LCD_SEG LCD_Y DIGITAL I/O DIO_EEX DIO_PV/PW DIO_DIR DIO_R LCD_NUM DIO RTC RTC_DEC_SEC RTC_INC_SEC CONFIGURATION PARAMETERS VLC0
GNDD V2P5
CKOUT_E 4.9MHz CKOUT_E CK_GEN ECK_DIS M PU_DIV MUX_SYNC CKCE =1 IP1.4/ IP0.4
RI0 UART0 TI0 EEPROM/ I2C
XF ER_BUSY
IEN1.4 INT5 IRCON.4 IEN1.5
IE_XFER
IRCON.5 INT6
IP1.5/ IP0.5
RTC_1S
IE_RTC
Figure 6: Interrupt Structure
Page: 36 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
On-Chip Resources
Oscillator
The 71M6521DE/FE oscillator drives a standard 32.768kHz watch crystal. These crystals are accurate and do not require a high-current oscillator circuit. The 71M6521DE/FE oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability.
PLL and Internal Clocks
Timing for the device is derived from the 32.768kHz oscillator output. On-chip timing functions include the MPU master clock, a real time clock (RTC), and the delta-sigma sample clock. In addition, the MPU has two general counter/timers (see MPU section). The ADC master clock, CKADC, is generated by an on-chip PLL. It multiplies the oscillator output frequency (CK32) by 150. The CE clock frequency is always CK32 * 150, or 4.9152MHz, where CK32 is the 32kHz clock. The MPU clock frequency is determined by MPU_DIV and can be 4.9152MHz *2-MPU_DIV Hz where MPU_DIV varies from 0 to 7 (MPU_DIV is 0 on powerup). This makes the MPU clock scalable from 4.9152MHz down to 38.4kHz. The circuit also generates a 2x MPU clock for use by the emulator. This clock is not generated when ECK_DIS is asserted by the MPU. The setting of MPU_DIV is maintained when the device transitions to BROWNOUT mode, but the time base in BROWNOUT mode is 28,672Hz.
Real-Time Clock (RTC)
The RTC is driven directly by the crystal oscillator. It is powered by the net V2P5NV (battery-backed up supply). The RTC consists of a counter chain and output registers. The counter chain consists of seconds, minutes, hours, day of week, day of month, month, and year. The RTC is capable of processing leap years. Each counter has its own output register. Whenever the MPU reads the seconds register, all other output registers are automatically updated. Since the RTC clock is not coherent to the MPU clock, the MPU must read the seconds register until two consecutive reads are the same (requires either 2 or 3 reads). At this point, all RTC output registers will have the correct time. Regardless of the MPU clock speed, RTC reads require one wait state. RTC time is set by writing to the RTC registers in I/O RAM. Each byte written to RTC must be delayed at least 3 RTC cycles from any previous byte written to RTC. Hardware RTC write protection requires that a write to address 0x201F occur before each RTC write. Writing to address 0x201F opens a hardware ‘enable gate’ that remains open until an RTC write occurs and then closes. It is not necessary to disable interrupts between the write operation to 0x201F and the RTC write because the ‘enable gate’ will remain open until the RTC write finally occurs Two time correction bits, RTC_DEC_SEC and RTC_INC_SEC are provided to adjust the RTC time. A pulse on one of these bits causes the time to be decremented or incremented by an additional second at the next update of the RTC_SEC register. Thus, if the crystal temperature coefficient is known, the MPU firmware can integrate temperature and correct the RTC time as necessary.
Temperature Sensor
The device includes an on-chip temperature sensor for determining the temperature of the bandgap reference. The MPU may request an alternate multiplexer frame containing the temperature sensor output by asserting MUX_ALT. The primary use of the temperature data is to determine the magnitude of compensation required to offset the thermal drift in the system (see section titled “Temperature Compensation”).
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 37 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Physical Memory
Flash Memory: The 71M6521DE/FE includes 16KB (71M6521DE) or 32KB (71M6521FE) of on-chip flash memory. The flash memory primarily contains MPU and CE program code. It also contains images of the CE DRAM, MPU RAM, and I/O RAM. On power-up, before enabling the CE, the MPU copies these images to their respective locations. Allocated flash space for the CE program cannot exceed 1024 words (2KB). The CE program must begin on a 1KB boundary of the flash address. The CE_LCTN[4:0] word defines which 1KB boundary contains the CE code. Thus, the first CE instruction is located at 1024*CE_LCTN[4:0] . CE_LCTN must be defined before the CE is enabled. The flash memory is segmented into 512 byte individually erasable pages. The CE engine cannot access its program memory when flash write occurs. Thus, the flash write procedure is to begin a sequence of flash writes when CE_BUSY falls (CE_BUSY interrupt) and to make sure there is sufficient time to complete the sequence before CE_BUSY rises again. The actual time for the flash write operation will depend on the exact number of cycles required by the CE program. Typically (CE program is 512 instructions, mux frame is 13 CK32 cycles), there will be 200µs of flash write time, enough for 4 bytes of flash write. If the CE code is shorter, there will be even more time. Two interrupts warn of collisions between the MPU firmware and the CE timing. If a flash write is attempted while the CE is busy, the flash write will not execute and the FW_COL0 interrupt will be issued. If a flash write is still in progress when the CE would otherwise begin a code pass, the code pass is skipped, the write is completed, and the FW_COL1 interrupt is issued. The bit FLASH66Z (see I/O RAM table) defines the speed for accessing flash memory. To minimize supply current draw, this bit should be set to 1. Flash erasure is initiated by writing a specific data pattern to specific SFR registers in the proper sequence. These special pattern/sequence requirements prevent inadvertent erasure of the flash memory. The mass erase sequence is: 1. 2. Write 1 to the FLSH_MEEN bit (SFR address 0xB2[1]. Write pattern 0xAA to FLSH_ERASE (SFR address 0x94) The mass erase cycle can only be initiated when the ICE port is enabled.
The page erase sequence is: 1. 2. Write the page address to FLSH_PGADR (SFR address 0xB7[7:1] Write pattern 0x55 to FLSH_ERASE (SFR address 0x94)
The MPU may write to the flash memory. This is one of the non-volatile storage options available to the user in addition to external EEPROM. FLSH_PWE (flash program write enable) differentiates 80515 data store instructions (MOVX@DPTR,A) between Flash and XRAM writes. Updating individual bytes in flash memory: The original state of a flash byte is 0xFF (all ones). Once, a value other than 0xFF is written to a flash memory cell, overwriting with a different value usually requires that the cell is erased first. Since cells cannot be erased individually, the page has to be copied to RAM, followed by a page erase. After this, the page can be updated in RAM and then written back to the flash memory. MPU RAM: The 71M6521DE/FE includes 2k-bytes of static RAM memory on-chip (XRAM) plus 256-bytes of internal RAM in the MPU core. The 2K-bytes of static RAM are used for data storage during normal MPU operations. CE DRAM: The CE DRAM is the working data memory of the CE (128 32-bit words). The MPU can read and write the CE DRAM as the primary means of data communication between the two processors.
Page: 38 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Optical Interface
The device includes an interface to implement an IR/optical port. The pin OPT_Tx is designed to directly drive an external LED for transmitting data on an optical link. The pin OPT_RX is designed to sense the input from an external photo detector used as the receiver for the optical link. These two pins are connected to a dedicated UART port (UART1). The OPT_TX and OPT_RX pins can be inverted with configuration bits OPT_TXINV and OPT_RXINV, respectively. Additionally, the OPT_TX output may be modulated at 38kHz. Modulation is available when system power is present (i.e. not in BROWNOUT mode). The OPT_TXMOD bit enables modulation. Duty cycle is controlled by OPT_FDC[1:0] , which can select 50%, 25%, 12.5%, and 6.25% duty cycle. 6.25% duty cycle means OPT_TX is low for 6.25% of the period. Figure 7 illustrates the OPT_TX generator.
VARPULSE WPULSE from OPT_TX UART OPT_TXINV OPT_TXMOD OPT_FDC A EN 2 OPT_TXMOD=1, OPT_FDC=2 (25%) A B 1/38kHz MOD DUTY DIO2 B
2 1 0 3
Internal OPT_TX
V3P3
OPT_TXE[1:0]
OPT_TXMOD=0 A B
Figure 7: Optical Interface
When not needed for the optical UART, the OPT_TX pin can alternatively be configured as DIO2, WPULSE, or VARPULSE. The configuration bits are OPT_TXE[1:0] . Likewise, OPT_RX can alternately be configured as DIO_1. Its control is OPT_RXDIS.
Digital I/O
The device includes up to 18 pins (QFN 68 package) or 14 pins (LQFP 64 package) of general purpose digital I/O. These pins are compatible with 5V inputs (no current-limiting resistors are needed). Some of them are dedicated DIO (DIO3), some are dual-function that can alternatively be used as LCD drivers (DIO4-11, 14-17, 19-21) and some share functions with the optical port (DIO1, DIO2). On reset or power-up, all DIO pins are inputs until they are configured for the desired direction under MPU control. The pins are configured by the DIO registers and by the five bits of the LCD_NUM register (located in I/O RAM). Once declared as DIO, each pin can be configured independently as an input or output with the DIO_DIRn bits. A 3-bit configuration word, DIO_Rx, can be used for certain pins, when configured as DIO, to individually assign an internal resource such as an interrupt or a timer control. Table 54 lists the direction registers and configurability associated with each group of DIO pins. Table 55 shows the configuration for a DIO pin through its associated bit in its DIO_DIR register. Tables showing the relationship between LCD_NUM and the available segment/DIO pins can be found in the Applications section and in the I/O RAM Description under LCD_NUM[4:0].
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 39 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 DIO Pin no. (64 LQFP) Pin no. (68 QFN) Data Register Direction Register Internal Resources Configurable DIO Pin no. (64 LQFP) Pin no. (68 QFN) Data Register Direction Register Internal Resources Configurable PB 62 65 0 0 Y 16 22 23 0 0 N 1 57 60 1 2 3 4 5 6 3 37 38 39 3 5 39 40 41 2 3 4 5 6 DIO0=P0 (SFR 0x80) 1 2 3 4 5 6 DIO_DIR0 (SFR 0xA2) Y Y Y Y Y 7 40 42 7 7 Y 23 ----8 41 43 0 0 Y 9 42 44 1 10 11 12 13 43 44 --45 46 --2 3 --DIO1=P1 (SFR 0x90) 1 2 3 --DIO_DIR1 (SFR 0x91) Y Y --14 20 21 6 6 -15 21 22 7 7 --
Y 17 12 13 1
Y
18 19 20 21 22 ------24 47 68 -3 4 5 -DIO2=P2 (SFR 0xA0) 1 -3 4 5 -DIO_DIR2 (SFR 0xA1) -N N N --
N
Table 54: Data/Direction Registers and Internal Resources for DIO Pin Groups
DIO_DIR [n]
0 DIO Pin n Function Input
1 Output
Table 55: DIO_DIR Control Bit Additionally, if DIO6 and DIO7 are declared outputs, they can be configured as dedicated pulse outputs (WPULSE = DIO6, VARPULSE = DIO7) using DIO_PW and DIO_PV registers. In this case, DIO6 and DIO7 are under CE control. DIO4 and DIO5 can be configured to implement the EEPROM Interface. The PB pin is a dedicated digital input. If the optical UART is not used, OPT_TX and OPT_RX can be configured as dedicated DIO pins (DIO1, DIO2, see Optical Interface section). A 3-bit configuration word, I/O RAM register, DIO_Rx (0x2009[2:0] through 0x200E[6:4]) can be used for certain pins, when configured as DIO, to individually assign an internal resource such as an interrupt or a timer control (see Table 54 for DIO pins available for this option). This way, DIO pins can be tracked even if they are configured as outputs. Tracking DIO pins configured as outputs is useful for pulse counting without external hardware.
When driving LEDs, relay coils etc., the DIO pins should sink the current into GNDD (as shown in Figure 8, right), not source it from V3P3D (as shown in Figure 8, left). This is due to the resistance of the internal switch that connects V3P3D to either V3P3SYS or VBAT. When configured as inputs, the dual-function (DIO/SEG) pins should not be pulled above V3P3SYS in MISSION and above VBAT in LCD and BROWNOUT modes. Doing so will distort the LCD waveforms of the other pins. This limitation applies to any pin that can be configured as a LCD driver. The control resources selectable for the DIO pins are listed in Table 56. If more than one input is connected to the same resource, the resources are combined using a logical OR.
Page: 40 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 The PB pin is a dedicated digital input. In addition, if the optical UART is not used, OPT_TX and OPT_RX can be configured as dedicated DIO pins. Thus, in addition to the 16 general-purpose DIO pins (DIO4…DIO11, DIO14…DIO21), there are three additional pins that can be used for digital input and output.
71M6521 V3P3SYS VBAT V3P3D DIO1 3.3V
71M6521 V3P3SYS VBAT V3P3D DIO1 3.3V LED
R
LED DGND Not recommended
DGND
R
Recommended
Figure 8: Connecting an External Load to DIO Pins
DIO_R Value 0 1 2 3 4 5 6 7
Resource Selected for DIO Pin NONE Reserved T0 (counter0 clock) T1 (counter1 clock) High priority I/O interrupt (INT0 rising) Low priority I/O interrupt (INT1 rising) High priority I/O interrupt (INT0 falling) Low priority I/O interrupt (INT1 falling)
Table 56: Selectable Controls using the DIO_DIR Bits
LCD Drivers
The device in the 68-pin QFN package contains 20 dedicated LCD segment drivers in addition to the 18 multi-use pins described above. Thus, the device is capable of driving between 80 to 152 pixels of LCD display with 25% duty cycle (or 60 to 114 pixels with 33% duty cycle). At eight pixels per digit, this corresponds to 10 to 19 digits. The device in the 64-pin LQFP package contains 20 dedicated LCD segment drivers in addition to the 15 multi-use pins described above. Thus, the device is capable of driving between 80 to 140 pixels of LCD display with 25% duty cycle (or 60 to 105 pixels with 33% duty cycle). At eight pixels per digit, this corresponds to 10 to 17 digits. The LCD drivers are grouped into four commons and up to 38 segment drivers (68-pin package), or 4 commons and 35 segment drivers (64-pin package). The LCD interface is flexible and can drive either digit segments or enunciator symbols. Segment drivers SEG18 and SEG19 can be configured to blink at either 0.5Hz or 1Hz. The blink rate is controlled by LCD_Y. There can be up to four pixels/segments connected to each of these drivers. LCD_BLKMAP18[3:0] and LCD_BLKMAP19[3:0] identify which pixels, if any, are to blink.
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 41 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008 LCD interface memory is powered by the non-volatile supply. The bits of the LCD memory are preserved in LCD and SLEEP modes, even if their pin is not configured as SEG. In this case, they can be useful as generalpurpose non-volatile storage.
Battery Monitor
The battery voltage is measured by the ADC during alternative MUX frames if the BME (Battery Measure Enable) bit is set. While BME is set, an on-chip 45kΩ load resistor is applied to the battery and a scaled fraction of the battery voltage is applied to the ADC input. After each alternative MUX frame, the result of the ADC conversion is available at CE DRAM address 0x07. BME is ignored and assumed zero when system power is not available. See the Battery Monitor section of the Electrical Specification section for details regarding the ADC LSB size and the conversion accuracy.
EEPROM Interface
The 71M6521DE/FE provides hardware support for either type of EEPROM interface, a two-pin interface and a three-pin interface. The interfaces use the EECTRL and EEDATA registers for communication.
Two-Pin EEPROM Interface
The dedicated 2-pin serial interface communicates with external EEPROM devices. The interface is multiplexed onto pins DIO4 (SCK) and DIO5 (SDA) controlled by the DIO_EEX bit I/O RAM (see I/O RAM Table). The MPU communicates with the interface through two SFR registers: EEDATA and EECTRL. If the MPU wishes to write a byte of data to EEPROM, it places the data in EEDATA and then writes the ‘Transmit’ command (CMD = 0011) to EECTRL. This initiates the transmit operation. The transmit operation is finished when the BUSY bit falls. Interrupt INT5 is also asserted when BUSY falls. The MPU can then check the RX_ACK bit to see if the EEPROM acknowledged the transmission. A byte is read by writing the ‘Receive’ command (CMD = 0001) to EECTRL and waiting for the BUSY bit to fall. Upon completion, the received data is in EEDATA. The serial transmit and receive clock is 78kHz during each transmission, and the clock is held in a high state until the next transmission. The bits in EECTRL are shown in Table 57. The EEPROM interface can also be operated by controlling the DIO4 and DIO5 pins directly (“bit-banging”). However, controlling DIO4 and DIO5 directly is discouraged, because it may tie up the MPU to the point where it may become too busy to process interrupts. Status Bit 7 6 5 4 Name ERROR BUSY RX_ACK TX_ACK Read/ Write R R R R Reset State 0 0 1 1 Polarity Positive Positive Negative Negative Description 1 when an illegal command is received. 1 when serial data bus is busy. 0 indicates that the EEPROM sent an ACK bit. 0 indicates when an ACK bit has been sent to the EEPROM CMD 0000 Operation No-op. Applying the no-op command will stop the I2C clock (SCK, DIO4). Failure to issue the no-op command will keep the SCK signal toggling. Receive a byte from EEPROM and send ACK. Transmit a byte to EEPROM. Issue a ‘STOP’ sequence. Receive the last byte from EEPROM, do not send ACK. Issue a ‘START’ sequence. No Operation, set the ERROR bit.
3-0
CMD[3:0 ]
W
0
Positive, see CMD Table
0001 0011 0101 0110 1001 Others
Table 57: EECTRL Status Bits
Page: 42 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Three-Wire EEPROM Interface
A 500kHz three-wire interface, using SDATA, SCK, and a DIO pin for CS is available. The interface is selected with DIO_EEX=3. The same 2-wire EECTRL register is used, except the bits are reconfigured, as shown in Table 58. When EECTRL is written, up to 8 bits from EEDATA are either written to the EEPROM or read from the EEPROM, depending on the values of the EECTRL bits.
Control Bit 7
Name
Read/Write
Description Wait for Ready. If this bit is set, the trailing edge of BUSY will be delayed until a rising edge is seen on the data line. This bit can be used during the last byte of a Write command to cause the INT5 interrupt to occur when the EEPROM has finished its internal write sequence. This bit is ignored if HiZ=0. Asserted while serial data bus is busy. When the BUSY bit falls, an INT5 interrupt occurs. Indicates that the SD signal is to be floated to high impedance immediately after the last SCK rising edge. Indicates that EEDATA is to be filled with data from EEPROM. Specifies the number of clocks to be issued. Allowed values are 0 through 8. If RD=1, CNT bits of data will be read MSB first, and right justified into the low order bits of EEDATA. If RD=0, CNT bits will be sent MSB first to EEPROM, shifted out of EEDATA’s MSB. If CNT is zero, SDATA will simply obey the HiZ bit. Table 58: EECTRL bits for 3-wire interface
WFR
W
6 5 4 3-0
BUSY HiZ RD
R W W W
CNT[3:0]
The timing diagrams in Figure 9 through Figure 13 describe the 3-wire EEPROM interface behavior. All commands begin when the EECTRL register is written. Transactions start by first raising the DIO pin that is connected to CS. Multiple 8-bit or less commands such as those shown in Figure 9 through Figure 13 are then sent via EECTRL and EEDATA. When the transaction is finished, CS must be lowered. At the end of a Read transaction, the EEPROM will be driving SDATA, but will transition to HiZ (high impedance) when CS falls. The firmware should then immediately issue a write command with CNT=0 and HiZ=0 to take control of SDATA and force it to a low-Z state.
EECTRL Byte Written Write -- No HiZ SCLK (output) SDATA (output) SDATA output Z BUSY (bit)
D7 D6 D5 (LoZ) D4 D3 D2
CNT Cycles (6 shown)
INT5
Figure 9: 3-Wire Interface. Write Command, HiZ=0.
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 43 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
EECTRL Byte Written Write -- With HiZ SCLK (output) SDATA (output) SDATA output Z BUSY (bit)
D7 D6 D5 (LoZ) D4 D3 D2 (HiZ)
CNT Cycles (6 shown)
INT5
Figure 10: 3-Wire Interface. Write Command, HiZ=1
EECTRL Byte Written READ SCLK (output) SDATA (input) SDATA output Z BUSY (bit)
D7 D6 (HiZ) D5 D4 D3 D2 D1 D0
CNT Cycles (8 shown)
INT5
Figure 11: 3-Wire Interface. Read Command.
EECTRL Byte Written Write -- No HiZ SCLK (output) SDATA (output) SDATA output Z BUSY (bit)
D7 (LoZ)
INT5 not issued CNT Cycles (0 shown)
EECTRL Byte Written Write -- HiZ SCLK (output) SDATA (output)
INT5 not issued CNT Cycles (0 shown)
SDATA output Z BUSY (bit)
(HiZ)
Figure 12: 3-Wire Interface. Write Command when CNT=0
EECTRL Byte Written Write -- With HiZ and WFR SCLK (output) SDATA (out/in) SDATA output Z BUSY (bit)
D7 D6 D5 (From 6520) (LoZ) D4 D3 D2 BUSY (From EEPROM) (HiZ) READY
CNT Cycles (6 shown)
INT5
Figure 13: 3-Wire Interface. Write Command when HiZ=1 and WFR=1.
Page: 44 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Hardware Watchdog Timer re
V1 V3P3 V3P3 - 10mV V3P3 400mV Normal operation, WDT enabled VBIAS WDT disabled
In addition to the basic watchdog timer included in the 80515 MPU, an independent, robust, fixed-duration, watchdog timer (WDT) is included in the device. It uses the RTC crystal oscillator as its time base and must be refreshed by the MPU firmware at least every 1.5 seconds. When not refreshed on time the WDT overflows, and the part is reset as if the RESET pin were pulled high, except that the I/O RAM bits will be in the same state as after a wake-up from SLEEP or LCD modes (see the I/O RAM description for a list of I/O RAM bit states after RESET and wake-up). 4100 oscillator cycles (or 125ms) after the WDT overflow, the MPU will be launched from program address 0x0000. A status bit, WD_OVF, is set when WDT overflow occurs. This bit is powered by the nonvolatile supply and can be read by the MPU to determine if the part is initializing after a WDT overflow event or after a power-up. After it is read, MPU firmware must clear WD_OVF. The WD_OVF bit is cleared by the RESET pin There is no internal digital state that deactivates the WDT. For debug purposes, however, the WDT can be disabled by tying the V1 pin to V3P3 (see Figure 37). Of course, this also deactivates V1 power fault detection. Since there is no method in firmware to disable the crystal oscillator or the WDT, it is guaranteed that whatever state the part might find itself in, upon WDT overflow, the part will be reset to a known state. Asserting ICE_E will also deactivate the WDT. This is the only method that will disable the WDT in BROWNOUT mode.
Battery modes
0V
In normal operation, the WDT is reset by periodically writing a one to the WDT_RST bit. The watchdog timer is also reset when the internal signal WAKE=0 (see section on Wake Up Behavior).
Figure 14: Functions defined by V1
Program Security
When enabled, the security feature limits the ICE to global flash erase operations only. All other ICE operations are blocked. This guarantees the security of the user’s MPU and CE program code. Security is enabled by MPU code that is executed in a 32 cycle preboot interval before the primary boot sequence begins. Once security is enabled, the only way to disable it is to perform a global erase of the flash, followed by a chip reset. The first 32 cycles of the MPU boot code are called the preboot phase because during this phase the ICE is inhibited. A readonly status bit, PREBOOT, identifies these cycles to the MPU. Upon completion of preboot, the ICE can be enabled and is permitted to take control of the MPU. SECURE, the security enable bit, is reset whenever the chip is reset. Hardware associated with the bit permits only ones to be written to it. Thus, preboot code may set SECURE to enable the security feature but may not reset it. Once SECURE is set, the preboot code is protected and no external read of program code is possible Specifically, when SECURE is set: • • • The ICE is limited to bulk flash erase only. Page zero of flash memory, the preferred location for the user’s preboot code, may not be page-erased by either MPU or ICE. Page zero may only be erased with global flash erase. Writes to page zero, whether by MPU or ICE are inhibited. The SECURE bit is to be used with caution! Inadvertently setting this bit will inhibit access to the part via the ICE interface, if no mechanism for actively resetting the part between reset and erase operations is provided (see ICE Interface description).
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 45 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
Test Ports
TMUXOUT Pin: One out of 16 digital or 8 analog signals can be selected to be output on the TMUXOUT pin. The function of the multiplexer is controlled with the I/O RAM register TMUX (0x20AA[4:0]), as shown in Table 59. TMUX[4:0] 0 1 2 3-5 6 7 8-0x0F 0x10 – 0x13 0x14 0x15 0x16 – 0x17 0x18 0x19 0x1A 0x1B 0x1C 0X1D 0X1E 0X1F Mode Analog Analog Analog Analog Analog Analog --Digital Digital Digital Digital Digital Digital -Digital Digital Digital Function DGND Reserved DGND Reserved VBIAS Not used Reserved Not used RTM (Real time output from CE) WDTR_EN (Comparator 1 Output AND V1LT3) Not used RXD (from Optical interface, w/ optional inversion) MUX_SYNC CK_10M (10MHz clock) CK_MPU (MPU clock) Reserved RTCLK (output of the oscillator circuit, nominally 32,786Hz) CE_BUSY (busy interrupt generated by CE, 396µs) XFER_BUSY (transfer busy interrupt generated by CE, nominally every 999.7ms) Table 59: TMUX[4:0] Selections
Page: 46 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
FUNCTIONAL DESCRIPTION
Theory of Operation
The energy delivered by a power source into a load can be expressed as:
t
E = ∫ V (t ) I (t )dt
0
Assuming phase angles are constant, the following formulae apply: P = Real Energy [Wh] = V * A * cos φ* t Q = Reactive Energy [VARh] = V * A * sin φ * t S = Apparent Energy [VAh] =
P2 + Q2
For a practical meter, not only voltage and current amplitudes, but also phase angles and harmonic content may change constantly. Thus, simple RMS measurements are inherently inaccurate. A modern solid-state electricity meter IC such as the TERIDIAN 71M6521DE/FE functions by emulating the integral operation above, i.e. it processes current and voltage samples through an ADC at a constant frequency. As long as the ADC resolution is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, multiplied with the time period of sampling will yield an accurate quantity for the momentary energy. Summing up the momentary energy quantities over time will result in accumulated energy.
500 400 300 200 100 0 0 -100 -200
Current [A]
5
10
15
20
-300 -400 -500
Voltage [V] Energy per Interval [Ws] Accumulated Energy [Ws]
Figure 15: Voltage. Current, Momentary and Accumulated Energy Figure 15 shows the shapes of V(t), I(t), the momentary power and the accumulated power, resulting from 50 samples of the voltage and current signals over a period of 20ms. The application of 240VAC and 100A results in an accumulation of 480Ws (= 0.133Wh) over the 20ms period, as indicated by the Accumulated Power curve. The described sampling method works reliably, even in the presence of dynamic phase shift and harmonic distortion.
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 47 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
System Timing Summary
Figure 16 summarizes the timing relationships between the input MUX states, the CE_BUSY signal, and the two serial output streams. In this example, MUX_DIV=4 and FIR_LEN=1 (384). The duration of each MUX frame is 1 + MUX_DIV * 2 if FIR_LEN=288, and 1 + MUX_DIV * 3 if FIR_LEN=384. An ADC conversion will always consume an integer number of CK32 clocks. Followed by the conversions is a single CK32 cycle where the bandgap voltage is allowed to recover from the change in CROSS. Each CE program pass begins when ADC0 (channel IA) conversion begins. Depending on the length of the CE program, it may continue running until the end of the ADC3 (VB) conversion. CE opcodes are constructed to ensure that all CE code passes consume exactly the same number of cycles. The result of each ADC conversion is inserted into the CE DRAM when the conversion is complete. The CE code is written to tolerate sudden changes in ADC data. The exact CK count when each ADC value is loaded into DRAM is shown in Figure 16. Figure 16 also shows that the serial RTM data stream begins transmitting at the beginning of state ‘S.’ RTM, consisting of 140 CK cycles, will always finish before the next code pass starts.
ADC MUX Frame
ADC TIMING
CK32 MUX_SYNC MUX STATE ADC EXECUTION ADC0 S 150 0
MUX_DIV Conversions, MUX_DIV=1 (4 conversions) is shown
Settle
1
2
3
S
ADC1 900
ADC2 1350
ADC3 1800 MAX CK COUNT
CE TIMING
CE_EXECUTION CE_BUSY XFER_BUSY
0
450
CK COUNT = CE_CYCLES + floor((CE_CYCLES + 2) / 5)
INITIATED BY A CE OPCODE AT END OF SUM INTERVAL
RTM TIMING
RTM NOTES: 1. ALL DIMENSIONS ARE 5MHZ CK COUNTS. 2. THE PRECISE FREQUENCY OF CK IS 150*CRYSTAL FREQUENCY = 4.9152MHz. 3. XFER_BUSY OCCURS ONCE EVERY (PRESAMPS * SUM_CYCLES) CODE PASSES.
140
Figure 16: Timing Relationship between ADC MUX, Compute Engine, and Serial Transfers.
Page: 48 of 101
© 2005-2008 TERIDIAN Semiconductor Corporation
v1.0
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
CK32 MUX_SYNC CKTEST TMUXOUT/RTM
LSB
0 1 30 31 0 1 30 31 0 1 30 31 0 1 30 31
SIG N
SIG N
SIG N
LSB
LSB
LSB
RTM DATA0 (32 bits) RTM DATA1 (32 bits) RTM DATA2 (32 bits) RTM DATA3 (32 bits)
Figure 17: RTM Output Format
Battery Modes
Shortly after system power (V3P3SYS) is applied, the part will be in MISSION mode. MISSION mode means that the part is operating with system power and that the internal PLL is stable. This mode is the normal operation mode where the part is capable of measuring energy. When system power is not available (i.e. when V1 1 V3P3SYS rises V3P3SYS rises LCD_ONLY IE_PLLFALL -> 1
RESET
V1 > VBIAS V1 1 timer SLEEP or VBAT_OK
IE_PB -> 1 PB
LCD
timer PB VBAT_OK VBAT_OK RESET & VBAT_OK
SLEEP
Figure 18: Operation Modes State Diagram
LCD Mode
In LCD mode, the data contained in the LCD_SEG registers is displayed, i.e. up to four LCD segments connected to each of the pins SEG18 and SEG19 can be made to blink without the involvement of the MPU, which is disabled in LCD mode. This mode can be exited only by system power up, a timeout of the wake-up timer, or a push button. Figure 20 shows the functional blocks active in LCD mode.
SLEEP Mode
In SLEEP mode, the battery current is minimized and only the Oscillator and RTC functions are active. This mode can be exited only by system power-up, a timeout of the wake-up timer, or a push button event. Figure 21 shows the functional blocks active in SLEEP mode.
v1.0
© 2005-2008 TERIDIAN Semiconductor Corporation
Page: 51 of 101
71M6521DE/71M6521FE Energy Meter IC
DATASHEET
JANUARY 2008
VREF V3P3A GNDA V3P3SYS
IA VA IB VB
ΔΣ ADC CONVERTER MUX VBAT VBIAS VBIAS V3P3A + ADC_E TEMP MUX MUX CTRL EQU MUX_ALT CHOP_E MUX_DIV VREF VREF_CAL VREF_DIS CROSS CK32 VOLT REG VREF VBAT FIR_LEN FIR
V3P3D
V3P3D
VBAT
X4MHZ XIN XOUT CKTEST/ SEG19
OSC (32KHz) RTCLK (32KHz)
MCK PLL
CK32 32KHz
DIV ADC CKADC
LCD_ONLY SLEEP CKFIR 4.9MHz 2.5V to logic V3P3D LCD_GEN VLC2 VLC1 LCD_MODE LCD_E LCD DISPLAY DRIVER MEMORY SHARE LCD_NUM LCD_MODE LCD_CLK LCD_E LCD_BLKMAP LCD_SEG LCD_Y DIGITAL I/O DIO_EEX DIO_PV/PW DIO_DIR DIO_R LCD_NUM DIO RTC RTC_DEC_SEC RTC_INC_SEC CONFIGURATION PARAMETERS VLC0
GNDD V2P5
CKOUT_E 4.9MHz CKOUT_E CK_GEN ECK_DIS M PU_DIV MUX_SYNC CKCE