SW500008

SW500008 Datasheet


Part Datasheet
SW500008 SW500008 SW500008 (pdf)
Related Parts Information
SW500007 SW500007 SW500007
PDF Datasheet Preview
HI-TECH PICC-18 STD Compiler

HI-TECH Software.

Copyright C 2008 HI-TECH Software. All Rights Reserved. Printed in Australia. PICC-18 is licensed exclusively to HI-TECH Software
by Microchip Technology Inc. Produced on February 21, 2008

HI-TECH Software Pty. Ltd. ACN 002 724 549
45 Colebard Street West Acacia Ridge QLD 4110

Australia
email web:

Contents

Table of Contents

List of Tables
xiii
1 Introduction

Typographic conventions 1
2 PICC-18 Command-line Driver

Long Command Lines 4

Default Libraries 4

Standard Runtime Code 4

PICC18 Compiler Options 5
-Bmodel Select Memory Model 7
-C Compile to Object File 7
-Dmacro Macro 8
-Efile Redirect Compiler Errors to a File 8
-Gfile Generate Source-level Symbol File 9
-Ipath Include Search Path 10
-Llibrary Scan Library 10
-L-option Adjust Linker Options Directly 10
-Mfile Generate Map File 11
-Nsize Length 11
-Ofile Specify Output File 11
-P Preprocess Assembly Files 11
-Q Quiet Mode 12
-S Compile to Assembler Code 12
-Umacro a Macro 12
-V Verbose Compile 12

CONTENTS

CONTENTS
-X Strip Local Symbols 12 --ASMLIST Generate Assembler .LST Files 13 --CALLGRAPH=type Control level of information displayed in call graph 13 --CHAR=type Make Char Type Signed or Unsigned 13 Calculate, store and ver-
ify a checksum 13 --CHIP=processor 14 --CHIPINFO Display List of Supported Processors 14 --CODEOFFSET Offset Program Code to Address 14 --CP=size Set the Size of Pointers to Code Space 14 --CR=file Generate Cross Reference Listing 15 --DEBUGGER=type Select Debugger Type 15 --DOUBLE=type Select kind of Double Types 15 --EMI=type Select operating mode of the external memory interface EMI 16 --ERRATA=type Specify to add or remove errata workarounds 16 --ERRFORMAT=format for Compiler Messages 18

Using the Format Options 18 Modifying the Standard Format 18 --ERRORS=number Maximum Number of Errors 19 --FILL=opcode Fill Unused Program Memory 19 --GETOPTION=app,file Get Command-line Options 20 --HELP<=option> Display Help 20 --IDE=type Specify the IDE being used 20 --LANG=language Specify the Language for Messages 20 --MEMMAP=file Display Memory Map 21 --MSGFORMAT=format Set Advisory Message Format 21 --NOEXEC Don’t Execute Compiler 21 --OPT<=type> Invoke Compiler Optimizations 21 --OUTPUT=type Specify Output File Type 21 --PRE Produce Preprocessed Source Code 23 --PROTO Generate Prototypes 23 --RAM=lo-hi,<lo-hi,...> Specify Additional RAM Ranges 24 --ROM=lo-hi,<lo-hi,...>|tag Specify Additional ROM Ranges 25 --RUNTIME=type Specify Runtime Environment 25 --SCANDEP Scan for Dependencies 25 Store a Value at this Program Memory Address 27 --SETOPTION=app,file Set The Command-line Options for Application 27 --STRICT ANSI Conformance 27

CONTENTS
General Information 126 Call Graph Information 127 Psect Information listed by Module 133 Psect Information listed by Class 135 Segment Listing 135 Unused Address Ranges 135 Symbol Table 136 Librarian 137 The Library Format 137 Using the Librarian 137 Examples 138 Supplying Arguments 139 Listing Format 139 Ordering of Libraries 140 Error Messages 140 Objtohex 140 Checksum 140 Cref 142 -Hheading 142 -Llen 143 -Pwidth 143 -Sstoplist 143 Cromwell 144

CONTENTS

