Video: Introducing MCC Melody Example Components (while building the Polled version of this example).
The TIMER Toggle LED example, of the MCC Melody Timer Example Component is used in the Callbacks implementation. The LED on the PIC18F57Q43 Curiosity Nano is toggled, as well as a Debug I/O, which can be used to verify the 100 ms period.
Example Components are tightly integrated learning material directly into MCC. This allows users to conveniently place configuration instructions side-by-side with the components they are configuring. For more information, refer to the MCC Melody Example Components Introduction.
Complete projects specific to a board and microcontroller are available in MPLAB® Discover or GitHub. However, the current project could be recreated on a range of supported microcontrollers by following the steps in the example component.
For more information on example components and differences between example and implementation, see MCC Melody Example Components - The Basics.
Example Components are related to MCC Melody Design Patterns for Control Flow, which shows different standard ways to organize main.c
and other application-level files, such as Polling, Interrupt and Callback, or State Machine Design Patterns. Users might be familiar with each of these patterns, but:
- What support does MCC Melody provide for each?
- What are the recommended ways of building on the MCC Melody generated code?
-
MPLAB® X IDE 6.20.0 or newer (MPLAB® X IDE 6.20)
-
MPLAB® XC8 2.46.0 or newer (MPLAB® XC8 2.46)
-
MCC Plug-in Version 5.5.1 or newer (Tools > Plugins > Installed, search: "MCC")
-
Timer Example Component 1.0.0 or newer
-
MCC Core 5.7.1 or newer
-
MCC Melody Core 2.7.1 or newer (Communicates with the MCC core, providing views and other functionality for MCC Melody)
- PIC18F57Q43 Curiosity Nano (DM164150)
- Curiosity Nano Explorer (EV58G97A) - Not used in this example, but used further in the series.
All instructions required to recreate this example are listed below under Configuration Instructions.
Once you have loaded the project in MPLAB X IDE, you will also be able to find more information from Tooltips and links next to the instructions .
The image below shows the TIMER Toggle LED example running. The period of 100 ms is verified using Debug GPIO on the MPLAB® Data Visualizer. A PIC18F57Q43 Curiosity Nano is used.
Note: Achieve the same functionality by adding the Timer Example component to a new or existing MCC Melody project, for one of the supported microcontrollers.
Two vertical cursors are added to verify the timer frequency. See the configuration instructions below.
- Click the icon to open the MPLAB Data Visualizer.
- Under Debug GPIO, click the icon, to add to the time plot.
- Click the icon a few times to zoom in on the Time Plot.
- Click the icon, a couple of times, to add two vertical cursors. Change the cursor positions by dragging them using the mouse to measure the timer period.
A logic analyzer can be used instead of Debug GPIO on the MPLAB® Data Visualizer.
For more example components, open the stand-alone Content Manager in MCC .