Skip to content

Commit cc9a71f

Browse files
committed
MPAE-18220 fixed review comments from MCU8_TEJ-1490
1 parent cd7c41f commit cc9a71f

File tree

6 files changed

+154
-29
lines changed

6 files changed

+154
-29
lines changed

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
# MCC Melody ADC Data Streamer PWM Example - Callbacks Implementation (PIC18F57Q43)
1010

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.
1212

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" 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 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.
1414

1515
So, as the pot meter is adjusted, the brightness of the PWM is adjusted, mapped to a % of the range of the ADC value.
1616

@@ -52,7 +52,7 @@ The instructions required to recreate this example are listed below, under Confi
5252

5353
![ADCC Data Streamer, Callbacks implementation](images/ADCC_DataStreamer_Callbacks-ConfigComplete.png)
5454

55-
To these, the following additional steps are needed.
55+
The following additional steps are required for this example.
5656

5757
**Note:** The timer period is changed to 0.02s, i.e., 20 ms.
5858

@@ -67,46 +67,47 @@ The Pins configuration are shown below:
6767
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
6868
) running, using the MPLAB Data Visualizer.
6969

70+
After implementing the settings, similar results to the below image will be shown.
71+
72+
![Running the ADCC Basic Printf Example](images/Running_the_ADCC_Data_Streamer_Example.png)
73+
74+
The image below shows the example running on the Curiosity Nano Explorer board.
75+
76+
![Running the ADCC Basic Printf Example with PWM on the Curiosity Nano Explorer](images/ADCC_DataStreamer_PWM_Running_Explorer.png)
77+
78+
## Data Visualizer Setup
79+
7080
1) Click the ![Data Visualizer icon](images/Icon-MPLAB-DataVisualizer_1cm.png) icon to open the MPLAB Data Visualizer.
71-
2) Under the *Variable Streamers* tab (on the left hand side), click the ![Import ds file](images/button-import-ds-file.png "Import DS file.") 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 ![open button](images/button-open.png) button, to load the ds file.
81+
2) Under the *Variable Streamers* tab (on the left hand side), click the ![Import ds file](images/button-import-ds-file.png "Import DS file.") 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 ![open button](images/button-open.png) button, to load the `ds` file.
7585

76-
![Loading the ds file](images/Running the ADCC Data Streamer Example)
86+
![Loading the ds file](images/RunningDataStreamerEx-Open_ds_file_12cm.png)
7787

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.
7989

8090
1) Click the ![save button](images/button-save.png) button, to load this data streamer configuration.
8191

8292
![ds file loaded](images/ds_file_loaded_1_12cm.png)
8393

84-
1) Click on the ![no source button](images/button-no-source.png) button.
94+
1) Click the ![no source button](images/button-no-source.png) button.
8595
2) Select your board from those available.
8696

87-
**Note:** If your board is not recognised by the MPLAB Data Visualizer, got to the Device Manager (Windows), to determine the COMx number.
97+
**Note:** If your board is not recognised by the MPLAB Data Visualizer, go to the Device Manager (Windows) to determine the COMx number.
8898

89-
3) Click on the ![settings gear icon](images/Icon-DataVisualizer-SettingsGear.png) icon, to bring up the COMx Settings.
99+
3) Click the ![settings gear icon](images/Icon-DataVisualizer-SettingsGear.png) icon to bring up the COMx Settings.
90100
4) Set the baud rate to 115200, then click out of the window to close the settings.
91-
5) Click the ![Time Plot icon](images/Icon-DataVisualizer_TimePlot.png) icon, to plot all variables.
101+
5) Click the ![Time Plot icon](images/Icon-DataVisualizer_TimePlot.png) icon to plot all variables.
92102

93103
![Data Streamer Config](images/DataStreamerConfig_25cm.png)
94104

95-
1) Click on the *Connections* button.
105+
1) Click the **Connections** button.
96106
2) Under Debug GPIO, click the ![Add to time plot icon](images/Icon-DataVisualizer_TimePlot.png "Display as raw data on time plot.") icon, to add to the time plot.
97107

98108
![Debug I/O Time Plot](images/DebugIO_TimePlot_8cm.png)
99109

100-
If all is correct, when changing the pot meter value, you should see similar results to the below image.
101-
102-
![Running the ADCC Basic Printf Example](images/Running_the_ADCC_Data_Streamer_Example.png)
103-
104-
Below is a picture of the Curiosity Nano Explorer board, with the example running.
105-
106-
![Running the ADCC Basic Printf Example with PWM on the Curiosity Nano Explorer](images/ADCC_DataStreamer_PWM_Running_Explorer.png)
107-
108110

109-
## Summary
110111
For more example components, open the stand-alone Content Manager ![CM_icon](images/Icon-MPLAB-CM24.png) in MCC.
111112

112113
![Standalone_CM](images/MCC_ContentManager_Examples_18cm.png)

pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/mcc-manifest-autosave.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
manifest_file_version: 1.0.0
44
project: pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc
5-
creation_date: 2024-08-08T08:12:04.017+02:00[Europe/Paris]
5+
creation_date: 2024-09-05T15:15:03.287+02:00[Europe/Paris]
66
operating_system: Windows 10
77
mcc_mode: IDE
88
mcc_mode_version: v6.20
99
device_name: PIC18F57Q43
1010
compiler: XC8 2.46
1111
mcc_version: 5.5.1
1212
mcc_core_version: 5.7.1
13-
content_manager_version: 5.0.1-e
13+
content_manager_version: 5.0.1
1414
is_mcc_offline: false
1515
is_using_prerelease_versions: false
1616
mcc_content_registries: https://registry.npmjs.org/

pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/mcc-manifest-generated-success.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
manifest_file_version: 1.0.0
44
project: pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc
5-
creation_date: 2024-08-08T08:05:43.059+02:00[Europe/Paris]
5+
creation_date: 2024-09-05T15:15:03.261+02:00[Europe/Paris]
66
operating_system: Windows 10
77
mcc_mode: IDE
88
mcc_mode_version: v6.20
99
device_name: PIC18F57Q43
1010
compiler: XC8 2.46
1111
mcc_version: 5.5.1
1212
mcc_core_version: 5.7.1
13-
content_manager_version: 5.0.1-e
13+
content_manager_version: 5.0.1
1414
is_mcc_offline: false
1515
is_using_prerelease_versions: false
1616
mcc_content_registries: https://registry.npmjs.org/

pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/nbproject/configurations.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@
260260
<property key="memories.programmemory" value="true"/>
261261
<property key="memories.programmemory.ranges" value="0-1ffff"/>
262262
<property key="poweroptions.powerenable" value="false"/>
263+
<property key="programmerToGoFilePath"
264+
value="C:/GitHub/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/debug/free/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc_ptg"/>
263265
<property key="programoptions.eraseb4program" value="true"/>
264266
<property key="programoptions.preservedataflash" value="false"/>
265267
<property key="programoptions.preservedataflash.ranges"
@@ -507,6 +509,8 @@
507509
<property key="memories.programmemory" value="true"/>
508510
<property key="memories.programmemory.ranges" value="0-1ffff"/>
509511
<property key="poweroptions.powerenable" value="false"/>
512+
<property key="programmerToGoFilePath"
513+
value="C:/GitHub/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/debug/pro/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc_ptg"/>
510514
<property key="programoptions.eraseb4program" value="true"/>
511515
<property key="programoptions.preservedataflash" value="false"/>
512516
<property key="programoptions.preservedataflash.ranges"

pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.X/pic18f57q43-adcc-data-streamer-pwm-callbacks-mcc.mc3

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)