MC9S08GW64 Single-phase single-chip energy meter

Reference Design Overview
MC9S08GW64
Single-phase single-chip energy meter
Overview
9S08GW 64/32 Block Diagram
The MC9S08GW is a low-power 8-bit
microcontroller family, based on the proven
S08 core, and used in gas or water flow
1.2V ref
meters, as well as single-phase electric
meters. Two independent 16-bit SAR ADCs
with a programmable delay block and a pulse
Background
Debug
Module
GPI/O
16-bit
SAR ADC
Analog
Front End
16-bit
SAR ADC
Programmable
Delay Block
counter with automatic sensor decoding for
gas and water flow meters make this family
ideal for electric metering applications. In
Voltage
Regulator
family comes with a full suite of hardware and
software tools to make development quick and
16/32-bit
Programmable Cyclic
Redundancy Code
AMR SPI
3 x SCI
2 x SPI
Keyboard
Interrupt
I2C
4K RAM
64K Flash
easy, including a cost-effective Tower module
for rapid development.
Feature list of MC9S08GW64
• 8-bit HCS08 central processor unit (CPU)
2 x 8-bit
Modulus
Timer
Core Clock
32 kHz/
1–16 MHz
OSC
1 x 16-bit
MTIM
ICS
Independent
Real-Time Clock
addition, the flexible LCD controller enables
it to be highly integrated. The MC9S08GW
2-ch.
Flex Timer
Module
32 kHz
OSC
Calendaring
Tamper Detects
Pulse
Counter
FCounter
RCounter
External Pin
Gating/Decoder
3 x Programmable Analog Comparator
New, low power version of S08 core with
same performance as traditional S08
Up to 20 MHz CPU at 3.6V to 2.1V and up
AMR SCI
Comparator 0–1.2V ref
SCI
to 10 MHz CPU at 2.1V to 1.8V, across a
temperature range of -40°C to +85°C
S08 Core
HC08 instruction set with added BGND
LCD
(1–8) x (43–36)
instruction
Support for up to 48 interrupt/reset sources
• On-chip memory
• System protection
Two analog-to-digital converters
Flash read/program/erase over full
Watchdog computer operating properly
(ADCs): 16-bit resolution, one dedicated
operating voltage and temperature
(COP) reset with option to run from
differential per ADC, up to 16-ch, up
Random-access memory (RAM)
dedicated 1 kHz internal clock source or
to 2.5 μs conversion time for 12-bit
Security circuitry to prevent unauthorized
bus clock
mode, automatic compare function,
access to RAM and flash contents
Low-voltage warning with interrupt
hardware averaging, calibration registers,
Low-voltage detection with reset or
temperature sensor, internal band gap
Oscillator (XOSC1): Loop-control Pierce
interrupt
reference channel, operation in stop3,
oscillator, crystal or ceramic resonator of
Illegal opcode and illegal address
fully functional from 3.6V to 1.8V
32.768 kHz, dedicated clock source for
detection with reset
Three rail to rail programmable reference
Flash block protection
analog comparators (PRACMP): Up to
• Clock source options
iRTC and optional for ICS
Oscillator (XOSC2): Loop-control Pierce
• Peripherals
eight inputs, on-chip programmable
oscillator, crystal or ceramic resonator
LCD: Up to 4 x 40 or 8 x 36 LCD driver
reference generator output, selectable
range of 31.25 kHz to 38.4 kHz or 1 MHz
with internal charge pump and option
interrupt on rising, falling, or either edge
to 16 MHz, optional clock source for ICS
to provide an internally regulated LCD
of comparator output, operation in stop3
reference that can be trimmed for
contrast control
SCI: Four full duplex non-return to
Hysteresis and configurable pull up
• Box-open tamper feature built in
zero (NRZ), LIN master extended break
device on all input pins, configurable slew
• Based on capacitive supply, meets 4 VA
generation, LIN slave extended break
rate and drive strength on all output pins
detection, wakeup on active edge, SCI0
designed for AMR operation, TxD of SCI1
requirement
• Measures and displays the following:
• Package options
80-pin LQFP, 64-pin LQFP
RMS voltage (accuracy ±1% of full scale)
and SCI2 can be modulated with timers
and RxD can recieved through PRACMP
SPI: Three full-duplex or single-wire
RMS currents (accuracy ±1% of full
scale)
Overview
Net active power (accuracy ±1% of
bi-directional, double-buffered transmit
This reference design is suitable for energy or
full scale)
and receive, master or slave mode, MSB-
electricity meters which measure and display
Net apparent power (accuracy ±1% of
first or LSB-first shifting, SPI0 designed
active energy (kWh) and apparent energy
full scale)
for AMR operation
(kVAh). It also measures and displays voltage,
Power factor (accuracy ± 0.1 PF
I2C: Up to 100 kbps with maximum
current, frequency, power factor, active power
or better)
bus loading, multi-master operation,
(kW), reactive power (kVAr), apparent power
Line frequency (accuracy ± 0.5 Hz
programmable slave address, interrupt
(kVA), maximum demand in kW as well as
or better)
driven byte-by-byte data transfer,
time and date. All of the electrical parameters
Tamper count
supporting broadcast mode and 10-bit
of the meter can be read using the optical
Active energy: Class 1 or better
addressing, supporting SM BUS
port, which is based on the IEC62056. The
Time and Date
functionality, can wake up from STOP3
meter can be calibrated and configured in
Maximum demand
FTM: 2-channel FTMs, selectable input
different modes using the optical interface.
• Operating frequency range of 50 Hz ±3 Hz
Design Features
• Measurement and storage of kWh
(230V, 5–30A model)
capture, output compare, or buffered
edge- or center-aligned PWM on each
channel
Independent real-time clock (IRTC):
Independent power domain, 32 bytes
RAM, 32.768 kHz input clock optional
output to ICS, hardware calendar,
hardware compensation due to crystal
or temperature characteristics, tamper
detection and indicator
• Based on MC9S08GW64
• Supports IEC 62053-21, 62053-22 and IEC
620533-23
• Shunt sensor for single phase, CT for
detecting neutral missing tamper
MC9S08GW64 Single-Phase Electricity Meter Reference Design Block Diagram
16/32-bit programmable cyclic
12-ch./SPI
EEPROM
redundancy check (PCRC): For highLCD
speed CRC calculation
MTIM: Two 8-bit and one 16-bit timers,
Line
configurable clock inputs and interrupt
LCD Driver
generation on overflow
Programmable delay block: Optimized for
Transducer
scheduling ADC conversions
Signal
Conditioning
Position counter: Working in stop3 mode
without waking CPU, can be used to
generate timer waveforms
• Input/output
57 GPIOs including one output-only pin
Communications
Interfaces
ADC
RF
RTC
PLM
MC9S08GW64
Neutral
Power
Supply
RS-485
Driver
Opto-Coupler
IEC1107
Eight KBI interrupts with selectable
polarity
Freescale Technology
Optional
Learn More:
Freescale and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc.,
Reg. U.S. Pat. & Tm. Off. SMARTMOS is a trademark of Freescale Semiconductor, Inc. All other product or service
names are the property of their respective owners. © 2010, Freescale Semiconductor, Inc.
Document Number: SNGLPHSMTRRFFS / REV 0
For more information, visit
freescale.com.