HI-TECH C Compiler for PIC18 MCUs Version 9.80...

22
HI-TECH C Compiler for PIC18 MCUs Version 9.80 Release Notes Copyright (C) 2011 Microchip Technology Inc. All Rights Reserved. Printed in Australia. Produced on: September 27, 2011 Australian Design Centre 45 Colebard Street West Acacia Ridge QLD 4110 Australia web: http://www.microchip.com THIS FILE CONTAINS IMPORTANT INFORMATION RELATING TO THIS COMPILER.PLEASE READ IT BEFORE RUNNING THIS SOFTWARE.

Transcript of HI-TECH C Compiler for PIC18 MCUs Version 9.80...

Page 1: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

HI-TECH C Compiler for PIC18MCUs Version 9.80 Release Notes

Copyright (C) 2011 Microchip Technology Inc.All Rights Reserved. Printed in Australia.

Produced on: September 27, 2011

Australian Design Centre45 Colebard Street WestAcacia Ridge QLD 4110

Australia

web: http://www.microchip.com

THIS FILE CONTAINS IMPORTANT INFORMATION RELATING TOTHIS COMPILER. PLEASE READ IT BEFORE RUNNING THIS

SOFTWARE.

Page 2: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 1

Introduction

1.1 Description

This release is a major update of the HI-TECH C Compiler for PIC18TM

MCUs. It brings the com-piler up-to-date with the latest OCG framework. This will resolve a number of long-standing issuesand feature requests since the first OCG compiler was released. A large number of limitations havebeen lifted as a result of this update.

This compiler can run in Lite or PRO mode, but there is no Standard mode. The HI-TECH CCompiler for PIC18

TMMCUs (Standard) still fills this need.

1.2 Further HelpThe compiler’s user’s guide covers all aspects of the compiler’s operation, as well as other usefulinformation. Check the well populated index for your search term.

Common problems are explained in the FAQ list. You can also ask questions of other users ofthis product in the forums. Please direct any bug reports or feature requests via email to support.

1.3 Updates and FeedbackMicrochip welcomes bug reports, suggestions or comments regarding this compiler version. Pleasedirect any feedback via email to support. Updates to this product will be made available on Mi-crochip’s web site or on Microchip Direct.

2

Page 3: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Introduction Previous Versions

At times, advisory message 1395 may be issued by the compiler. This message is part of a newtesting process. The compiler will display this message if it encounters a specific code sequencethat results in internal compiler templates being used in a unique way. It does not mean there is abug in the generated code, but that the code sequence encounted could be used to further improvethe compiler’s performance. If you wish to participate by contributing the code that generated thismessage, you are welcomed to send the project to support; otherwise, you may ignore this message.

1.4 Previous VersionsThe previous version of HI-TECH C Compiler for PIC18 MCUs was 9.66 released in April 2011.

3

Page 4: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 2

New Features

The following are new features the compiler now supports. The version number in brackets indicatesthe first compiler version to support the feature. See Section 6.1 for a full list of all supported devices.

2.1 GeneralC18 compatibility (9.80) This release offers beta support of C code compatibility with MPLAB C

Compiler for PIC18 MCUs projects. A replacement C18 driver (mcc18) is also supplied sothis compatibility also extends to the command-line options used to build C18 projects. AnyMPLAB IDE projects that are configured for MPLAB C Compiler for PIC18 MCUs need tobe associated with the replacement driver (mcc18) in the HI-TECH compiler’s bin directoryand rebuilt. The installer for version 9.80 allows you to automatically convert existing C18projects over to the replacement driver. See the C18 Compatibility section in the User’s Guidefor more information.

Html-format debug information (9.80) The compiler can now output a HTML summary of thebuild process. This currently contains limited information, but does provide some details notavailable elsewhere. It also allows easy access to intermediate files, particularly those thatare not normally in a human-readable format. See --HTML in the user’s manual for moreinformation.

New --fill specification (9.80) The --fill option, which fills unused addresses in a HEXfile, has been updated to be compatible with MPLAB C3X compilers. It adds the ability touse multiple instances of --fill on different address ranges, as well as adding the ability todo increment-filling over an address range. For more details consult the manual.

4

Page 5: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

New Features C Code