CONTENTS
-Pname[,architecture] 144 -N 145 -D 145 -C 145 -F 146 -Okey 146 -Ikey 146 -L 146 -E 146 -B 147 -M 147 -V 147 Hexmate 147 Hexmate Command Line Options 148
148 + 150 -ADDRESSING 150 -BREAK 150 -CK 151 -FILL 151 -FIND 152 -FIND...,DELETE 153 -FIND...,REPLACE 153 -FORMAT 154 -HELP 155 -LOGFILE 155 -SERIAL 155 -SIZE 156 -STRING 156 -STRPACK 157

A Library Functions

B Error and Warning Messages

C Chip Information

D Attributes

CONTENTS Index

CONTENTS 451

List of Tables

PICC18 types 3 Additional --checksum 14 Supported Double Types 15 Error format 19 Supported IDEs 20 Supported languages 21 Optimization Options 22 Output formats 22 Runtime environment suboptions 26 Memory Summary Suboptions 28

Peripheral memory tags 33 Printf functionality 36 Peripheral Library Bitmask 37 Program Memory Errata Bitmask 38 Basic data types 41 Radix formats 42 Floating-point formats 46 Floating-point format example IEEE 754 46 Integral division 62 Preprocessor directives 74 Pragma directives 77 Valid Register Names 80 switch types 80 Supported standard I/O functions 83

ASPIC18 command-line options 86
xiii

LIST OF TABLES

LIST OF TABLES

ASPIC18 statement formats 89 ASPIC18 numbers and bases 90 ASPIC18 operators 94 ASPIC18 assembler directives 96 PSECT 97 DSPIC assembler controls 108 LIST control options 109

Linker command-line options 113 Linker command-line options 114 Librarian command-line options 138 Librarian key letter commands 138 OBJTOHEX command-line options 141 CREF command-line options 143 CROMWELL format types 144 CROMWELL command-line options 145 -P option architecture arguments for COFF output. 146 Hexmate command-line options 149 Hexmate Checksum Algorithm Selection 152 INHX types used in -FORMAT option 155

A.1 Maximum delay versus system frequency 163

C.1 Devices supported by HI-TECH PICC-18 STD 403 C.1 Devices supported by HI-TECH PICC-18 STD 404 C.1 Devices supported by HI-TECH PICC-18 STD 405 C.1 Devices supported by HI-TECH PICC-18 STD 406 C.1 Devices supported by HI-TECH PICC-18 STD 407

Introduction

Typographic conventions

Different fonts and styles are used throughout this manual to indicate special words or text. Computer prompts, responses and will be printed in constant-spaced type. When the is the name of a standard header the name will be enclosed in angle brackets, e.g. <stdio.h>. These header can be found in the INCLUDE directory of your distribution.

Samples of code, C keywords or types, assembler instructions and labels will also be printed in a constant-space type. Assembler code is printed in a font similar to that used by C code.

Particularly useful points and new terms will be emphasized using italicized type. When part of a term requires substitution, that part should be printed in the appropriate font, but in italics. For example #include <filename.h>.

Typographic conventions

Introduction

PICC-18 Command-line Driver

PICC18 is the driver invoked from the command line to compile and/or link C programs. PICC18 has the following basic command format:

PICC18 [options] files [libraries]

It is conventional to supply the options by a leading dash “-” or double dash before the

The options are discussed below. The may be a mixture of source C or assembler and object The order of the is not important, except that it will affect the order in which code or data appears in memory. Libraries are a list of library names, or -L options, see Section Source object and library are distinguished by PICC18 solely by the type or extension. Recognized types are listed in Table This means, for example, that an assembler must always have a .as extension alphabetic case is not important .

PICC18 will check each argument and perform appropriate actions. C will be compiled assembler will be assembled. At the end, unless suppressed by one of the options discussed later,

Table PICC18 types

File Type

Meaning

C source

