PIC Development Tools Detailed Description
PIC microcontroller system architecture:
The system architecture is shown in the figure above. There are two main modules: PC and data acquisition system development board. These two modules are connected by two main lines: one is the connection between PC and system development board through PICkit™ 3; the other is the connection between PC and system development board through USB cable to realize USB communication.
Mplab IDE
For PIC microcontrollers, Microchip provides the free Mplab integrated development environment, which supports both assembly and C languages. In addition, Hi-tech, CCS, IAR, Bytecraft, etc. also provide third-party C compiler support.
MPLAB IDE is a software that runs on a PC and is used to develop applications for Microchip microcontrollers. Because it provides a single integrated environment to develop program code for embedded microcontrollers, it is called an integrated development environment or IDE. The installation package can be downloaded from the MSI website (www.mirochip.com). In this design, the latest version 8.66 is selected. Maplab includes all components for designing and deploying embedded system applications. All work is mainly managed by projects. The built-in components mainly include project managers, editors, assemblers/connectors, language tools, debuggers, etc.
A complete Mplab IDE project development mainly includes seven steps: writing source code, creating projects, compiling projects, running simulators, debugging applications, setting configuration bits, and burning chips.
1) During the project creation process, you can directly use the project wizard. Select Project>Project Wizard to start the project wizard. When the welcome screen appears, click the Next button to continue.
2) Select the corresponding PIC microcontroller in the Device drop-down list. Click Next.
3) Confirm the Microchip toolkit and its path. If the path is incorrect or blank, click the Browse button to specify the installation location of the toolkit. Select the Next button to proceed to the next step.
4) Enter the name of the project, then click the Browse button to place the project in a folder. Click the Next button.
5) A prompt box appears asking you to add existing source files to the project. Add the required source files and header files, etc. If not required, select Continue to the next step.
6) The Summary dialog box of the Project Wizard is displayed. Review the information in this final dialog box to verify that the project has been created correctly. Click OK to complete the project creation.
7) Create source code through File/New and save it to the folder where the project is located. Right-click in the project list and choose to add corresponding source files and header files, etc.
8) Select Project>Build All to compile the project. If the file is successfully compiled, "BUILD SUCCEESSED" will appear in the output window. If it is not successful, return to modify the source program and continue compiling. For the project, you can choose to run the simulator and debug the application to check and modify the source file.
9) Set the configuration bits accordingly. To set the configuration bits, select Configure>Configuration Bits. If some devices or programs have special requirements for configuration bits, you must set the configuration bits directly in the source program.
10) Use a programmer supported by Mplab. Run Configure/select Device and select the target chip to be programmed. For example, if you select PIC18F4550 here, you can see that Maplab supports programming with PICkit™ 3 (green means supported, red means not supported yet).
11) Before programming the chip, connect the PIC microcontroller to the computer through the programming tool, and select the programmer to be used in Programmer> Select Programmer. If the connection is correct, Mplab will automatically connect to the programming tool and prompt that the connection is successful.
12) Click Programmer>Program to program the information currently loaded in MPLAB IDE into the chip. The status bar will display the progress of the program. Select the Output window under the "programmer" tab to display the results of the program. For example, for PICkit™ 3:
Programming……
Programming/ Successful!
After programming the chip, MPLAB IDE will automatically verify it. Click Programmer>Verify to verify whether the chip is programmed correctly.
PICkit™3
PICkit™3 is a programmer/debugger supported by MPLAB IDE (v8.20 or higher) software. It is easy to operate, low cost, and can easily download, burn and debug programs online.
PICkit™3 is an enhanced in-circuit serial programming system based on In-Circuit Serial Programming™ (ICSP™) with a two-wire serial interface for Microchip PIC® microcontrollers (MCUs) and dsPIC® digital signal controllers (DSCs). In addition to the debugger function, the PICkit 3 programmer/debugger system can also be used as a development programmer, supporting the entire development process from software development to hardware integration.
Since the debugger system uses a device with built-in emulation circuitry for emulation, the code is executed in a manner similar to that of an actual device. The user can interactively access all available features of a given device and can set and modify these features through the MPLAB IDE interface. The PICkit 3 debugger was developed for emulating embedded processors with debugging capabilities.
PICkit 3 features include:
1) Full-speed USB support using Windows standard drivers;
2) Real-time execution;
3) The processor runs at maximum speed;
4) Built-in overvoltage/short-circuit monitor;
5) Low voltage less than or equal to 5V (range 1.8-5V);
6) Diagnostic LEDs (power, activity and status);
7) Can read and write the program memory and data memory of the microcontroller;
8) All memory types (EEPROM, ID, configuration and program) can be erased with verification function;
9) Freeze peripherals at breakpoints.
The Status LED indicates the operating status of the PICkit 3 as follows:
1) Power (Green) – The PICkit 3 is powered via the USB port.
2) Active (Blue) – The PICkit 3 is connected to the PC USB port and the communication link is active.
3) Status: Busy (yellow) – PICkit 3 is busy processing a function, such as programming;
ERROR (RED) – The PICkit 3 has encountered an error.
The pins of the ICSP interface of PICkit™ 3 are shown in the figure. Pin 1 is connected to the VDD of the target device, pin 2 is connected to the ground VSS of the target board, pin 4 is the programming data line, pin 5 provides the programming clock line, and pin 6 can be left floating. In addition, PICkit™ 3 can provide working power for the PIC microcontroller through pins 2 and 3, but it must be set in Programmer/setting…/power.
The online debugging functions supported by PICkit 3 for PIC microcontrollers include: resetting application programs, running and pausing, single-stepping, continuous single-stepping, full-speed simulation, hardware breakpoints, peripheral freezing, etc.
Previous article:PIC16F877A Watchdog Timer (WDT)
Next article:PIC33 MCU interrupt service function writing method (other MCUs are also applicable)
Recommended ReadingLatest update time:2024-11-16 11:53
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Thank you + family and friends And EEWORLD
- Why is 5G millimeter wave so difficult?
- [GD32L233C-START Review] 1. Unboxing
- Summary of the best posts on embedded systems (2019)
- National Undergraduate Electronic Design Competition Module Design Series (I)
- What do you do when you are tired from working in the office?
- EEWORLD University Hall----Autonomous Mobile Robot Northwestern Polytechnical University
- What is the function of the resistor connected in parallel between the primary input and secondary output of the transformer?
- EEWORLD University Hall----Push-up auxiliary training device based on SensorTile (2)
- 5G is coming, and Qorvo is waiting