New Chips Supported (9.65) The following devices are now supported: 18F23K22, 18F24K22,18F25K22, 18F25K80, 18F26J13, 18F26J53, 18F26K22, 18F26K80, 18F27J13, 18F27J53,18F43K22, 18F44K22, 18F45K22, 18F45K80, 18F46J13, 18F46J53, 18F46K22, 18F46K80,18F47J13, 18F47J53, 18F65K22, 18F65K80, 18F65K90, 18F66K22, 18F66K80, 18F66K90,18F67K22, 18F67K90, 18F85K22, 18F85K90, 18F86J72, 18F86K22, 18F86K90, 18F87J72,18LF23K22, 18LF24K22, 18LF25K22, 18LF25K80, 18LF26J13, 18LF26J53, 18LF26K22,18LF26K80, 18LF27J13, 18LF27J53, 18LF43K22, 18LF44K22, 18LF45K22, 18LF45K80,18LF46J13, 18LF46J53, 18LF46K22, 18LF46K80, 18LF47J13, 18LF47J53 and 18LF65K80.

2.2 C CodeMulti-bank stack allocation (9.80) The compiler still places auto and parameter variables in a

compiled stack; however, this stack can not be built up in more than one memory bank. Thiswill allow more objects to be allocated to the stack and reduce stack-related memory errors.

Absolute const objects (9.80) Objects that are qualified const can now be made absolute and,hence, placed at a user-defined address. These objects can be initialized or uninitialized.

#pragma psect reinstated (9.80) This directive can now be used as it was on older STD compilers.It only affects code in the module in which the pragma is contained and allows you to moveblocks of code or data into user-defined psects, which can then be placed at user-definedaddresses.

2.3 Libraries and Header filesPeripheral library support (9.80) The HI-TECH peripheral library has been updated with the lat-

est functions, corrections and changes, made to the C18 peripheral library.

Alternative delay routines (9.80) There are now two in-built delay routines: _delaywdt, whichmay use a CLRWDT instruction in the delay loop, depending on the delay value; and _delay,which is guaranteed not to use this instruction. There are also __delaywdt_us and __delaywdt_msmacros that can be used in addition to the non-clrwdt versions.

setjmp/longjmp library functions (9.80) These functions have been implemented in the standardlibrary. Used with caution, they allow jumps across functions.

New typedef types (9.80) The intmax_t, uintmax_t, intptr_t, uintptr_t, int24 anduint24 types have been added to stdint.h.

5

Page 6: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 3

Changes

The following are features that are now handled differently by the compiler. These changes mayrequire modification to your source code if porting code to this compiler version. The version numberin brackets indicates the first compiler version to implement the change.

3.1 GeneralUSB memory (9.80) Previously, those devices that had the USB peripheral did not by default in-

clude the USB buffer memory in general purpose memory usable by your programs. This hasnow been changed. The assumption is now that the USB module is not being used and thatthis memory is available for general purpose use. If you are using this module and want toreserve the USB memory, use the --RAM option to limit the memory available.

3.2 Command-Line Driver--callgraph option removed (9.80) This option is no longer needed and the call graph (along

with call tables) now appears in the assembly list file, not the map file as was previously thecase.

--fill specification radix (9.80) The default radix of values used by the --fill option haschanged from hexadecimal to decimal. In order to be compatible with the new --fillspecification, prefix all values with 0x, as per C hexadecimal constants.

6

Page 7: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Changes C Code

3.3 C CodeSymbol length (9.80) The maximum C and preprocessor macro identifier default length has changed

from 31 to 255. Compiling with the --STRICT option will set this to the value 31. The -Noption no longer has any effect.

Fake symbols and external functions (9.80) External functions (those defined outside of the C do-main) which are called via a constant cast to be a function pointer use a new symbol for theirreturn value. It has been renamed from ?Fake to a name that is based on the function’saddress. See External Functions in the manual for more information.

Configuration bit (9.80) The compiler now support the use of #pragma config as the mainmechanism of specifying these bit settings. The syntax, setting and values are identical tothose used by MPLAB C for PIC18 MCUs. Open the file chipinfo.html, which is locatedin the DOCS directory of your compiler installation. Click on your target device and it willshow you the settings and values that are appropriate with this pragma. The __CONFIG and__PROG_CONFIG macros are still supported for legacy projects.

Structure return types (9.80) Structures (and unions) which are larger than 4 bytes in size are nowreturned in the function’s parameter memory and the address of this memory is returned in theFSR0 register. The limitation concerning returning of structures in program memory has nowbeen lifted.

3.4 Assembler/Assembly CodeFN-type directives (9.80) All FN-type directives are no longer supported and should not be used.

Such directive include: FNBREAK, FNSIZE, FNROOT etc. The FNCALL and FNROOT direc-tives are still issued by the compiler, but it is recommended that these not be used in hand-written assembly code.

3.5 Libraries and Header FilesWarnings with legacy SFRs (9.80) Using legacy SFRs or SFR bit names will generate a warning

indicating that the variable is deprecated.

Persistent variable check functions (9.80) The functions, which previously validated and checkedpersistent variables, have been removed. These no longer work with the new memory alloca-tion scheme used by this compiler version.

7

Page 8: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Changes Libraries and Header Files

EEPROM and flash routines (9.80) The functions to read and write the EEPROM and flash mem-ory are now supplied by the Microchip peripheral library. This library is built from the samecode used by the MPLAB C Compiler for PIC18 MCUs. The prototypes for these routines arecontained in the manual, in the Section EEPROM and Flash Runtime Access. You can alsofind information on these in the peripheral library documentation.Note that these routines are less automated than the HI-TECH C routines they replace. Whenflash memory is written, the entire block that contains the new values must be erased and thenwritten as a whole. If you only wish to write some of the locations in the block, then you mustread in the block, modify the copy to include the changes required, then write then modifedcopy back to the flash. The HI-TECH C routines allowed you to specify any address rangeand this would be accommodated by the library routine.

Peripheral libraries (9.80) The peripheral libraries are now linked in by default. The --RUNTIMEoption can be used to prevent these library files being searched, if required. If you are usingthe MPLAB IDE, new projects will default to linking in these libraries; however, existingprojects will use the setting you had previously selected in the Linker tab of the Build Optionsdialog. If you previously used the EEPROM or flash library routines, you must ensure that theperipheral libraries are linked in to continue to use them.

Single character SFR names (9.80) SFRs whose name was a single character have been removedfrom the header files. These were typically STATUS register bit variables, e.g. Z and C.

Standard library names (9.80) The names of the standard libraries have changed. See the user’sguide for more information.

Optimizer defines (9.80) The macro __OPTIMIZE_SIZE has been changed to __OPTIMIZE_SPACE.In addition, the __OPTIMIZE_SPACE or __OPTIMIZE_SPEED macros are only definedif the optimizer is enabled. Previously the space macro was defined even if the optimizer wasdisabled.

_fassert prototype change (9.80) The function called by the assert() macro, _fassert, hashad a minor change to its prototype.

CAN header file (9.80) The can18.h header file has been removed from the distribution. Thecontents of this file now appear in the device-specific header files for devices that implementCAN.

Floating-point unpack routines (9.80) The routines that used to appear in ftunpack.c and flunpack.care no longer included. Library routines that previously used these embed them inline to savestack levels and optimize the code.

8

Page 9: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 4

Limitations

The following are limitations in the compiler’s operation. These may be general coding restrictions,or deviations from information contained in the user’s manual.

4.1 GeneralCode size In some instances the code size may be larger than that produced by the PICC-18 STD

compiler.

File names If you add an assembly source file to an MPLAB project, the base name of the assemblysource file must be different to the MPLAB project base name. Errors will be generated if thisis not the case and the source file may be overwritten with the project’s intermediate assemblyfile.

REAL ICE debugging If you are using the REAL ICE __TRACE and __LOG debugging macros,these must be added by hand into your source code. You cannot use MPLAB IDE to add thesemacros to your code. The debugging settings should be configured in MPLAB IDE in theusual way.

4.2 PreprocessorSizeof Pointers The result of the sizeof preprocessor operator when applied to a pointer type

will always return 1. Use of the C sizeof operator will return the correct value.

9

Page 10: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Limitations C Code

4.3 C CodeCan’t generate code message This message may appear for complex expressions that involve mul-

tiple assignment operators, e.g. *= and floating-point operands. Splitting the expression intomultiple statements will correct this issue.

Can’t generate code message This message may appear when compiling code that casts floating-point values to an integer type. This is more likely to occur on complex expressions. Trysplitting the expression into multiple statements.

Accessing timers Some timer peripherals need to have multi-byte registers written in a specificorder, but this is not guaranteed with all C statements. Macros are provided which should beused to write to timer registers, e.g. WRITETIMER0(x). The multi-byte timer registers, e.g.TMR0, are not supported by this compiler; however, the individual registers that make up thetimer count, e.g. TMR0L and TMR0H, are supported.

Indirect calls from ISRs Indirect calls made in interrupt service routines to functions that are alsocalled from main-line code may fail and are now flagged as an error. This does not affectdirect calls made from an ISR.

Far Variables Variables qualified as far may be defined, but will not be assigned initial values.The usual caveats with far variables still apply with regard to the size of the code generatedto access them.

Extended PIC18 instruction set Presently the extended PIC18 instruction set and indexed address-ing mode are not supported by either the HI-TECH C PRO for the PIC18 MCU Family orPICC-18 STD compilers. If using a device which is equipped with the extended instructionset, it can be configured for legacy mode (extended instructions disabled) with the followingconfiguration setting:__CONFIG(4, XINSTDIS);Other configuration word 4 parameters are inherently ANDed into this directive as required.

Recursion Recursion is not supported by the compiler in any operating mode. For cases where afunction is called by both interrupt and main-line code, the function output is duplicated togive the impression of re-entrancy from the C source level. See the user’s guide Interruptsection for more information.

Absolute initialized variables (9.80) Variables which are absolute cannot be initialized.

Missing parenthesis not detected A missing end parenthesis is not detected in variable declara-tions when the variable is type cast. For example,

10

Page 11: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Limitations Libraries and Header Files

static char C @ ((unsigned)&PORTA;

This problem does not appear to affect any output code, but may cause problemswhen using third-party software tools.

Qualified arrays generate error The compiler generates an error when compiling complicated ar-rays involving qualified types, e.g.:

const char * const * const listnames[] = {menu0, menu1};

The error is not issued for arrays of more basic types or for less complicated types, e.g.

const char * * const listnames[] = {menu0, menu1};

will compile without error.

Structure initialization Locally defined structures are not initialized correctly.

Indirect Function call Use of indirect function calls when the function parameters include pointers,may result in compiler error. Try to avoid using pointers as parameters to the functions calledindirectly.

4.4 Libraries and Header FilesConfiguration pragma and macro usage On some devices, assigning a literal constant to an entire

configuration register (for example, CONFIG1L below) using the #pragma config willfail.

#pragma config CONFIG1L=0x37F

Use the individual settings to specify and build up the config value. You may safely assign constantvalues to each setting. Use of the __PROG_CONFIG macro may also fail, so it is recommended thatyou only use the __CONFIG macro for legacy projects.

Legacy configuration macro syntax If you are using the __CONFIG legacy macro, the parsing ofthe config setting symbols is very primitive and may not use brackets. The following example

__CONFIG(1,(XINSTDIS & DEBUGDIS & STVRDIS & PLLDIV1 & WDTEN & CPUDIV3 & UNPROTECT));

will genereate an error due to the extra parenthesis used. This should be specified as follows.

11

Page 12: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Limitations Debug Limitations

__CONFIG(1, XINSTDIS & DEBUGDIS & STVRDIS & PLLDIV1 & WDTEN & CPUDIV3 & UNPROTECT);

Configuration bit name omissions Some configuration bit names are missing from the header filesand cannot be used, for example EXTCLK0, BBSIZ4K, BBSIZ512, and OSC_EXT_RC_OSC_CLKOUT_ON_OSC2.

Flash Write Routine The flash write routine will fail if the memory being written is in the sameblock as the functions associated with writing flash.

Fast Double Libraries The fast form of the floating-point library routines have not been imple-mented. The suboption in the --double option has been removed to that effect.

Floating point accuracy The floating point math routines, despite DBL_MIN being defined as 1.17549435E-38, cannot perform operations predictably on numbers below the order of 1e-35. The result iseither correct OR zero.

4.5 Debug LimitationsICE2000/4000 Users of the Microchip ICE2000/4000 should be aware of a documented limitation

of these tools concerning side-effects when reading particular SFRs. Reading the followingSFRs can affect a STATUS bit, but due to a limitation of the ICE some general purpose regis-ters will also be affected. Reading from the following SFRs can affect the GPRs as follows:

• PORTB - x81 (081, 181, 281, 391 etc.)

• RCREG1 - xAE

• RCREG2 - x6E

• PORTD - x83

• SSPBUF - xC9

It is advised to reserve the corresponding locations using a --RAM option (while debugging)if your program reads from the above registers. More information can be found in MPLABvia the ICE2000/4000 help topics under Limitations: PIC18XXXX General Limitations.

COF debug limitation For users of MPLAB IDE, please be aware that due to a limitation in theCOF debugging format, pointers are always assumed to be 16-bits in length by the IDE. Thecompiler will encode pointers to be either 1, 2 or 3 bytes wide.This limitation will mean that the addresses contained in 1- or 3-byte wide pointers may beincorrectly shown in the Watch window. In addition, if a pointer is a member of a structure,

12

Page 13: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Limitations Debug Limitations

those members located after the pointer in the structure’s memory will also be shown incor-rectly in the Watch window if the pointer member is not 2 bytes wide.The actual contents of the pointer and program execution are not affected.

13

Page 14: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 5

Bugfixes

The following are corrections that have been made to the compiler. These may fix bugs in thegenerated code or alter the operation of the compiler to that which was intended or specified by theuser’s manual. The version number in brackets indicates the first compiler version to implement thefix.

5.1 DriverRuntime startup code for far objects (9.80) The runtime startup code generated by the driver when

uninitialized far variables are used attempted to clear these variables in RAM, not in the exter-nal memory. This mean that the far variables would not have been cleared properly and otherobjects may be overwritten.

5.2 C CodeCalling functions via a constant (9.80) If a literal constant is cast to a function pointer and used to

call a function (presumably defined in assembly code or via some non-C means) the compilerwill now attempt to make this call. Previously, an error would result. If the function beingcalled takes arguments or returns a value in memory, the use must define the location of thesymbols used to store these values. The names of the symbols will be printed as undefined ifyou build without defining them.

Calling undefined functions (9.80) If an array of function pointers is not initialized and one of thepointers is used to call a function, the compiler will now produce an error to indicate the called

14

Page 15: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Bugfixes C Code

function is unknown.

Error on invalid warning pragma (9.80) If a negative value was specified with the #pragmawarning disable the parser may have crashed. This has been corrected and an errorwill be produced in this situation.

Wrong access for known pointers (9.80) If a pointer is assigned only one value, this address isknown by the code generator (it is a constant), and the pointer is used to access an object,an optimization may directly access the object without using the pointer. For some programmemory addresses, the code produced would access the correct address, but the data spacememory. Access is now made to the correct memory space.

Error on absolute variable initialization (9.80) Initialization of absolute variables is not allowed.Previously, if such code was encountered, it would silently be ignored and the variable’s indi-cated address may not be honoured. If such code is encountered now, an error will be issued.

Initialized function pointer in a structure (9.80) If a structure, which includes a function pointermember, was initialized at its declaration, then accessing this object may have resulted in error.Structures are now correctly initialized regardless of member type.

Undefined i1/i2 symbols (9.80) In some instances where a function was called or had its addresstaken and this function was used or referenced in both interrupt and main-line code, somesymbols were not defined by the compiler and a compiler error would result.

Crash when sizeof used as array dimension (9.80) If an array was defined that did not have itssize specified in the square brackets, and the size of this array was taken using the sizeofoperator, and this size was then used as the dimension of another array, the compiler wouldcrash. Such code is now compiled without error.

Conditional operator (9.80) in some instances, the ordering of code generated for the conditionaloperator ? : may have been out of sequence. This would not have affected the functionaspect of generated code, but the order of side effects may have changed. This has beencorrected.

Can’t generate code with function parameters (9.80) Many instances of code, where a pointerwas passed to a function, may have triggered a “can’t generate code” error message. Theseerrors related to an incorrect calculation of the pointer size for the parameter. This pointer sizeis now correctly calculated.

Access of large arrays (9.80) When large arrays were accessed, an int index variable may havebeen incorrectly reduced to a signed char rather than an unsigned char, where suchan optimization was possible. The wrong array element would have been accessed. Theseoptimizations are now correctly performed.

15

Page 16: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Bugfixes C Code

Access of const parameters (9.80) Parameters that were qualified as constwere in some instancesbeing read from program memory rather than data memory.

Wrong bank selection in comparing unsigned long with literal (9.66) Bank was not being selectedfor temporary variables used in computation.

Right shift of long by zero (9.66) Right shifting of a long variable by zero was incorrectly handled.

Incorrect result for xor_between long and char (9.66) XOR between a long with char was result-ing into incorrect results.

Right shift of integers (9.66) Logical shift was being performed instead of arithmetic shift.

Wrong value assigned to union variable (9.66) Assigning value to union variable was incorrectlydone.

Banksel missing when assigning bitfield from temporary variable (9.66) Banksel was added inassignment to bitfield from a temporary value.

Pointer comparison to NULL (9.65) If a 2-byte pointer was compared to NULL, the comparisonmay result a true value if the LSB of the pointer’s content was 0. A full 2-byte comparison isnow performed and this comparison will return false where expected.

Incorrect bit-field initialization (9.65) If a structure with bit-fields was initialized, but the numberof initial values was less than the number of bit-field members contained in the structure, thecompiler was not padding the initial values with extra 0 values.

“Undefined symbol ’null”’ error (9.65) In some instances pointer variables may not have acquiredthe correct size which would have lead to this error. The size of pointers is now alwaysperformed correctly.

“Looping around MACH_ALLOC” error (9.65) This error may have been produced in some sit-uations where memory allocation of variables failed. Better sorting has been implemented.

Wrong bank selection after pointer access (9.65) One of two banks might have been selected af-ter executing code that performed a dereference of a pointer that has targets to both data andprogram memory. After executing this code, the compiler would have assumed only one bankselection was possible and this may have caused subsequent code to fail.

Wrong bank selection after bit-field assignment (9.65) One of two banks might have been se-lected after executing code that performed an assignment of a one-bit wide bit-field to another,but the compiler would have assumed only one selection was possible. This may have causedsubsequent code to fail.

16

Page 17: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Bugfixes Assembler/Assembly Code

5.3 Assembler/Assembly CodeCrash with long symbols (9.80) Symbols larger than 100 characters may have crashed the assembler.The assembler has been adjust to allow symbols up to 256 characters in size.

5.4 Chip Configuration and Header FilesUpdated files (9.80) The device configuration and header files are now built entirely from a central

database. Any changes, such as corrections to memory ranges, names or addresses of SFRs orbits within these SFRs, made to this database will show in these files.

5.5 DebuggingWatching anonymous structure (9.80) Watching anonymous structure members may not have re-

vealed the correct contents. The debugging information has been extended to allow suchmembers to be viewed correctly.

17

Page 18: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Chapter 6

Addendum

6.1 List of Supported DevicesThe following is the full list of all devices supported by this version of HI-TECH C Compiler forPIC18 MCUs (PRO) sorted alpha-numerically. Check the chipinfo.html file in the DOCS direc-tory, or the Driver tab in the MPLAB IDE Build Options dialog for the supported devices for othercompiler versions.

18C242, 18C252, 18C442, 18C452, 18C601, 18C658, 18C801, 18C858, 18F1220,18F1230, 18F1320, 18F1330, 18F13K20, 18F13K22, 18F13K50, 18F14K20, 18F14K22,18F14K50, 18F2220, 18F2221, 18F2320, 18F2321, 18F2331, 18F23K20, 18F23K22,18F2410, 18F242, 18F2420, 18F2423, 18F2431, 18F2439, 18F2450, 18F2455, 18F2458,18F248, 18F2480, 18F24J10, 18F24J11, 18F24J50, 18F24K20, 18F24K22, 18F2510,18F2515, 18F252, 18F2520, 18F2523, 18F2525, 18F2539, 18F2550, 18F2553, 18F258,18F2580, 18F2585, 18F25J10, 18F25J11, 18F25J50, 18F25K20, 18F25K22, 18F25K80,18F2610, 18F2620, 18F2680, 18F2682, 18F2685, 18F26J11, 18F26J13, 18F26J50,18F26J53, 18F26K20, 18F26K22, 18F26K80, 18F27J13, 18F27J53, 18F4220, 18F4221,18F4320, 18F4321, 18F4331, 18F43K20, 18F43K22, 18F4410, 18F442, 18F4420, 18F4423,18F4431, 18F4439, 18F4450, 18F4455, 18F4458, 18F448, 18F4480, 18F44J10, 18F44J11,18F44J50, 18F44K20, 18F44K22, 18F4510, 18F4515, 18F452, 18F4520, 18F4523,18F4525, 18F4539, 18F4550, 18F4553, 18F458, 18F4580, 18F4585, 18F45J10, 18F45J11,18F45J50, 18F45K20, 18F45K22, 18F45K80, 18F4610, 18F4620, 18F4680, 18F4682,18F4685, 18F46J11, 18F46J13, 18F46J50, 18F46J53, 18F46K20, 18F46K22, 18F46K80,18F47J13, 18F47J53, 18F6310, 18F6390, 18F6393, 18F63J11, 18F63J90, 18F6410,18F6490, 18F6493, 18F64J11, 18F64J90, 18F6520, 18F6525, 18F6527, 18F6585, 18F65J10,

18

Page 19: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Addendum List of Supported Devices

18F65J11, 18F65J15, 18F65J50, 18F65J90, 18F65K22, 18F65K80, 18F65K90, 18F6620,18F6621, 18F6622, 18F6627, 18F6628, 18F6680, 18F66J10, 18F66J11, 18F66J15,18F66J16, 18F66J50, 18F66J55, 18F66J60, 18F66J65, 18F66J90, 18F66J93, 18F66K22,18F66K80, 18F66K90, 18F6720, 18F6722, 18F6723, 18F67J10, 18F67J11, 18F67J50,18F67J60, 18F67J90, 18F67J93, 18F67K22, 18F67K90, 18F8310, 18F8390, 18F8393,18F83J11, 18F83J90, 18F8410, 18F8490, 18F8493, 18F84J11, 18F84J90, 18F8520,18F8525, 18F8527, 18F8585, 18F85J10, 18F85J11, 18F85J15, 18F85J50, 18F85J90,18F85K22, 18F85K90, 18F8620, 18F8621, 18F8622, 18F8627, 18F8628, 18F8680,18F86J10, 18F86J11, 18F86J15, 18F86J16, 18F86J50, 18F86J55, 18F86J60, 18F86J65,18F86J72, 18F86J90, 18F86J93, 18F86K22, 18F86K90, 18F8720, 18F8722, 18F8723,18F87J10, 18F87J11, 18F87J50, 18F87J60, 18F87J72, 18F87J90, 18F87J93, 18F87K22,18F87K90, 18F96J60, 18F96J65, 18F97J60, 18LF13K22, 18LF13K50, 18LF14K22,18LF14K50, 18LF23K22, 18LF24J10, 18LF24J11, 18LF24J50, 18LF24K22, 18LF25J10,18LF25J11, 18LF25J50, 18LF25K22, 18LF25K80, 18LF26J11, 18LF26J13, 18LF26J50,18LF26J53, 18LF26K22, 18LF26K80, 18LF27J13, 18LF27J53, 18LF43K22, 18LF44J10,18LF44J11, 18LF44J50, 18LF44K22, 18LF45J10, 18LF45J11, 18LF45J50, 18LF45K22,18LF45K80, 18LF46J11, 18LF46J13, 18LF46J50, 18LF46J53, 18LF46K22, 18LF46K80,18LF47J13, 18LF47J53, 18LF65K80, 18LF66K8018C242, 18C252, 18C442, 18C452,18C601, 18C658, 18C801, 18C858, 18F1220, 18F1230, 18F1320, 18F1330, 18F13K22,18F13K50, 18F14K22, 18F14K22LIN, 18F14K50, 18F2220, 18F2221, 18F2320, 18F2321,18F2331, 18F23K20, 18F23K22, 18F2410, 18F242, 18F2420, 18F2423, 18F2431, 18F2439,18F2450, 18F2455, 18F2458, 18F248, 18F2480, 18F24J10, 18F24J11, 18F24J50, 18F24K20,18F24K22, 18F2510, 18F2515, 18F252, 18F2520, 18F2523, 18F2525, 18F2539, 18F2550,18F2553, 18F258, 18F2580, 18F2585, 18F25J10, 18F25J11, 18F25J50, 18F25K20,18F25K22, 18F25K80, 18F2610, 18F2620, 18F2680, 18F2682, 18F2685, 18F26J11,18F26J13, 18F26J50, 18F26J53, 18F26K20, 18F26K22, 18F26K80, 18F27J13, 18F27J53,18F4220, 18F4221, 18F4320, 18F4321, 18F4331, 18F43K20, 18F43K22, 18F4410,18F442, 18F4420, 18F4423, 18F4431, 18F4439, 18F4450, 18F4455, 18F4458, 18F448,18F4480, 18F44J10, 18F44J11, 18F44J50, 18F44K20, 18F44K22, 18F4510, 18F4515,18F452, 18F4520, 18F4523, 18F4525, 18F4539, 18F4550, 18F4553, 18F458, 18F4580,18F4585, 18F45J10, 18F45J11, 18F45J50, 18F45K20, 18F45K22, 18F45K80, 18F4610,18F4620, 18F4680, 18F4682, 18F4685, 18F46J11, 18F46J13, 18F46J50, 18F46J53,18F46K20, 18F46K22, 18F46K80, 18F47J13, 18F47J53, 18F6310, 18F6390, 18F6393,18F63J11, 18F63J90, 18F6410, 18F6490, 18F6493, 18F64J11, 18F64J90, 18F6520,18F6525, 18F6527, 18F6585, 18F65J10, 18F65J11, 18F65J15, 18F65J50, 18F65J90,18F65K22, 18F65K80, 18F65K90, 18F6620, 18F6621, 18F6622, 18F6627, 18F6628,18F6680, 18F66J10, 18F66J11, 18F66J15, 18F66J16, 18F66J50, 18F66J55, 18F66J60,18F66J65, 18F66J90, 18F66J93, 18F66K22, 18F66K80, 18F66K90, 18F6720, 18F6722,18F6723, 18F67J10, 18F67J11, 18F67J50, 18F67J60, 18F67J90, 18F67J93, 18F67K22,

19

Page 20: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Addendum Microchip Errata

18F67K90, 18F8310, 18F8390, 18F8393, 18F83J11, 18F83J90, 18F8410, 18F8490,18F8493, 18F84J11, 18F84J90, 18F8520, 18F8525, 18F8527, 18F8585, 18F85J10,18F85J11, 18F85J15, 18F85J50, 18F85J90, 18F85K22, 18F85K90, 18F8620, 18F8621,18F8622, 18F8627, 18F8628, 18F8680, 18F86J10, 18F86J11, 18F86J15, 18F86J16,18F86J50, 18F86J55, 18F86J60, 18F86J65, 18F86J72, 18F86J90, 18F86J93, 18F86K22,18F86K90, 18F8720, 18F8722, 18F8723, 18F87J10, 18F87J11, 18F87J50, 18F87J60,18F87J72, 18F87J90, 18F87J93, 18F87K22, 18F87K90, 18F96J60, 18F96J65, 18F97J60,18LF13K22, 18LF13K50, 18LF14K22, 18LF14K50, 18LF23K22, 18LF24J10, 18LF24J11,18LF24J50, 18LF24K22, 18LF25J10, 18LF25J11, 18LF25J50, 18LF25K22, 18LF25K80,18LF26J11, 18LF26J13, 18LF26J50, 18LF26J53, 18LF26K22, 18LF26K80, 18LF27J13,18LF27J53, 18LF43K22, 18LF44J10, 18LF44J11, 18LF44J50, 18LF44K22, 18LF45J10,18LF45J11, 18LF45J50, 18LF45K22, 18LF45K80, 18LF46J11, 18LF46J13, 18LF46J50,18LF46J53, 18LF46K22, 18LF46K80, 18LF47J13, 18LF47J53, 18LF65K80, 18LF66K80

6.2 Microchip ErrataThis release of the PICC-18 compiler recognises the published silicon errata issues listed in thetable below. Some of these issues have been corrected and no longer apply in recent silicon revi-sions. Refer to Microchip’s device errata documents for details on which issues are still pertinentfor your silicon revision. The compiler’s chip configuration file records which issues are applicableto each device. Specific errata workarounds can be selectively enabled or disabled via the driver’s--ERRATA command line option.

PICC-18 Errata WorkaroundsName Description Workaround details

4000 Execution of some flow control opera-tions may yeild unexpected results whencertain instructions vector code execu-tion across the 4000h address boundary.

A continuous block of pro-gram code is not allowed togrow over the 4000h addressboundary. Additional NOPinstructions are inserted atprescribed locations.

LFSR Using the LFSR instruction to load avalue into a specified FSR register mayalso corrupt a RAM location.

The compiler will load FSRregisters without using theLFSR instruction.

DAW The DAW instruction may improperlyclear the CARRY bit (STATUS<0>)when executed.

The compiler is not affectedby this issue.

Continued...

20

Page 21: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Addendum Microchip Errata

PICC-18 Errata WorkaroundsName Description Workaround details

MINUS40 Table read operations above the userprogram space (>1FFFFFh) may yielderroneous results at the extreme low endof the device’s rated temperature range(-40oC).

Affected library sourcesconfig.c, idloc.c and de-vread.c employ additionalNOP instructions at pre-scribed locations.

EEDAT When reading EEPROM, the contentsof the EEDATA register may becomecorrupted in the second instruction cycleafter setting the RD bit (EECON1<0>).

The EEPROM_READ macroand eeprom_read libraryfunction read EEDATA im-meadiately.

EEADR The result returned from an EEPROMread operation can be corrupted if theRD bit is set immediately following theloading of the EEADR register.

The compiler is not affectedby this issue.

EELVD Writes to EEPROM memory may notsucceed if the internal voltage referenceis not set.

No workaround applied

FLLVD Writes to program memory may notsucceed if the internal voltage referenceis not set.

No workaround applied

RESET A GOTO instruction placed at the resetvector may not execute.

Additional NOP instructioninserted at reset vector if fol-lowing instruction is GOTO.

FASTINTS If a high-priority interrupt occurs dur-ing a two-cycle instruction which mod-ifies WREG, BSR or STATUS, the fast-interrupt return mechanism (via shadowregisters) will restore the value held bythe register before the instruction.

Additional code reloads theshadow registers with thecorrect values of WREG,STATUS and BSR.

BSR15 Peripheral flags may be erroneously af-fected if the BSR register holds the value15, and an instruction is executed thatholds the value C9h in its 8 least signif-icant bits.

Compiler avoids generatingMOVLB 15 instructions. Awarning is issued if this in-struction is detected.

Continued...

21

Page 22: HI-TECH C Compiler for PIC18 MCUs Version 9.80 …ww1.microchip.com/downloads/en/DeviceDoc/PICC_18_9... · This release is a major update of the HI-TECH C Compiler for PIC18TM MCUs.

Addendum Microchip Errata

PICC-18 Errata WorkaroundsName Description Workaround details

TBLWTINT If a peripheral interrupt occurs duringa TBLWT operation, data can be cor-rupted.

Library routine flash_write()will temporarily disable allapplicable interrupt-enablebits before execution of aTBLWT instruction.

FW4000 Self write operations initiated from andacting upon a range within the same sideof the 4000h boundary may fail basedon sequences of instructions executedfollowing the write.

No workaround applied

RESETRAM Data in a RAM location can becomecorrupted if an asynchronous reset (eg.WDT, MCLR event) occurs during awrite operation to that location.

A warning will be issuedif the length nvram psectis greater than zero bytes(persistent variables popu-late this psect).

22