Assembler source
.obj
Effect Specify a class name for a global psect Produce binary output based at baseaddr Specify a class delta value Produce old-style symbol Write error messages to errfile Produce .obj with only symbol records Specify calculation for segment selectors Generate symbol Generate enhanced symbol Ignore symbols Set maximum number of errors before aborting Prevent overlaying function parameter and auto areas Preserve relocation items in .obj Preserve segment relocation items in .obj Sort symbol table in map by address order Sort symbol table in map by class address order Sort symbol table in map by space address order Generate a link map in the named Specify name of output Specify psect addresses and ordering Specify the processor type for cosmetic reasons only Inhibit listing of symbols in symbol Specify address limit, and start boundary for a class of psects Pre-enter symbol in table as Use avmap to generate an Avocet format symbol Set warning level -9 to 9 Set map width >=10 Remove any local symbols from the symbol Remove trivial local symbols from the symbol

Numbers in linker options

Several linker options require memory addresses or sizes to be The syntax for all these is similar. By default, the number will be interpreted as a decimal value. To force interpretation as a hex number, a trailing H should be added, e.g. 765FH will be treated as a hex number.

Linker and Utilities

Operation
-Aclass=low-high,...

Normally psects are linked according to the information given to a -P option see below but sometimes it is desired to have a class of psects linked into more than one non-contiguous address range. This option allows a number of address ranges to be for a class. For example:
-ACODE=1020h-7FFEh,8000h-BFFEh
that the class CODE is to be linked into the given address ranges. Note that a contribution to a psect from one module cannot be split, but the linker will attempt to pack each block from each module into the address ranges, starting with the

Where there are a number of identical, contiguous address ranges, they may be with a repeat count, e.g.
-ACODE=0-FFFFhx16
that there are 16 contiguous ranges each 64k bytes in size, starting from zero. Even though the ranges are contiguous, no code will straddle a 64k boundary. The repeat count is as the character x or * after a range, followed by a count.

These options allow control over the call graph information which may be included in the map produced by the linker. There are four varients of this option:

Fully expanded callgraph The -Cf option displays the full callgraph information.

Short form callgraph The -Cs option is the default callgraph option which removes some redundant information from the callgraph display. In the case where there are parameters to a function that involve function calls, the callgraph information associated with the “ARG function” is only shown the time it is encountered in the callgraph. See Sections and for more information on these functions.

Critical path callgraph The -Cc option only include the critical paths of the call graph. A function call that is marked with a * in a full call graph is on a critical path and only these calls are included when the -Cc option is used. See Section for more information on critcal paths.

No callgraph The -Cn option removes the call graph information from the map

Operation

Linker and Utilities
-Cpsect=class

This option will allow a psect to be associated with a class. Normally this is not required on the command line since classes are in object
-Dclass=delta

This option allows the delta value for psects that are members of the class to be The delta value should be a number and represents the number of bytes per addressable unit of objects within the psects. Most psects do not need this option as they are with a delta value.

Use this option to produce an old-style symbol An old-style symbol is an ASCII where each line has the link address of the symbol followed by the symbol name.

Error messages from the linker are written to standard error handle Under DOS there is no convenient way to redirect this to a the compiler drivers will redirect standard error if standard output is redirected . This option will make the linker write all error messages to the instead of the screen, which is the default standard error destination.

Normally the linker will produce an object that contains both program code and data bytes, and symbol information. Sometimes it is desired to produce a symbol-only object that can be used again in a subsequent linker run to supply symbol values. The -F option will suppress data and code bytes from the output leaving only the symbol records.

This option can be used when producing more than one hex for situations where the program is contained in different memory devices located at different addresses. The for one device are compiled using this linker option to produce a symbol-only object this is then linked with the for the other device. The process can then be repeated for the other and device.
-Gspec

When linking programs using segmented, or bank-switched psects, there are two ways the linker can assign segment addresses, or selectors, to each segment. A segment is as a contiguous group of psects where each psect in sequence has both its link and load address concatenated with

Linker and Utilities

Operation
the previous psect in the group. The segment address or selector for the segment is the value derived when a segment type relocation is processed by the linker.

By default the segment selector will be generated by dividing the base load address of the segment by the relocation quantum of the segment, which is based on the reloc= value given to psects at the assembler level. This is appropriate for 8086 real mode code, but not for protected mode or some bank-switched arrangements. In this instance the -G option is used to specify a method for calculating the segment selector. The argument to -G is a string similar to:

