Energy Meter IC Family Software Instruction Manual

71M652X Software User’s Guide
Revision 1.7 TERIDIAN Proprietary 39 of 138
© Copyright 2005-2007 TERIDIAN Semiconductor Corporation
Type definitions for internal data, 256 bytes, in the upper 128 bytes addressed indirectly:
typedef unsigned char idata uint8i_t;
typedef unsigned short idata uint16i_t;
typedef unsigned long idata uint32i_t;
typedef signed char idata int8i_t;
typedef signed short idata int16i_t;
typedef signed long idata int32i_t;
This is fairly fast, not battery-backed-up memory, slower than the data in the lower 128 bytes of internal memory.
Competes with data for space.
Type definitions for external data, 256 bytes of 2K of CMOS RAM:
typedef unsigned char pdata uint8p_t;
typedef unsigned short pdata uint16p_t;
typedef unsigned long pdata uint32p_t;
typedef signed char pdata int8p_t;
typedef signed short pdata int16p_t;
typedef signed long pdata int32p_t;
The upper byte of the XDATA address is supplied by the SFR 0xBF (ADRMSB) on the 71M6521 meter ICs. On other
8051 processors, P2 is used for this purpose. This memory range is accessed indirectly, still fairly fast, not battery
backed-up. This is a logical place for nonvolatile globals like power registers and configuration data.
Type definitions for external data, 2Kbytes of CMOS RAM, accessed indirectly via a 16-bit register:
This is the slowest but largest memory are, not battery backed-up. It can be used for everything possible. On Keil's
large model, this is the default.
typedef unsigned char xdata uint8x_t;
typedef unsigned short xdata uint16x_t;
typedef unsigned long xdata uint32x_t;
typedef signed char xdata int8x_t;
typedef signed short xdata int16x_t;
typedef signed long xdata int32x_t;
Type definitions for external read-only data, located in code space:
typedef unsigned char code uint8r_t;
typedef unsigned short code uint16r_t;
typedef unsigned long code uint32r_t;
typedef signed char code int8r_t;
typedef signed short code int16r_t;
typedef signed long code int32r_t;
Access is indirect via a 16-bit register. This is the slowest but largest space, nonvolatile programmable flash memory. It
should be used for constants and tables