top of page

RESPIRABLE CRYSTALLINE SILICA

Public·16 members
Sevastyan Antonov
Sevastyan Antonov

HI-TECH C Compiler for PIC10/12/16 MCUs Version 9.83 112: A Comprehensive Guide



HI-TECH C Compiler v9.83 112: A Review




If you are looking for a powerful, reliable, and easy-to-use C compiler for developing applications on Microchip PIC microcontrollers, you might want to check out the HI-TECH C Compiler for PIC10/12/16 MCUs. This compiler is designed to fully implement the optimizations of Omniscient Code Generation - a whole-program compilation technology that provides denser code and better performance than traditional compilers. In this article, we will review the features, benefits, installation, usage, and comparison of the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, which is the latest release of this compiler as of June 2021.




hi-tech c compiler v9.83 112



Introduction




The HI-TECH C Compiler for PIC10/12/16 MCUs is a professional-grade ANSI C compiler that supports all Microchip PIC10, PIC12, and PIC16 microcontrollers. It is compatible with all Microchip debuggers and emulators, such as MPLAB ICD, MPLAB REAL ICE, MPLAB X IDE, etc. It also integrates seamlessly with Microchip MPLAB IDE - a free integrated development environment that allows you to write, compile, debug, and program your code.


The HI-TECH C Compiler for PIC10/12/16 MCUs uses Omniscient Code Generation (OCG) - a unique and innovative technology that analyzes the entire program at once and applies global optimizations to produce the most compact and efficient code possible. OCG can reduce code size by up to 50% and improve execution speed by up to 25% compared to traditional compilers. OCG also eliminates the need for manual optimization techniques, such as hand-coding assembly, tweaking linker scripts, or using pragma directives. OCG does all the optimization work for you automatically and intelligently.


The benefits of using the HI-TECH C Compiler for PIC10/12/16 MCUs for development on PIC microcontrollers are numerous. Some of them are:


  • You can write high-level C code that is portable, readable, and maintainable, without sacrificing performance or code density.



  • You can take advantage of the rich set of features and libraries that the compiler provides, such as interrupt handling, bit manipulation, EEPROM access, math functions, string functions, etc.



  • You can debug your code easily and efficiently using the built-in simulator or the hardware devices supported by the compiler.



  • You can enjoy the full support and updates from Microchip, the leading manufacturer of PIC microcontrollers and development tools.



In the following sections, we will show you how to install and set up the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, how to write and compile code using the compiler, how to test and debug code using the compiler, what are the new features and improvements in this version of the compiler, how it compares with other C compilers for PIC10/12/16 MCUs, and some tips and best practices for using the compiler effectively and efficiently.


Installation and Setup




To install and set up the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, you need to follow these steps:


  • Download the installer file from the Microchip website. The file name is htpic-9.83pl2.exe and the file size is about 40 MB.



  • Run the installer file and follow the instructions on the screen. You will need to accept the license agreement, choose a destination folder, and select the components to install. The components include the compiler, the documentation, the examples, and the MPLAB IDE integration.



  • After the installation is complete, you will need to activate the compiler using your license key. You can obtain your license key from your Microchip account or from your product purchase confirmation email. You can activate the compiler online or offline, depending on your internet connection availability.



  • To integrate the compiler with MPLAB IDE, you need to launch MPLAB IDE and select HI-TECH Universal Toolsuite as your active tool suite. You can also select HI-TECH C as your active language tool. This will allow you to use MPLAB IDE to create projects, edit code, compile code, program devices, and debug code using HI-TECH C Compiler.



  • To configure HI-TECH C Compiler options and settings, you can use either the command-line interface or the MPLAB IDE interface. The command-line interface allows you to specify various options and flags for compiling your code using a batch file or a makefile. The MPLAB IDE interface allows you to specify various options and settings for compiling your code using a graphical user interface. You can access the MPLAB IDE interface by selecting Project > Build Options > Project from the menu bar.



The installation and setup process is simple and straightforward, and it should not take more than a few minutes to complete.


Writing and Compiling Code




To write and compile code using HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, you need to follow these steps:


  • Create a new project in MPLAB IDE or open an existing project. You can create a new project by selecting Project > New Project from the menu bar. You will need to choose a project name, a project location, a device family (PIC10/12/16), a device model (e.g., PIC16F877A), a tool suite (HI-TECH Universal Toolsuite), a language tool (HI-TECH C), and a debugger/emulator (e.g., MPLAB ICD 3).



  • Add source files to your project or create new source files. You can add source files to your project by selecting Project > Add Files from the menu bar. You can create new source files by selecting File > New from the menu bar. You will need to choose a file name, a file type (C Source File), and a file location. You can also use the MPLAB IDE editor to write your code or use your preferred text editor.



  • Write C code for PIC10/12/16 MCUs using HI-TECH C Compiler syntax and features. You can write standard ANSI C code that is compatible with HI-TECH C Compiler, or you can use some of the compiler-specific features and extensions that enhance your code functionality and efficiency. Some of the compiler-specific features and extensions are:



  • Interrupt handling: You can use the interrupt keyword to declare an interrupt service routine (ISR) that will be executed when an interrupt occurs. You can also use the enable_interrupts and disable_interrupts functions to control the global interrupt enable bit.



  • Bit manipulation: You can use the _set, _clear, _toggle, and _test functions to manipulate individual bits in registers or variables. You can also use the _bit attribute to declare bit variables that occupy only one bit of memory.



  • EEPROM access: You can use the eeprom_read and eeprom_write functions to read and write data from the internal EEPROM of the PIC microcontroller. You can also use the _eeprom attribute to declare variables that are stored in the EEPROM.



  • Math functions: You can use the math library that provides various arithmetic, trigonometric, logarithmic, and exponential functions. The math library supports both 8-bit and 16-bit integer arithmetic, as well as 32-bit floating-point arithmetic.



  • String functions: You can use the string library that provides various functions for manipulating strings, such as copying, concatenating, comparing, searching, formatting, etc. The string library supports both null-terminated strings and fixed-length strings.



  • Compile C code using HI-TECH C Compiler command-line or MPLAB IDE interface. You can compile your code using the command-line interface by invoking the compiler executable (picc.exe) with the appropriate options and flags. You can also compile your code using the MPLAB IDE interface by selecting Project > Build All from the menu bar. The compiler will generate an object file (.o) and a hex file (.hex) for each source file in your project. The compiler will also generate a map file (.map) and a list file (.lst) for your project that contain useful information about your code, such as memory usage, symbol table, cross-reference, etc.



The writing and compiling process is easy and convenient, and it should not take more than a few minutes to complete.


Testing and Debugging Code




To test and debug code using HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, you need to follow these steps:


  • Test and debug code using HI-TECH C Compiler simulator or hardware devices. You can test and debug your code using the simulator that is built into the compiler. The simulator allows you to run your code in a virtual environment that mimics the behavior of the PIC microcontroller. You can also test and debug your code using hardware devices that are supported by the compiler, such as MPLAB ICD, MPLAB REAL ICE, PICkit, etc. These devices allow you to run your code on a real PIC microcontroller and monitor its operation.



  • Use HI-TECH C Compiler error and warning messages. The compiler will display error and warning messages on the console or in the MPLAB IDE output window if there are any problems with your code. The error messages indicate fatal errors that prevent your code from being compiled successfully. The warning messages indicate potential problems that may affect your code functionality or efficiency. You should always fix any error messages and try to eliminate any warning messages before proceeding with testing and debugging.



  • Use HI-TECH C Compiler debugging tools and features. The compiler provides various tools and features that help you debug your code effectively and efficiently. Some of them are:



  • Breakpoints: You can set breakpoints in your code that will pause the execution when reached. You can set breakpoints using the __break keyword in your code, or using the MPLAB IDE interface by selecting Debug > Set/Clear Breakpoint from the menu bar. You can also view and manage your breakpoints using the MPLAB IDE interface by selecting View > Breakpoints from the menu bar.



  • Watch variables: You can watch the values of variables in your code that will be updated as the execution progresses. You can watch variables using the MPLAB IDE interface by selecting View > Watch from the menu bar. You can also add, remove, or modify variables in the watch window using the MPLAB IDE interface.



  • Single-step execution: You can execute your code one instruction at a time and observe its effects on the registers, memory, and peripherals. You can single-step your code using the MPLAB IDE interface by selecting Debug > Step Into, Debug > Step Over, or Debug > Step Out from the menu bar.



  • Trace buffer: You can record the history of executed instructions and their corresponding addresses, opcodes, and operands. You can view the trace buffer using the MPLAB IDE interface by selecting View > Trace from the menu bar. You can also control the trace buffer size and mode using the MPLAB IDE interface.



  • Data visualizer: You can display graphical representations of data in your code, such as waveforms, histograms, bar charts, etc. You can use the data visualizer using the MPLAB IDE interface by selecting View > Data Visualizer from the menu bar. You can also configure the data visualizer settings and options using the MPLAB IDE interface.



The testing and debugging process is flexible and powerful, and it should not take more than a few minutes to complete.


New Features and Improvements in Version 9.83 112




The HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112 is the latest release of this compiler as of June 2021. It includes some new features and improvements that enhance its functionality and performance. Some of them are:


  • New device support: The compiler now supports some new PIC microcontroller models, such as PIC12F529T48A, PIC12F529T39A, PIC16F15213, PIC16F15214, PIC16F15223, PIC16F15224, etc.



  • New library functions: The compiler now provides some new library functions, such as _delay_ms, _delay_us, _delay_cycles, etc., that allow you to insert precise delays in your code.



  • New optimization options: The compiler now provides some new optimization options, such as --opt-code-speed, --opt-code-size, --opt-asm-speed, --opt-asm-size, etc., that allow you to fine-tune the trade-off between code speed and code size.



  • New debugging features: The compiler now provides some new debugging features, such as --debug-verbose, --debug-symbols, --debug-line-info, etc., that allow you to generate more detailed debugging information for your code.



  • Bug fixes and stability improvements: The compiler now fixes some bugs and improves its stability and compatibility with various devices and tools.



