4 utilities, 1 d_merge, 2 ce_merge – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual
Page 15: Utilities, D_merge, Ce_merge
71M653X Software User’s Guide
The Demo Code is modular. Each device in the chip and on the Demo Board has a corresponding set of driver
software in the Hardware Layer. These driver software modules are very basic, enabling customers to easily locate and
reuse the logic. For the serial devices and for the CE, the buffer handling has been separated from the driver modules.
Where there are several similar devices (e.g. ser0, ser1, or tmr0, tmr1), the Demo Code simulates a virtual object base
class using C preprocessor macros. For example, to initialize the first serial interface, ser0, the source file can include
ser0.h, and then call ser_initialize(). To transmit a byte on ser0, the file can include ser0.h, and then call
ser_xmit().
The convenience is that high-level code can be ported to another device by just (for example) including
ser1.h, rather than ser0.h. Just by making variables static, entire high-level protocols can be written and maintained by
copying the code debugged on one device, and having it include the other device’s .h file.
The demo firmware uses this technique for the command line interface (ser0cli.c, ser1cli.c), the FLAG AMR interface
(flag0.c, flag1.c) and for the software timer module (stm.c). The base-class emulation uses macros because on the
80515 MPU macros execute faster and are also more compact than the standard C++ (object-oriented) design with an
implicit structure containing function pointers.
The Demo Code is also designed with an “options.h” file, which enables and disables entire features in the firmware.
The macro approach combined with the “options.h” file permitted the firmware team to adapt the same Demo Code to
both the 6531 and 6534 versions.
2.4 UTILITIES
Three utilities are offered that make it possible to perform certain operations on the object (HEX) files without having to
use a compiler:
•
D_MERGE.EXE allows combining the object file with a text script in order to change certain default settings of
the program. For example, modified calibration coefficients resulting from an actual calibration can be inserted
into the object file.
•
CE_MERGE.EXE allows combining the object file with an updated image of the CE code.
•
BANK_MERGE.EXE combines the hex files the Keil tools provide for each code bank.
All utilities are executed from a DOS window (DOS command prompt). To invoke the DOS window, the “command
prompt” option is selected after selecting Start – All Programs – Accessories.
The GUI subdirectory contains an unsupported MS Windows .NET implementation of a FLAG hand-held unit.
2.4.1 D_MERGE
Many changes to the firmware’s defaults can be made permanent by merging them into the object file. The first step for
this is to create a macro file (macro.txt) containing the commands adjusting the I/O RAM or other defaults, such as the
following commands affecting calibration:
]8=+16381
]9=+16397
]E=+237
The d_merge program updates the 653x_demo.hex file with the values contained in the macro file. The d_merge
program must be in the same directory as the source files, or a path to the executable must be declared. Executing the
d_merge program with no arguments will display the syntax description. To merge the file macro.txt and the object file
old_653x_demo.hex into the new object file new_653x_demo.hex, use the command:
d_merge old_653x_demo.hex macro.txt new_653x_demo.hex
2.4.2 CE_MERGE
The ce_merge program updates the
653x_demo.hex file with the CE program image contained in the CE.CE file
and the data image CE.DAT. Both CE.CE and CE.DAT must be i
n Intel HEX format, i.e. both files are not in the
source format but in the compiled format (intel hex). These files will be made available from Teridian in the
cases when updates to the CE images are necessary.
To merge the object file old_653x_demo.hex with CE.CE and CE.DAT into the new object file new_653x_demo.hex,
use the command:
v1.1v1.1
TERIDIAN Proprietary
15 of 116
© Copyright 2005-2008 TERIDIAN Semiconductor Corporation