beautypg.com

1 basic intel hex format, Basic intel hex format – Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 33

background image

71M653X Software User’s Guide

4.8.1 Basic Intel Hex Format

The Intel HEX file is an ASCII text file with lines of text that follow the Intel HEX file format. Each line in an Intel HEX file
contains one HEX record. These records are made up of hexadecimal numbers that represent machine language code
and/or constant data. Intel HEX files are often used to transfer the program and data that would be stored in a ROM or
EPROM. Most EPROM programmers or emulators can use Intel HEX files.

Record Format

An Intel HEX file is composed of any number of HEX records. Each record is made up of five fields that are arranged in
the following format:

:llaaaatt[dd...]cc

Each group of letters corresponds to a different field, and each letter represents a single hexadecimal digit. Each field
is composed of at least two hexadecimal digits-which make up a byte-as described below:

ƒ

:

is the colon that starts every Intel HEX record.

ƒ

ll

is the record-length field that represents the number of data bytes (dd) in the record.

ƒ

aaaa

is the address field that represents the starting address for subsequent data in the record.

ƒ

tt

is the field that represents the HEX record type, which may be one of the following:

00

- data record

01

- end-of-file record

02

- extended segment address record

04

- extended linear address record

ƒ

dd

is a data field that represents one byte of data. A record may have multiple data bytes. The number of data

bytes in the record must match the number specified by the ll field.

ƒ

cc

is the checksum field that represents the checksum of the record. The checksum is calculated by summing

the values of all hexadecimal digit pairs in the record modulo 256 and taking the two's complement.

Data Records

The Intel HEX file is made up of any number of data records that are terminated with a carriage return and
a linefeed. Data records appear as follows:
:10246200464C5549442050524F46494C4500464C33

This record is decoded as follows:

:10246200464C5549442050524F46494C4500464C33

||||||||||| CC->Checksum

|||||||||DD->Data

|||||||TT->Record Type

|||AAAA->Address

|LL->Record Length

:->Colon

where:

ƒ

10

is the number of data bytes in the record.

ƒ

2462

is the address where the data are to be located in memory.

ƒ

00

is the record type 00 (a data record).

ƒ

464C...464C

is the data.

ƒ

33

is the checksum of the record.

v1.1v1.1

TERIDIAN Proprietary

33 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

This manual is related to the following products: