Hi tech c compiler for pic10 12 16 что это
Как уже говорилось в прошлой статье, сам по себе MPLAB язык Си не понимает. Чтобы ему добавить такую полезную возможность, надо установить к нему отдельный компилятор Си. Практически единственным вариантом является компилятор фирмы HI-TECH Software LLC, инсталятор которого Вы можете найти в файлах к этой статье. Весит он около 5 МБ. Компилятор этот DEMO версии и имеет некоторые ограничения по обьему компилируемого кода. Но нам для наших нужд его возможностей вполне хватит.
На момент написания этой статьи, другой бесплатной альтернативы Си компилятора для PIC кроме как HI-TECH не было. Сейчас этот вариант актуальность потерял, поскольку Microchip свободно стала распространять бесплатную версию своего собственного Си компилятора.
Как уже говорилось в прошлой статье, сам по себе MPLAB язык Си не понимает. Чтобы ему добавить такую полезную возможность, надо установить к нему отдельный компилятор Си. Практически единственным вариантом является компилятор фирмы HI-TECH Software LLC, инсталятор которого Вы можете найти в файлах к этой статье. Весит он около 5 МБ. Компилятор этот DEMO версии и имеет некоторые ограничения по обьему компилируемого кода. Но нам для наших нужд его возможностей вполне хватит.
Итак, запускаем picclite-setup.exe. Появляется такое окно. Нажимаем кнопку Next.
Соглашаемся с лицензионным соглашением. Нажимаем Next.
Здесь надо обязательно поставить галочку напротив пункта «Integrate PICC-LITE with Microchip MPLAB», если она там не стояла. Нажимаем кнопку Next.
В этом окне ни чего не трогам и нажимаем Next.
Начнется процесс установки и копирования файлов.
На этом процесс установки закончится. Все, теперь у нас есть рабочая среда в необходимом составе.
HI-TECH C51-lite — что это за программа? (HI-TECH C Compiler)
Приветствую. HI-TECH C — компилятор языка C стандарта ANSI, другими словами — из мира программирования.
Соответственно программы HI-TECH C51-lite и HI-TECH C Compiler — из той же оперы, если вы их не устанавливали, видимо установились автоматически при инсталляции какой-то программы. Спросите зачем? Установились как вспомогательные компоненты.
Разбираемся
Данный софт устанавливается в эту папку:
C:\Program Files\HI-TECH Software\
Установочное окно Installing HI-TECH C Compiler for the PIC10/12/16 MCUs:
Судя по информации, отображенной в нижней части — ПО платное. Самая нижняя опция в окне Operate in Lite mode (reduced performance) — возможно позволяет работать в бесплатном, облегченном режиме со сниженной производительностью (такие ограничения).
Что интересно — информации мало об этой программе, разве что понятно — компилятор. Но как она попала на ПК, для чего она нужна и вообще откуда она взялась у обычных пользователей — неизвестно.
HI-TECH C Compiler вроде бы вообще идет для Линукса.
Некоторые мои мысли
- Как я уже писал — если вы эти проги не ставили, они могли установиться автоматически при установке другой проги. Например Офис часто ставит еще сторонние нужные ему компоненты
- HI-TECH C Compiler — вообще вроде версия для Линукса. Если она у вас стоит на Виндовс — подозрительно. Стоит проверить ПК на вирусы, ниже напишу какими.
- Если вы думаете что вам данная программа все таки не нужна — в качестве эксперимента можно удалить. Но перед этим — создайте точку восстановления.
Перед удалением — создайте точку восстановления
Мини-инструкция как создать:
- Открываете панель управления, находите значок Система, запускаете его.
- Далее выбираете Защита системы. Нажимаете создать, называете точку, например До удаления непонятных программ.
HI-TECH C51-lite/HI-TECH C Compiler — как удалить?
После создания точки можно пробовать удалить. И главное — при возникновении проблем вы всегда сможете вернуться обратно.
Blog Entry
Introduction to the Microchip PIC C Programming
December 18, 2008 by rwb, under Microcontroller.
The PIC microcontroller is quite popular in industrial and hobbyist, some of the newest 8-bit midrange Microchip PIC microcontroller with nanoWatt technology is PIC16F690, this 20 pin microcontroller has a build in peripherals such as ADC, UART, PWM, I2C, analog comparator and with 7KBytes program memory flash; for those who’s come from the AVR background this is a good change to gain the knowledge as we know is hard to find the comparable 20 pin 8-bit AVR microcontroller product which has the same feature as Microchip PIC16F690; and for those who are the first time learner welcome to the PIC microcontroller world.
1. Which tools should I use
To start C programming language on Microchip PIC Microcontroller you need these following tools:
- Down load the latest Microchip MPLAB IDE which provide you with the complete IDE (integrated development environment) for managing project, program editing, compiling, debugging and downloader for all Microchip PIC Microcontroller series.
The MPLAB IDE is already come with the HITECH PICC-Lite C compiler and fully integrated with MPLAB IDE. - The PIC16F690 datasheet, is one of the most important document if you want to learn this type of microcontroller
- Microchip PICKit2 Programmer.
- PICJazz 16F690 board from ermicro (for circuit schema click here)
After downloading, install the Microchip MPLAB IDE and just follow all the default setting.
2. My first PIC C Programming
To create your first PIC project go to Start -> All Programs -> Microchip -> MPLAB IDE ver 8.00 -> MPLAB IDE (I am using version 8.00 on this tutorial), this will launch the MPLAB IDE application screen then start the project wizard by selecting the menu Project -> Project Wizard… from MPLAB IDE and this will launch the project wizard, just continue with Next button and it will show the project wizard step one form as follow:
Choose the PIC16F690 device then click Next button:
On step two we choose the HI-TECH C Compiler and click Next button
Step three create your project file which is myfirstc in this tutorial then click Next button; on step four just click Next button because this is you first program there is no existing file to be added then press Finish button on the last screen; this will bring you to the MPLAB IDE blank environment as follow:
From MPLAB IDE create new program file by selecting menu File -> New and save it as myfirstc.c using menu File -> Save As. Again from MPLAP IDE menu select View than activate the Project, Output and the Watch screen. On the project screen right click on the Source Files and chose Add Files…; add myfirst.c file into the project as shown on this following picture:
Now you are ready to start your first PIC C program, just copy and paste this following code:
3. The PIC microcontroller C Code
One of the interesting part in Microchip PIC microcontroller feature is the configuration bit, this bit can be set when we power on the microcontroller and put it in our program; unlike AVR microcontroller which known as fuse bit and lock bit; this bits has to be set first before we can use the microcontroller. You could include this setting on your code or instruct the MPLAB IDE to include this setting for you by using menu Configure -> Configuration Bits as follow:
Uncheck the Configuration Bits set in code option and this setting will overwrite any configuration bit you set in your code. For this tutorial I am using this configuration bit statement (remember using CONFIG with double underscore):
Now let’s take a look in the main() code area; the first statement is to choose the 8 Mhz internal clock, the default value is 4 Mhz and by setting the oscillator control register (OSCCON – special function register in the PIC16F690 microcontroller) to hex value 0x70 we choose the 8 Mhz internal clock (maximum) as follow:
The TRISC is a three state bidirectional buffer control register for PORTC, by clearing all the bit (set to logical 0), we instruct the PIC microcontroller to use the PORTC as output port (by setting to logical 1 mean we use for input port).
The ANSEL and ANSELH are the analog select registers; by default all the analog port in PIC16F690 are set to analog input not for digital I/O, therefore by clearing all bits (set to logical 0) in these special function registers we instruct the PIC microcontroller to use all the available analog input as a digital I/O port. This is one of important preparation before we use the PIC port for digital I/O:
Inside the empty for statement (never ending loop) I just assign the PORTC so the LED attached to RC0 on the PICJazz 16F690 board will on and off and put the delay 200 ms function between them, so we could see the process physically:
The NOP() instruction is just the no operation instruction for PIC microcontroller, this function is used for setting the break point in the MPLAB IDE simulation before we download the code to the PICJazz 16F690 board. You can always use this NOP() function as many as you like to set the break point as this instruction will not effecting your code and removing it later.
4. Simulating your code
Debugging your code before burning it to the microcontroller is the essential part in developing embedded system; using the sophisticated Microchip MPLAB IDE simulation will give you a deep walk through to your code and watch how the PIC microcontroller responding to your code. The good part is; you don’t have to use any physical microcontroller to use this simulation tool, just your computer and of course the Microchip MPLAB IDE. Ok let’s start setting the environment before we start the simulation.
From MPLAB IDE menu select Debugger -> Select Tool -> MPLAB Sim; then again from menu select Debugger -> Setting…; this will bring you to the simulator setting form:
Set the Processor Frequency to 8 Mhz and leave the other setting to it’s default. Now on the Watch window add the special function registers to be observed e.g. OSCCON, TRISC, ANSEL, ANSELH and PORTC by selecting the register in the selection list and click the Add SFR button as follow (to remove it, right click on the highlighted register and choose delete):
You could also watch all the special function register by activating the special function register window, from menu select View -> special function registers.
Now set the break point by putting the cursor on the first NOP() function and right click -> Set Break Point, the break point sign will appear on your editor screen and do the same thing on the second NOP() function. Now you are ready to compile your code, from menu select Project -> Build or press F10:
If everything’s smooth you will get no error message (if not check and recheck your code) and now you are ready to run the Microchip MPLAB ID simulation; from menu select Debugger -> Run or press F9:
You can look on your watch windows the PIC16F690 registers change by continuing press the F9 key. To reset the program, from menu select Debugger -> Reset -> Processor Reset or press the F6 key.
5. Downloading your code
The final step is to put your code in a real PIC16F690 microcontroller, connect the PICkit2 programmer to the USB port and the programmer ICSP port to the PICJazz 16F690 board ICSP port; turn the PICJazz 16F690 power. From the MPLAB IDE menu select Programmer -> Select Programmer -> Pickit2 it will automatically configure the connection and display it on the PICkit2 tab Output windows:
Now you are ready to down load the code from MPLAB IDE menu select Programmer -> Program; this will down load the HEX code into the PICJazz 16F690 board:
HI-TECH C COMPILER FOR PIC10/12/16 MCUS (PRO)
This compiler has been discontinued and is no longer supported. This compiler has been replaced by the MPLAB® XC8 PRO (SW006021-2).
HI-TECH C Compiler for PIC10/12/16 MCUs — PRO fully implements the optimizations of Omniscient Code Generation™ — a whole-program compilation technology — to provide denser code and better performance on PIC MCUs. This ANSI C compiler integrates into Microchips MPLAB(R) IDE and is compatible with Microchip debuggers and emulators.