A/10h-4h
where A represents the load address of the segment and / represents division. This means "Take the load address of the psect, divide by 10 hex, then subtract This form can be by substituting N for A, * for / to represent multiplication , and adding rather than subtracting a constant. The token N is replaced by the ordinal number of the segment, which is allocated by the linker. For example:

N*8+4
means "take the segment number, multiply by 8 then add The result is the segment selector. This particular example would allocate segment selectors in the sequence 4, 12, 20, for the number of segments This would be appropriate when compiling for 80286 protected mode, where these selectors would represent LDT entries.

This option will instruct the linker to generate a symbol The optional argument symfile a to receive the symbol The default name is l.sym.

This option will instruct the linker to generate an enhanced symbol which provides, in addition to the standard symbol class names associated with each symbol and a segments section which lists each class name and the range of memory it occupies. This format is recommended if the code is to be run in conjunction with a debugger. The optional argument symfile a to receive the symbol The default name is l.sym.
-Jerrcount

The linker will stop processing object after a certain number of errors other than warnings . The default number is 10, but the -J option allows this to be altered.
This option will enter the symbol into the linker’s symbol table as an symbol. This is useful for linking entirely from libraries, or for linking a module from a library where the ordering has been arranged so that by default a later module will be linked.
-Vavmap

To produce an Avocet format symbol the linker needs to be given a map to allow it to map psect names to Avocet memory The avmap will normally be supplied with the compiler, or created automatically by the compiler driver as required.
-Wnum

The -W option can be used to set the warning level, in the range -9 to 9, or the width of the map for values of num >=
-W9 will suppress all warning messages. -W0 is the default. Setting the warning level to -9 -W-9 will give the most comprehensive warning messages.

Local symbols can be suppressed from a symbol with this option. Global symbols will always appear in the symbol

Some local symbols are compiler generated and not of interest in debugging. This option will suppress from the symbol all local symbols that have the form of a single alphabetic character, followed by a digit string. The set of letters that can start a trivial symbol is currently "klfLSu". The -Z option will strip any local symbols starting with one of these letters, and followed by a digit string.

Invoking the Linker

Linker and Utilities

Invoking the Linker

The linker is called HLINK, and normally resides in the BIN subdirectory of the compiler installation directory. It may be invoked with no arguments, in which case it will prompt for input from standard input. If the standard input is a no prompts will be printed. This manner of invocation is generally useful if the number of arguments to HLINK is large. Even if the list of is too long to on one line, continuation lines may be included by leaving a backslash at the end of the preceding line. In this fashion, HLINK commands of almost unlimited length may be issued. For example a link command called x.lnk and containing the following text:
-Z -OX.OBJ -MX.MAP -Ptext=0,data=0/,bss,nvram=bss/. X.OBJ Y.OBJ Z.OBJ
may be passed to the linker by one of the following:
hlink < x.lnk

Compiled Stack Operation

A compiler can either take advantage of the hardware stack contained on a device, or produce code which uses a compiled stack for parameter passing between functions and auto variables. Temporary variables used by a function may also be allocated space in the auto area. Temporary variables with names like btemp, wtemp or ltemp are not examples of such variables. These variables are treated more like registers, although they may be allocated memory. A compiled stack consists of memory areas that are usable by each function’s auto and parameter variables. When a compiled stack is used, functions are not re-entrant since local variables in each function will use the same area of memory every time the function is invoked.

Fundamental to the compiled stack is the call graph which a tree-like hierarchy indicating the structure of function calls. The call graph consists of one or more call trees which are by the program. Each tree has a root function, which is typically not called by the program, but which is executed via other means. The function main is an example of a root function. Interrupt functions are another. The term main-line code means any code that is executed, or may be executed, by a function that appears under the main root in the call graph. See Section for detailed information on the call graph which is displayed in the map

Each function in the call graph is allocated an auto/parameter block APB for its parameter, auto and temporary variables. Temporary variables act just like auto variables. Local variables which are static are not part of this block. For situations where a compiled stack is used,

Linker and Utilities

Compiled Stack Operation
the linker performs additional operations to minimise the memory consumed by the program by overlaying each function’s APB where possible.

In assembly code variables within a function’s APB are referenced via special symbols, which marks the start of the auto or parameter area in the block, and an offset. The symbol used to represent the base address of the parameter area within the function’s APB is the concatenation of ? and the assembler name of the function. The symbol used to represent the base address of the auto area within the function’s APB is the concatenation of ?a, in the case of Standard version compilers, or ??, in the case of PRO version compilers, and the assembler name of the function.

For example, a function called foo, for example, will use the assembly symbol ?_foo as the base address for all its parameters variables that have been allocated memory, and either ?a_foo Standard or ??_foo PRO as the base address for auto variables which the function So the two-byte auto variable might be referenced in PRO version compiler assembly code as ??_foo the second auto variable as ??_foo+2, etc. Note that some parameters may be passed in registers, and may not have memory allocated to them in the parameter area of the APB.

The linker allocates memory for each function’s APB, based on how that function is used in a program. In particular, the linker determines which functions are, or may be, active at the same time. If one function calls another, then both are active at the same time. To this end, a call graph is created from information in the object being linker. See Section for information on reading the call graph displayed in the map This information is directly related to the FNCALL assembler directive see Section for more information which the code generator places in the assembler output whenever a C function calls another. Hand-written assembler code should also contain these directives, if required. Information regarding the size of the auto and parameter areas within in function’s APB is by the FNSIZE assembler directive see Section

Parameters involving Function Calls

The linker must take special note of the results of function calls used in expressions that are themselves parameters to another function. For example, if input and output are both functions that accept two int parameters and both return an int, the following:
result = output out_selector, input int_selector, 10 ;
shows that the function input is called to determine the second parameter to the function output. This information is very important as it indicates areas of the code that must be considered carefully, lest the code fail due to re-entrancy related issues.

A re-entrant call is typically considered to be the situation in which a function is called and executed while another instance of the same function is also actively executing. For a compiled stack program, a function must be considered active as soon as its parameter area has been in preparation for a call, even though code in that function is not yet being executed and a call to that function has not been made. This is particularly import with functions that accept more than

Compiled Stack Operation

Linker and Utilities
one parameter as the ANSI standard does not dictate the order in which function parameters must be evaluated.

Such a condition is best illustrated by an example, which is shown in the following tutorial.

TUT•RIAL

PARAMETERS IMPLEMENTED AS FUNCTION CALLS Consider the following code.
int B int x, int y return x - y;
int A int a, int b
return a+B 9, b void main void

B 5, A 6, 7 // consider this statement

For the highlighted statement, the compiler might evaluate and load the parameter to the function B, which is the literal, To do this, the value of 5 is loaded to the locations ?_B and ?_B+1. Now to evaluate the second parameter value to the function B, the compiler must call the function A. So A’s parameters are loaded and the call to function A is made. Code inside the function A, calls the function B. This involves loading the parameters to B the contents of the variable b are loaded to ?_B+2 and ?_B+3, and the value 9 is loaded to ?_B and ?_B+1, which corrupts the contents of these locations which were loaded earlier for the still pending call to function B. Function A eventually returns normally and the return value is the loaded to the second parameter locations for the still pending call to function B, back at the highlighted line of source. However, the value of 5 previously loaded as the parameter to B has been lost. When the call to function B is now made, the parameters will not be correct. Note that the function B is not actively executing code in more than one instance of the function at the same time, however the code that loads the parameters to function B is.
Ordering of Libraries

The librarian creates libraries with the modules in the order in which they were given on the command line. When updating a library the order of the modules is preserved. Any new modules added to a library after it has been created will be appended to the end.
The ordering of the modules in a library is to the linker. If a library contains a module which references a symbol in another module in the same library, the module the symbol should come after the module referencing the symbol.

Error Messages

LIBR issues various error messages, most of which represent a fatal error, while some represent a harmless occurrence which will nonetheless be reported unless the -W option was used. In this case all warning messages will be suppressed.

Objtohex

The HI-TECH linker is capable of producing simple binary or object as output. Any other format required must be produced by running the utility program OBJTOHEX. This allows conversion of object as produced by the linker into a variety of different formats, including various hex formats. The program is invoked thus:

OBJTOHEX options inputfile outputfile

All of the arguments are optional. If outputfile is omitted it defaults to l.hex or l.bin depending on whether the -b option is used. The inputfile defaults to l.obj.

The options for OBJTOHEX are listed in Table Where an address is required, the format is the same as for HLINK.

Checksum

If you are generating a HEX output, please refer to the hexmate section for calculating checksums. For OBJTOHEX, the checksum allows automated checksum calculation and takes the form of several lines, each line describing one checksum. The syntax of a checksum line is:
addr1-addr2 where1-where2 +offset

All of addr1, addr2, where1, where2 and offset are hex numbers, without the usual H Such a says that the bytes at addr1 through to addr2 inclusive should be summed

Linker and Utilities

Objtohex

Option -8 -A -Bbase
-Cckfile
-D -E -Ffill
-M -N -Pstk -R -Sfile -T -TE -U -UB -V -n,m

Table OBJTOHEX command-line options Meaning

Cref

Linker and Utilities
and the sum placed in the locations where1 through where2 inclusive. For an 8 bit checksum these two addresses should be the same. For a checksum stored low byte where1 should be less than where2, and vice versa. The +offset is optional, but if supplied, the value offset will be used to initialise the checksum. Otherwise it is initialised to zero. For example:
0005-1FFF 3-4 +1FFF

This will sum the bytes in 5 through 1FFFH inclusive, then add 1FFFH to the sum. The 16 bit checksum will be placed in locations 3 and 4, low byte in The checksum is initialised with 1FFFH to provide protection against an all zero ROM, or a ROM misplaced in memory. A run time check of this checksum would add the last address of the ROM being checksummed into the checksum. For the ROM in question, this should be 1FFFH. The initialization value may, however, be used in any desired fashion.

Cref

The cross reference list utility CREF is used to format raw cross-reference information produced by the compiler or the assembler into a sorted listing. A raw cross-reference is produced with the --CR option to the compiler. The assembler will generate a raw cross-reference with a -C option most assemblers or by using an OPT CRE directive 6800 series assemblers or a XREF control line PIC assembler . The general form of the CREF command is:
cref options files
where options is zero or more options as described below and files is one or more raw crossreference CREF takes the options listed in Table

Each option is described in more detail in the following paragraphs.

It is often desired to exclude from the cross-reference listing any symbols in a system header e.g. <stdio.h>. The -F option allows of a path name that will be used to exclude any symbols in a whose path name begins with that For example, will exclude any symbols from all with a path name starting with
-Hheading

The -H option takes a string as an argument which will be used as a header in the listing. The default heading is the name of the raw cross-ref information

Linker and Utilities

Cref

Table CREF command-line options

Option

Meaning
-Fprefix Exclude symbols from with a pathname or
starting with prefix
-Hheading Specify a heading for the listing
-Llen
Specify big-endian byte ordering

Strip underscore character

Verbose mode
argument to this option which also the processor architecture is required. Hence for this format the usage of this option must take the form -Pname,architecture. Table enumerates the architectures supported for producing COFF

To produce some output formats e.g. COFF , Cromwell requires that the names of the program memory space psect classes be provided. The names of the classes are given as a comma separated list. For example, in the DSPIC C compiler these classes are typically “CODE” and “NEARCODE”, i.e. -NCODE,NEARCODE.

The -D option is used to display to the screen details about the named input in a readable format. The input can be one of the types as shown in Table

This option will attempt to identify if the input are one of the formats as shown in Table If the is recognised, a of its type will be displayed.

Cromwell

Linker and Utilities

Table -P option architecture arguments for COFF output.

Architecture

Motorola 68000 series chips

H8/300

Hitachi 8 bit H8/300 chips

H8/300H

Hitachi 16 bit H8/300H chips

Hitachi 32 bit SuperH RISC chips

PIC12

Microchip base-line PIC chips

PIC14

Microchip mid-range PIC chips

PIC16

Microchip high-end 17Cxxx PIC chips

PIC18

Microchip PIC18 chips

PIC24

Microchip PIC24F and PIC24H chips

PIC30

Microchip dsPIC30 and dsPIC33 chips

When generating a COD this option can be used to force all local symbols to be represented as global symbols. The may be useful where an emulator cannot read local symbol information from the COD
-Okey

This option the format of the output The key can be any of the types listed in Table
-Ikey

This option can be used to specify the default input format. The key can be any of the types listed in Table

Use this option to show what format types are supported. A list similar to that given in Table will be shown.

Use this option to tell CROMWELL to ignore any extensions that were given. The default extension will be used instead.

Linker and Utilities

Hexmate
In formats that support different endian types, use this option to specify big-endian byte ordering.

When generating COD this option will remove the preceding underscore character from symbols.

Turns on verbose mode which will display information about operations CROMWELL is performing.

Hexmate

The Hexmate utility is a program designed to manipulate Intel HEX Hexmate is a post-link stage utility that provides the facility to:
• Calculate and store variable-length checksum values
• Fill unused memory locations with known data sequences
• Merge multiple Intel hex into one output
• Convert INHX32 to other INHX formats e.g. INHX8M
• Detect or partial opcode sequences within a hex
• Find/replace or partial opcode sequences
• Provide a map of addresses used in a hex
• Change or the length of data records in a hex
• Validate checksums within Intel hex Typical applications for hexmate might include
• Merging a bootloader or debug module into a main application at build time
• Calculating a checksum over a range of program memory and storing its value in program
memory or EEPROM

Hexmate

Linker and Utilities
• Filling unused memory locations with an instruction to send the PC to a known location if it gets lost.
• Storage of a serial number at a address.
• Storage of a string e.g. time stamp at a address.
• Store initial values at a particular memory address e.g. initialise EEPROM
• Detecting usage of a buggy/restricted instruction
• Adjusting hex to meet requirements of particular bootloaders

Hexmate Command Line Options

Some of these hexmate operations may be possible from the compiler’s command line driver. However, if hexmate is to be run directly, its usage is:
hexmate <file1.hex fileN.hex> <options>

Where through to are a list of input Intel hex to merge using hexmate. Additional options can be provided to further customize this process. Table lists the command line options that hexmate accepts.

The input parameters to hexmate are now discussed in greater detail. Note that any integral values supplied to the hexmate options should be entered as hexadecimal values without leading 0x or trailing h characters. Note also that any address in these options are to be entered as byte addresses, unless otherwise in the -ADDRESSING option.

Intel hex that can be processed by hexmate should be in either INHX32 or INHX8M format. Additional can be applied to each hex to put restrictions or conditions on how this should be processed. If any are used they must precede the list of will then be separated from the by a comma.

A range restriction can be applied with the rStart-End. A range restriction will cause only the address data falling within this range to be used. For example:
r100-1FF,myfile.hex
will use as input, but only process data which is addressed within the range 100h-1FFh inclusive to be read from

An address shift can be applied with the sOffset If an address shift is used, data read from this hex will be shifted by the Offset to a new address when generating the output. The offset can be either positive or negative. For example:

Linker and Utilities

Hexmate

Table Hexmate command-line options

Option

Effect
-ADDRESSING

Set address in all hexmate options to use word addressing
or other
-BREAK

Break continuous data so that a new record begins at a set
address

Calculate and store a checksum value
-FILL

Program unused locations with a known value
-FIND

Search and notify if a particular code sequence is detected
More datasheets: MT45W4MW16PBA-70 WT TR | MT45W4MW16PFA-70 IT TR | ISL9K8120P3 | APT60D30LCTG | LM78M08CT | LM78M18CT | LM78M24CT | LM78M15CT | LM78M12CT | LM78M06CT


Notice: we do not provide any warranties that information, datasheets, application notes, circuit diagrams, or software stored on this website are up-to-date or error free. The archived SW500008 Datasheet file may be downloaded here without warranties.

Datasheet ID: SW500008 636069