beautypg.com

10 auxiliary files, 11 include/header files, 1 options.h – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 66: Auxiliary files, Include/header files, Options.h

background image

71M653X Software User’s Guide

5.10 AUXILIARY FILES

A variety of startup files is provided with the Demo Kits. The function of these files is as follows:

1. STARTUP_30.A51:

This file provides memory and stack initialization. It is derived from the Keil compiler package.

2. STARTUP_30_BANKED.A51:

This file provides memory and stack initialization for a 6530 using code banks. It is derived from the Keil
compiler package.

3.

STARTUP_SECURE_30.A51:

This file is almost identical to STARTUP.A51. The only difference is that this variation sets the SECURE bit.
This bit enables security provisions that prevent external reading of flash memory and CE program memory.
The code segment below sets the security bit located at SFR register address 0xB2:

STARTUP1:

CLR 0xA8^7

; Disable interrupts

MOV 0B2h,#40h ; Set security bit.
MOV 0E8h,#0FFh ; Refresh nonmaskable watchdog

4. L51_BANK.A51:

This file provides bank-switching logic for a 6530 using code banks. It is derived from the Keil compiler
package.

5. INIT.A51:

A secondary startup file. It is part of the Keil compiler package. This code is executed, if the application
program contains initialized variables at file level.

6. STARTUP_BOOT.A51:

This startup file is to be used when the code is to be compiled as a bootloader.

5.11 INCLUDE/HEADER FILES

In line with common industry practice, each C file in the Demo Code source code has a corresponding header file that
ends in .H and that provides the interface to the C file’s code. A number of include files are special cases, and provide
global data or hardware definitions.

Main_653x\options.h selects the features used by the code

main\option_gbl.h defines global configuration values used in all meter versions.

meter\meter.h defines the meter’s configuration and power registers.

meter\ce653X.h defines the CE memory used to communicate with the MPU.

meter\io653X.h defines the memory-mapped registers of the 653X chips.

util\reg653X.h defines the special function registers of the 653X chips.

Util\reg80515.h defines the registers common to TSC meter chip 8051s

util\stdint.h defines standard integers for TSC meter chips using 8051s.

5.11.1

OPTIONS.H

TSC normally can provide two versions of the demo code. One version has optional code removed using the utility
SUNIFDEF.EXE. This code is small and easier to read, but inflexible. In this code, options.h documents the features
that are present and absent in the code.

TSC’s software engineers develop meter code from a single code set with optional configurations, the “all options”
version. It is more complex, and has files for most TSC meter ICs, all meter equations and other optional features that
TSC has developed. It is usually provided “as is” with minimal or no testing.

The two code sets are validated during release by assuring that both code sets produce the same binary when
compiled with the same compiler.

v1.1v1.1

TERIDIAN Proprietary

66 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

This manual is related to the following products: