Using C language for PIC microcontroller (I)
Using HitechC compiler in MPLAB-IDE 1. Load the compiler:
1. Start MPLAB-IDE and select Project-》Install Language Tool as shown below
2. In the pop-up Install Language Tool dialog box, the "Language Suite" option now shows Microchip. Click the arrow behind it to select the language.
The tool I use is HI-TECH PICCME, so I choose "HI-TECH PICC".
3. Next, select the calling path of the compiler component in "Tool Name". There are three items, "PICC Compiler" (C compiler), "PICC Assembler" (assembler) and "PICC Linker" (linker) that need to be set.
Use "Browse" to select the calling path, and set the calling files of the above three components to PICC.EXE. Click "OK" to complete the setting.
2. Choose a compiler:
1. Create a new project. The default "Language Tool Suite" column in the Edit Project dialog box is "Microchip". Change it to "HI-TECH PICC".
2. Click "flasha[.hex]" in the project file box, and the "Node Properties" button will light up. Click to enter.
3. Set node properties. Since FLASHA.C has other related source programs that need to be added, "PICC Linker" should be selected in the "Language Tool" column.
Usually we can choose:
1) Generate debug info: Display debug information;
2) Create map file: After selecting this option, we will see the usage of ROM and RAM;
3) Error file: displays error information;
4) Compile for MPLAB ICD: If you do not use ICD, you do not need to select this item.
4. After the settings are completed, click "Add Node" to add a node.
This project has two nodes: fla.c and flasha.c. After selecting the node, click "Node Properties" or double-click the node to enter the node property settings.
5. The tool for the node file should be "PICC Compiler" (C compiler). The 4 items in the blue circle are: 1) Display debug information; 2) Local optimization; 3) Global optimization; 4) ICD compilation accessories. Selecting optimization will make the program code more reasonable and reduce the resource usage. Similarly, if you are not using ICD, the 4th item should not be selected.
6. After all the above settings are completed, you can compile. The figure below is the compilation interface.
The following is the interface of successful compilation: the blue box is the compilation success information; the red box is the resource usage display.
Previous article:PIC microcontroller boot loader design
Next article:How to use the RC oscillator built into the PIC as the system clock source?
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- CC2530 ADC collects external voltage
- Op amp PCB layout requirements???
- Can DMA1 and DMA2 of stm32f4 transfer data simultaneously?
- WIFI(RTL8188EUS) Guide
- TPS54331 DCDC ripple interferes with radio
- TI eSMO library Fsmopos and Gsmopos parameter analysis
- Variable initialization problem in single chip microcomputer programming
- EEWORLD University Hall----Live Replay: TI reduces radiation by integrating isolated data and power ICs
- Simple transplantation of printf function of msp430
- Performance advantages of silicon carbide devices in switching power converters