You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-23Lines changed: 24 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@
8
8
9
9
# MCC Melody ADC Data Streamer PWM Example - Callbacks Implementation (PIC18F57Q43)
10
10
11
-
This example builds on the [ADC Data Streamer PWM example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MCC.MELODY.EXAMPLES.RUNNING.ADCC.DATA.STREAMER&version=latest&redirect=true"Analog-to-Digital Conversion (ADC) Data Streamer example"), of the MCC Melody ADCC Example Component (Callback Implementation). Displays ADCC samples visualized with the Data Streamer. An ADC conversion is taken every 100 ms on the selected analog channel, also toggling a LED and Debug GPIO.
11
+
The [ADC Data Streamer PWM example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MCC.MELODY.EXAMPLES.RUNNING.ADCC.DATA.STREAMER&version=latest&redirect=true"Analog-to-Digital Conversion (ADC) Data Streamer example"), of the MCC Melody ADCC Example Component, is used in the Callbacks implementation and displays ADCC samples visualized with the Data Streamer. An Analog-to-Digital Conversion measurement is taken every 100 ms on the selected analog channel, also toggling an LED and Debug GPIO.
12
12
13
-
A PWM use-case from the [How to Use the PWMx_16BIT PLIB Driver](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=SCF-PIC8-PWM-V1&version=latest&redirect=true) section, from the MCC Melody API reference for PIC16F/18F. Specifically the **PIC PWM Use Case: Gradually Brightening LED**.
13
+
A PWM1_16BIT component is added to this example. For more information, check out the "PIC® PWM Use Case: Gradually Brightening LED" usecase from the [How to Use the PWMx_16BIT PLIB Driver](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=SCF-PIC8-PWM-V1&version=latest&redirect=true) section in *MCC Melody API reference for PIC16F/18F*. It shows how adjusting the potentiometer influences the brightness of the PWM, which is mapped to a % of the range of the ADC value.
14
14
15
15
So, as the pot meter is adjusted, the brightness of the PWM is adjusted, mapped to a % of the range of the ADC value.
16
16
@@ -52,7 +52,7 @@ The instructions required to recreate this example are listed below, under Confi
52
52
53
53

54
54
55
-
To these, the following additional steps are needed.
55
+
The following additional steps are required for this example.
56
56
57
57
**Note:** The timer period is changed to 0.02s, i.e., 20 ms.
58
58
@@ -67,46 +67,47 @@ The Pins configuration are shown below:
67
67
The image below shows the [ADCC Basic Printf example](https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MCC.MELODY.EXAMPLES.RUNNING.ADCC.PRINTF&version=latest&redirect=true
68
68
) running, using the MPLAB Data Visualizer.
69
69
70
+
After implementing the settings, similar results to the below image will be shown.
71
+
72
+

73
+
74
+
The image below shows the example running on the Curiosity Nano Explorer board.
75
+
76
+

77
+
78
+
## Data Visualizer Setup
79
+
70
80
1) Click the  icon to open the MPLAB Data Visualizer.
71
-
2) Under the *Variable Streamers* tab (on the left hand side), click the  button, to import a *.ds* file.
72
-
3) From your project root, navigate into *mmc_generated_files/data_streamer/* directory.
73
-
4) Click on the *data_streamer.ds* file to select it.
74
-
5) Then click the  button, to load the ds file.
81
+
2) Under the *Variable Streamers* tab (on the left hand side), click the  button to import a *.ds* file.
82
+
3) From your project root, navigate into `mmc_generated_files/data_streamer/` directory.
83
+
4) Click the `data_streamer.ds` file to select it.
84
+
5) Then click the  button, to load the `ds` file.
75
85
76
-

86
+

77
87
78
-
You should see a *data_streamer Properties* window, showing the *adcResult* and *adcSampleCount* variables loaded.
88
+
The data_streamer Properties window will open up, displaying the loaded adcResult and adcSampleCount variables.
79
89
80
90
1) Click the  button, to load this data streamer configuration.
2) Under Debug GPIO, click the  icon, to add to the time plot.
97
107
98
108

99
109
100
-
If all is correct, when changing the pot meter value, you should see similar results to the below image.
101
-
102
-

103
-
104
-
Below is a picture of the Curiosity Nano Explorer board, with the example running.
105
-
106
-

107
-
108
110
109
-
## Summary
110
111
For more example components, open the stand-alone Content Manager  in MCC.
0 commit comments