beautypg.com

10 project management tools, 11 alternative compilers, 12 alternative editors – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 41: Project management tools, Alternative compilers, Alternative editors

background image

71M653X Software User’s Guide

To protect flash starting at address 0x00000, write the number of 1,024-byte blocks into BOOT_SIZE (at XDATA
0x20A7), and set WRPROT_BT (bit 5 of SFR 0xB2). Since this range covers the code’s interrupt vectors, it is perfect for
protecting a boot loader (i.e. code that can load other code into the system). It is also the logical choice for general-
purpose write-protection.

To protect flash near the end of memory, place the CE’s data area at that point (and set CE_LCTN, XDATA 0x20A8),
and set the WRPROT_CE (bit 4 of SFR 0xB2). This protects not only the CE code, but also all flash memory after it.
This is excellent for protecting the CE code and calibration tables stored in flash. The demo code uses this method to
protect the CE code and its default initialization table.

4.10 PROJECT MANAGEMENT TOOLS

With large software projects involving a multitude of source, object, list and other files in various revisions, it is very
helpful to use a version control tool.

To manage file versions under Windows, Tortoise CVS, a free version control utility, might be useful. This utility can be
found at

http://www.tortoisecvs.org/

.

4.11 ALTERNATIVE COMPILERS

The Demo Code was written for the Keil compiler. However, alternative compilers may be used if the code is modified
to ensure compatibility with the alternative compiler. One example of an alternative compiler is SDCC, a free compiler
available from www. Sourceforge.net.

Note: The Keil extensions for the 8051 are not compatible with the 8051 extensions used by the SDCC.

The batch file BUILD653X.BAT is provided with the Demo Kit to support building object files using alternative
compilers. This batch file uses the Keil compiler calls with the applicable compiler options and can therefore serve as
examples on how to invoke alternative compilers. The linker control file LINK653x.TXT called by the batch files can
show how to properly invoke linkers.

To compile with DOS-style tools, arrange for a DOS batch file to invoke the tools and set the properties of the batch file
to leave the window open, so that errors can be seen. Then, to compile, double click on this batch file in Windows
explorer.

4.12 ALTERNATIVE EDITORS

Many modern text editors have a feature called “tag jumping” that helps a programmer to read and understand unfa-
miliar code. TERIDIAN Semiconductor recommends using such an editor to read, understand and modify
demonstration code. Tag jumping is a feature that is not supported by the Keil uVision editor.

This is how tag jumping works:

1. A “tag file generator” program is run on some directories full of .c or .h files. TERIDIAN Semiconductor

recommends placing the tag file generator in a DOS batch file in the same directory as the project’s make file.
Wattmeter demonstration code includes such a batch file: “T.BAT”. To run a batch file, double-click it in
windows explorer. A DOS batch file is just an ASCII file (like a .C file) containing DOS commands. DOS
commands are described at

http://www.computerhope.com/msdos.htm

.

2. The tag file should then be copied to convenient places for a text editor. TERIDIAN Semiconductor

recommends copying the tag file into each source code directory. In that way, the default tag file location for
most editors becomes just “.\tags” for all projects, and multiple projects do not conflict. Copying the tag file
can be an automatic part of the DOS batch file that generates the tag file.

3. It is easiest if Windows explorer opens .C files automatically with the editor when they are clicked. To do this,

change file associations. (See Windows help.)

4. Inside the editor, select a subroutine name or variable, then use the editor’s “tag jump” feature. The editor

immediately opens the file at the line where the subroutine or variable is defined. Or, if the same symbol is in
several places, it offers a choice of files.

TERIDIAN Semiconductor recommends the “exuberant CTAGs utility” for generating tag files. The code can be found
for free at:

http://ctags.sourceforge.net/

. The choice of a text editor is very personal. Many editors support Exuberant

CTAGS. See the list of supporting tools at

http://ctags.sourceforge.net/tools.html

.

v1.1v1.1

TERIDIAN Proprietary

41 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

This manual is related to the following products: