- Preface
The hardware and software materials have been prepared. Now we can start to experience the development. This time we will use the official peripheral demo code to run it.
- Preparation
In addition to the hardware development board, you need to download csp_apps_pic32cxbz2_wbz45 in csp in mcc, which contains demo codes of various peripherals at the board level. In fact, this has been completed in the environment setup of the previous experience. If it is not done, or the component is not installed, you can install it again through MCC.
It contains examples of various peripherals.
- Experience
Open MPLAB X and use File->Open Project.. to find the gpio_led_on_off_polling project in csp_apps_pic32cxbz2_wbz45 in the Harmony installation folder.
After opening, the upper left side of the interface is resource management, the lower left side is chip/device/board, storage usage, compilation tool chain, debugging tools, debugging tools, debugging information and other related content, and the right side is the code editing window and software output.
The program code is relatively simple, with a main function. After initialization, it loops and waits for the button to be pressed and released, and controls the on and off of RGB, etc. when the button is pressed and released.
Compile the code through Production->Compile or the shortcut key F11
After completion, the output status is "Compilation succeeded"
Click the green right arrow in the picture below to download and run
If you use it for the first time, you may see the following tooltips, just select the corresponding one (the one at the bottom)
If the erasing and burning is successful, there will be a prompt: Programming/Verify complete
When the button is not pressed, RGB is not off
When the button is pressed, the RGB lights up
Click the button below to enter the debugging state
At this point, you can use the following buttons on the toolbar to pause, run at full speed, but not run and other debugging operations.
You can also set breakpoints
3. Summary
It seems that the debugging function is quite comprehensive and convenient.