PICSingle Chip Microcomputer System Architecture:
The system architecture is shown in. There are two main modules: PC and Data Collection System Development Board. The two modules are connected through two main lines: one is that the PC is connected to the system development board through pickit 3; the other is that the PC and the system development board are connected through a USB connection line to achieve USB communication.
Mplab ide
For PIC single-chip microcomputer, microchip provides a free mplab integrated development environment,Mplab integrated development environment supports both assembly and C language. In addition, hi-tech, CCS, IAR, bytecraft, and other third-party C compilers are also supported.
Mplab IDE is a software running on a PC. It is used to develop applications for the microchip microcontroller.Program. Because it provides a single integrated environment for Embedded Single-Chip Microcomputer Development ProgramsCodeTherefore, it is called an integrated development environment or IDE. The installation package can be downloaded from the Microstar website (www.mirochip.com), and the latest version 8.66 is selected in this design. Maplab contains all the components used to design and deploy embedded system applications. It manages all work by project. The built-in components include project manager, editor, assembler/connector, language tool, and debugger.
A complete mplab ide project development mainly includes writingSource codeCreate a project, compile a project, run the simulator, debug the application, set the configuration bit, and run the chip.
1) when creating a project, you can directly use the Project Wizard and select project> Project Wizard to start the project wizard. The welcome screen is displayed. Click Next to continue.
2) Select the corresponding PIC microcontroller from the device drop-down list. Click Next.
3) determine 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 go to the next step.
4) enter the project name and click the Browse button to put the project in the folder. Click Next.
5) If a prompt box appears, you must add the existing source file to the project and add the required source file and header file. If you do not need it, select continue next.
6) The Project Wizard summary dialog box is displayed. Check the information in the final dialog box to verify that the project has been created correctly. Click OK to complete project creation.
7) Use File/New to create the source code and save it to the folder where the project is located. Right-click the project list and choose add source file and header file.
8) select project> build all for project compilation. If the file is successfully assembled, "Build succeessed" will appear in the output window ". If the program fails, modify the source program and continue compiling. For a project, you can choose to run the simulator and debug the application to check and modify the source file.
9) configure the bit. Choose Configure> Configuration bits to set the configuration bit. If some devices or programs have special requirements on the configuration bit, you must directly set the configuration bit in the source program.
10) use the writer supported by mplab. Run Configure/select device and select the target chip to be written. For example, if pic18f4550 is selected, the pickit supported by maplab is displayed.3. Run the "burn" command on it (Green indicates support, and red indicates not support for the time being ).
11) when writing a chip, connect the PIC microcontroller to the computer by using a burning tool. In programmer> select programmer, select the programmer to be used. If the connection is correct, mplab will automatically connect to the burning tool and prompt that the connection is successful.
12) Click programmer> program to burn the information currently loaded in the mplab ide To the chip. The status bar displays the burning process. Select the output window under the "programmer" tab to display the burning result, for example, for pickit3:
Programming ......
Programming/successful!
After writing the chip, mplab ide will automatically verify it. Click programmer> verify to verify whether the chip is correctly burned.
Pickit3
Pickit3 is a Programmer/debugger supported by mplab IDE (v8.20 or later) software. It is easy to operate and has a low cost, allowing you to easily download programs and perform online debugging.
Pickit3 is an enhanced online serial programming microchip PIC microcontroller (MCU) based on in-circuit serial programming (icsp) and dual-line serial interfaces) and dspic digital signal controller (DSC ). 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.
Because the debugger system uses a device with a built-in Simulation Circuit for simulation, the code execution method is similar to that of the actual device. Users can access all available features of a given device interactively and set and modify these features through the mplab ide interface. The pickit 3 debugger is developed to simulate embedded processors with debugging functions.
Functions of pickit 3 include:
1) full-speed USB support using the Windows standard driver;
2) Real-time execution;
3) The processor runs at the maximum speed;
4) built-in overvoltage/short circuit monitor;
5) low voltage less than or equal to 5 V (range: 1.8-5 V );
6) diagnose LEDs (power supply, activity, and status );
7) program memory and data storage that can read and write single-chip microcomputer;
8) All memory types (EEPROM, ID, configuration, and programs) can be erased with the verification function;
9) Freeze peripherals at breakpoints.
Status led indicates the working status of pickit 3, which is:
1) power supply (green) -- pickit 3 has passedPower on the USB port.
2) activity (blue) -- pickit 3 is connectedThe 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) -- pickit 3 encountered an error.
Pickit3. For the icsp interface pins, Pin 1 is, pin 2 is connected to the VDD of the target device, Pin 3 is connected to the local VSS of the target board, and pin 4 is the programming data line, the programming clock line is provided on the 5th, and the 6th pin can be left blank. In addition, pickit 3 can provide working power for the PIC microcontroller through pins 2 and 3, but must be in Programmer/setting... /Power.
The online debugging functions supported by pickit 3 for PIC Single-Chip Microcomputer include resetting applications, running and pausing, single-step execution, continuous single-step execution, full-speed simulation, hardware breakpoint, and peripheral freezing.