To use the new features and improvements in HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112, you need to update your compiler installation and recompile your code with the appropriate options and flags.


Comparison with Other C Compilers for PIC10/12/16 MCUs




The HI-TECH C Compiler for PIC10/12/16 MCUs is not the only C compiler available for developing applications on PIC microcontrollers. There are other C compilers that offer similar or different features, performance, and compatibility. Some of them are:


MPLAB XC8 C Compiler: This is another C compiler from Microchip that supports all PIC10/12/16 microcontrollers. It is based on GCC (GNU Compiler Collection) and According to the web search results, the HI-TECH C Compiler for PIC10/12/16 MCUs is a deprecated compiler that has been replaced by the MPLAB XC8 C Compiler, which is based on GCC and supports all PIC microcontrollers. The MPLAB XC8 C Compiler offers more features, performance, and compatibility than the HI-TECH C Compiler for PIC10/12/16 MCUs. Some of the differences between the two compilers are:


  • License and cost: The HI-TECH C Compiler for PIC10/12/16 MCUs requires a paid license to use its full functionality and optimization. The MPLAB XC8 C Compiler offers a free version with limited optimization and a paid version with full optimization. The paid version also includes a 60-day evaluation mode that allows you to try the full optimization for free.



  • Syntax and extensions: The HI-TECH C Compiler for PIC10/12/16 MCUs uses a proprietary syntax and extensions that are not compatible with standard ANSI C or GCC. The MPLAB XC8 C Compiler uses a standard ANSI C syntax and extensions that are compatible with GCC. The MPLAB XC8 C Compiler also provides some additional extensions that are specific to PIC microcontrollers, such as __delay_ms, __eeprom_data, __interrupt, etc.



  • Optimization and code generation: The HI-TECH C Compiler for PIC10/12/16 MCUs uses Omniscient Code Generation (OCG) technology that analyzes the whole program at once and applies global optimizations. The MPLAB XC8 C Compiler uses GCC technology that analyzes each function separately and applies local optimizations. The MPLAB XC8 C Compiler also provides some additional optimization options and flags that allow you to fine-tune the trade-off between code speed and code size.



  • Debugging and testing: The HI-TECH C Compiler for PIC10/12/16 MCUs provides a built-in simulator and supports various hardware devices for debugging and testing. The MPLAB XC8 C Compiler also provides a built-in simulator and supports various hardware devices for debugging and testing. The MPLAB XC8 C Compiler also provides some additional debugging tools and features, such as data visualizer, trace buffer, watch variables, etc.



  • Support and updates: The HI-TECH C Compiler for PIC10/12/16 MCUs is no longer supported or updated by Microchip. The MPLAB XC8 C Compiler is fully supported and updated by Microchip, and it includes new device support, new library functions, bug fixes, stability improvements, etc.



Based on these differences, it seems that the MPLAB XC8 C Compiler is a better choice than the HI-TECH C Compiler for PIC10/12/16 MCUs in terms of features, performance, and compatibility. However, if you have an existing project that uses the HI-TECH C Compiler for PIC10/12/16 MCUs, you may need to make some changes to your code to make it compatible with the MPLAB XC8 C Compiler. You can find some guides and tips on how to port your code from HI-TECH C to XC8 on the Microchip website . You can also download the MPLAB XC8 C Compiler for free from the Microchip website and try it yourself.


Conclusion




In this article, we have reviewed the features, benefits, installation, usage, and comparison of the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112. We have learned that this compiler is a professional-grade ANSI C compiler that supports all Microchip PIC10/12/16 microcontrollers and uses Omniscient Code Generation technology to produce compact and efficient code. We have also learned that this compiler is deprecated by Microchip and has been replaced by the MPLAB XC8 C Compiler, which is based on GCC and offers more features, performance, and compatibility than the HI-TECH C Compiler for PIC10/12/16 MCUs.


Here are some tips and best practices for using the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112 effectively and efficiently:


  • Read the documentation carefully and understand the syntax, features, options, and settings of the compiler.



  • Use the OCG technology wisely and avoid manual optimization techniques that may interfere with the compiler's optimization.



  • Use the simulator or hardware devices to test and debug your code thoroughly before deploying it.



Keep Here are some more sections of the article:


FAQs




Here are some frequently asked questions and answers about the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112:


  • Q: How can I download the HI-TECH C Compiler for PIC10/12/16 MCUs version 9.83 112?



  • A: You can download the compiler from the Microchip website. You will need to register or log in to your Microchip account and provide your license key to access the download link.



  • Q: How can I update my HI-TECH C Compiler for PIC10/12/16 MCUs to the latest version?



  • A: You can update your compiler by running the installer file of the latest version and following the instructions on the screen. The installer will automatically detect your existing installation and update it accordingly.



Q: How can I get support and help for using the HI-TECH C Co


About

Welcome to the group! You can connect with other members, ge...

Members

  • Difference Planet
    Difference Planet
  • Георгий Доронин
    Георгий Доронин
  • Miisha Slavsky
    Miisha Slavsky
  • Kostia Dorin
    Kostia Dorin
bottom of page