beautypg.com

Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 5

background image

71M653X Software User’s Guide

4.9.4

 

Setup of the Compiler Project ................................................................................................ 36

 

4.9.5

 

Startup ................................................................................................................................... 37

 

4.9.6

 

Bank-Switching Code ............................................................................................................. 37

 

4.9.7

 

Page Table Setup and Debug ................................................................................................ 37

 

4.9.8

 

Producing a Banked Hex File ................................................................................................. 39

 

4.9.9

 

Placing Interrupts in Banked Code ......................................................................................... 39

 

4.9.10

 

Calling Banked Functions via Function Pointers .................................................................... 39

 

4.9.11

 

Putting Constants in Banks .................................................................................................... 40

 

4.9.12

 

Write-Protecting Flash in the 653X ......................................................................................... 40

 

4.10

 

Project Management Tools .................................................................................................... 41

 

4.11

 

Alternative Compilers ............................................................................................................. 41

 

4.12

 

Alternative Editors .................................................................................................................. 41

 

4.13

 

Alternative Linkers ................................................................................................................. 42

 

5

 

Demo Code Description .............................................................................................................. 43

 

5.1

 

80515 Data Types and Compiler-Specific Information ....................................................... 43

 

5.1.1

 

Data Types ............................................................................................................................. 43

 

5.1.2

 

Compiler-Specific Information ................................................................................................ 46

 

5.2

 

Demo Code Options and Program Size................................................................................ 47

 

5.3

 

Program Flow .......................................................................................................................... 51

 

5.3.1

 

Startup and Initialization ......................................................................................................... 52

 

5.4

 

Basic Code Architecture ........................................................................................................ 52

 

5.4.1

 

Initialization ............................................................................................................................ 53

 

5.4.2

 

Interrupts ................................................................................................................................ 53

 

5.4.2.1

 

Pulse Counting Interrupts ................................................................................................ 54

 

5.4.2.2

 

FWCOL0 and FWCOL1 ................................................................................................... 55

 

5.4.2.3

 

CE_BUSY Interrupt .......................................................................................................... 55

 

5.4.2.4

 

PLL_ISR ........................................................................................................................... 55

 

5.4.2.5

 

EEPROM Isr ..................................................................................................................... 56

 

5.4.2.6

 

Timer Interrupt .................................................................................................................. 56

 

5.4.2.7

 

The XFER_BUSY, RTC and NEAR_OVERFLOW Interrupt ............................................ 56

 

5.4.2.8

 

SERIAL Interrupt .............................................................................................................. 57

 

5.4.3

 

Background Tasks ................................................................................................................. 57

 

5.4.3.1

 

meter_run() ...................................................................................................................... 57

 

5.4.3.2

 

Command Line Interpreter (CLI) ...................................................................................... 58

 

5.4.3.3

 

Auto-Calibration ............................................................................................................... 58

 

5.4.3.4

 

EEPROM Read/Write ...................................................................................................... 61

 

5.4.3.5

 

Battery Test ...................................................................................................................... 61

 

5.4.3.6

 

Power Factor Measurement............................................................................................. 61

 

5.4.4

 

Watchdog Timer ..................................................................................................................... 62

 

5.4.5

 

Real-Time Clock (RTC) .......................................................................................................... 62

 

5.5

 

Managing Mission and Battery Modes ................................................................................. 62

 

5.6

 

Data Flow ................................................................................................................................. 63

 

5.7

 

CE/MPU Interface .................................................................................................................... 64

 

v1.1v1.1

TERIDIAN Proprietary

5 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

This manual is related to the following products: