Push-Button Omniscient Compiler for PIC10/12/16 Reduces Interrupt Latency by 40%-60%, Eliminates Non-Standard C-Extensions

1.9X the Code Density, 1.6X Better RAM Usage, and 60% Faster Interrupts Than IAR


SAN JOSE, CA--(Marketwire - April 15, 2008) - Embedded Systems Conference -- HI-TECH Software today announced its HI-TECH C PRO for the PIC10/12/16 OCG compiler with nearly 2X the code density and 38% better RAM usage than IAR's compiler for PIC16/17(i), and 30% better code density with 80% better RAM utilization than CCS' PCM C(ii) without using any C-extensions or assembly code. By optimizing interrupt-related contexts, the "omniscient code generation" technology in the compiler reduces interrupt latency by 40% to 60%.

By providing efficient push-button compilation, HI-TECH C PRO for the PIC10/12/16 MCU Family makes these devices more accessible to non-expert mechanical engineers who are increasingly using MCUs to replace mechanical sensors and controls in white goods, climate control, and other high-volume embedded applications.

According to HI-TECH CEO Clyde Stubbs, "More and more mid-range PIC users are coming from a mechanical engineering background. MCUs offer a cheaper and more reliable solution than mechanical sensors, relays and switches traditionally used in these applications. However, MEs have limited programming experience and are reluctant to learn non-standard C-extensions. PRO for the PIC10/12/16 offers them a tidy solution -- very compact code, without having to learn the intricacies of the device architecture. This compiler will definitely ease the transition to a digital solution."

Banked Memory Architecture Complicates Programming. PIC10/12/16 devices typically have up to four memory banks that cannot be directly accessed simultaneously. If data in one bank must be copied to another bank, up to two bank selection instructions are required to select the destination bank for every access. Conventional compilers have no way of knowing where the variables will be linked or whether or not a bank is to be selected, so the compiler would need to automatically generate bank selection instructions for every memory access, unnecessarily bloating the code -- often to such an extent that it will not fit in device memory.

Compiler vendors have addressed this issue by providing bank qualifiers -- extensions to the C-code that identify the bank of the variable. Programmers may manually assign variables to different memory banks using this non-standard, non-portable code. Using bank qualifiers allows the compiler to see the exact bank an object resides in and reduces the number of bank selection instructions for more compact code. However, trying to track all the memory addresses across multiple code modules and ensure that all pointers have the appropriate qualifiers is a time consuming, tedious process that requires substantial expertise and can itself introduce programming errors.

Omniscient Code Generation Delivers Dense Code Without C-extensions. HI-TECH C PRO for PIC10/12/16 employs HI-TECH Software's OCG technology that collects, during compilation, comprehensive data on register, stack, pointer, object and variable declarations from all program modules. It uses this information to optimize: the size and scope of every pointer, every object stored on the compiled stack, and every variable and register allocation. Based on call and pointer reference graphs, the compiler knows exactly which functions call, and are called by, other functions, which variables and registers are required, and ensure pointers can point to the required memory banks.

Since it knows how frequently each variable is used and which variables are dependent, it can allocate memory optimally to minimize or eliminate bank selection instructions, without any intervention from the programmer, optimizes pointers and positions objects in the most efficient memory banks.

Memory Allocation. Global and static variables in PIC10/12/16 MCU are first assigned a fixed address in available unbanked memory, or to a specific memory bank based on their size, special qualifiers, and the number of times they are referenced.

Function parameters and auto variables are assigned space on the compiled stack. The linker automatically allows variables to share the same memory if their functions are not active at the same time, thereby reducing RAM usage by as much as 80%.

Lower Interrupt Latency. Another benefit of OCG is low interrupt latency. Conventional compilers cannot "see" what functions will be called or which registers will be used by any interrupt routine. To prevent memory overwrites, most compilers allow for the "worst case" situation by saving every register that might be used by an interrupt-called function -- a cycle-intensive process that can increase interrupt latency.

HI-TECH C PRO for the PIC10/12/16 knows exactly what functions are called by every interrupt routine and exactly which registers will need to be saved and restored as part of the interrupt context saving code. As a result, it saves the minimum context required for each interrupt, saving memory resources and also reducing interrupt latency. For example CCS PCM compiler always saves 8 bytes of data, requiring a total of 42 instruction cycles (23 to save and 19 to restore the context). In contrast, the OCG technology in HI-TECH PRO for the PIC10/12/16 allows it to dynamically determine the size of the context depending on the state of the code at the time of compilation. The interrupt context save and restore code generated by PRO for the PIC10/12/16 can take as few as 17 cycles -- 60% less than a traditional compiler. At only 25 cycles, the worst case interrupt latency of the HI-TECH PRO compiler code is 40% smaller than with the CCS compiler. In an interrupt-intensive application, HI-TECH C PRO for the PIC10/12/16 compiler could save as many as 20% of the CPU's available cycles, freeing it up to do more processing or allowing it to be put to sleep for lower power consumption.

Seamless Integration Into MPLAB. HI-TECH C PRO for the PIC10/12/16 seamlessly integrates into Microchip's MPLAB® integrated development environment (IDE), as well as most 3rd-party development tools. PRO for the PIC10/12/16 runs on multiple platforms including Windows (2000, XP, Vista), Linux and Mac OS X. HI-TECH Software also provides its own Eclipse-based IDE, HI-TIDE™ 3, including full project management, a flexible editor, a fast, accurate simulator, and peripheral initialization tool.

Source code and runtime modules included. Hi Tech's compiler is available with full source code to all library routines. The run-time start-off modules are automatically generated and customized for the application each time the project is built. There are no restrictions or limitations on use of executable library code.

Demo download and an extended evaluation period. A fully functional 45-day trial version of HI-TECH C PRO for the PIC10/12/16 MCU Family can be downloaded, free of charge, at HI-TECH's website http://microchip.htsoft.com.

Pricing and Availability. HI-TECH C PRO for the PIC10/12/16 MCU Family is now available at an introductory price of $1,195, which is 20% off MRSP.

About HI-TECH Software. HI-TECH Software is a world-class provider of development tools for embedded systems, offering compilers, RTOS and an Eclipse based IDE (HI-TIDE) for 8-, 16-, and 32-bit microcontroller and DSP chip architectures. HI-TECH is the number one third party vendor of compilers for Microchip Technology Inc., with approximately 64% marketshare. Its customers include tens of thousands of embedded system developers including General Motors, Whirlpool, Qualcomm, and John Deere.

Founded by Clyde Stubbs, in 1984 in Brisbane, Australia, HI-TECH Software has an extensive network of distributors around the globe.

Note: PIC and MPLAB are registered trademarks of Microchip Technology Inc. in the USA and other countries. All other trademarks mentioned herein are the property of their respective companies. OCG is trademark of HI-TECH Software.

(i) Project with PIC 16F630 device which has 1023 words of program memory and 66 bytes of RAM.

(ii) Project with PIC 10F202 device which has 512 words of program memory and 24 bytes of RAM.

Contact Information: Contacts: Nancy B. Green The William Baldwin Group +1 650 856 6192 Peter Riachi HI-TECH Software +61 7 3722 7777