Skip to content

Commit e7a41ea

Browse files
MPAE-12734 TMR1 configuration picture updated. Improve ormatting on data visualzer image and plot variable image.
1 parent 879e062 commit e7a41ea

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

.main-meta/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content": {
55
"metaDataVersion": "1.1.0",
66
"name": "com.microchip.mcu8.mplabx.project.pic18f57q43-analog-read-serial-write-mplab-mcc",
7-
"version": "1.0.0",
7+
"version": "1.0.1",
88
"displayName": "Analog Read Serial Write",
99
"projectName": "pic18f57q43-analog-read-serial-write-mplab-mcc",
1010
"shortDescription": "This code example uses the ADC module to do an analog read and display it using the Data Visualizer.",

PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/PIC18F57Q43-adcc-serial-mplab-mcc.mc3

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

PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/mcc_generated_files/timer/src/tmr1.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ void Timer1_Initialize(void)
8585
T1GATE = 0x0;
8686
//TMRCS MFINTOSC_31.25kHz;
8787
T1CLK = 0x6;
88-
//TMRH 255;
89-
TMR1H = 0xFF;
90-
//TMRL 255;
91-
TMR1L = 0xFF;
88+
//TMRH 194;
89+
TMR1H = 0xC2;
90+
//TMRL 247;
91+
TMR1L = 0xF7;
9292

9393
// Load the TMR1 value to reload variable
9494
timer1ReloadVal=(uint16_t)((TMR1H << 8) | TMR1L);

PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/nbproject/configurations.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@
254254
<property key="memories.programmemory.ranges" value="0-1ffff"/>
255255
<property key="memories.rww" value="true"/>
256256
<property key="poweroptions.powerenable" value="false"/>
257+
<property key="programmerToGoFilePath"
258+
value="C:/Users/c09087/Documents/pic18f57q43-analog-read-serial-write-mplab-mcc/PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/debug/free/PIC18F57Q43-analog-read-serial-write-mplab-mcc_ptg"/>
257259
<property key="programoptions.eraseb4program" value="true"/>
258260
<property key="programoptions.preservedataflash" value="false"/>
259261
<property key="programoptions.preservedataflash.ranges"
@@ -439,6 +441,8 @@
439441
<property key="memories.programmemory.ranges" value="0-1ffff"/>
440442
<property key="memories.rww" value="true"/>
441443
<property key="poweroptions.powerenable" value="false"/>
444+
<property key="programmerToGoFilePath"
445+
value="C:/Users/c09087/Documents/pic18f57q43-analog-read-serial-write-mplab-mcc/PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/debug/pro/PIC18F57Q43-analog-read-serial-write-mplab-mcc_ptg"/>
442446
<property key="programoptions.eraseb4program" value="true"/>
443447
<property key="programoptions.preservedataflash" value="false"/>
444448
<property key="programoptions.preservedataflash.ranges"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ In the *Device Resources* window scroll to find *ADCC* click the dropdown arrow
5252
The ADCC was used in this code example to periodically measure the analog channel RA0 (POT) which is connected to a 10kΩ potentiometer on the POT3 Click board. The ADCC was programmed to use Timer1 as an auto-conversion trigger in order to core-independently perform a conversion every 500ms. Additionally, the computation feature of the ADCC was utilized in this example to perform a burst average conversion core independently every time the ADC gets triggered. The ADCC was setup in such a way where it takes 32 consecutive conversions and accumulates the results whenever triggered, and then automatically divides the results by 32 by right shifting the accumulated value by 5 to provide the filtered average ADC result. The MPLAB Code Configurator (MCC) was used to setup the ADCC module for this code example as shown below.
5353

5454
![MCC - ADCC clock](images/adc_clock.png)
55+
5556
![MCC - ADCC computation](images/adc_computation.png)
5657

5758
## Timer 1 (TMR1) Module
@@ -108,6 +109,7 @@ After programming the device we would like to use the *Data Visualizer* to see t
108109
Configure the device with **9600** baud rate and connect to it.
109110

110111
If you have to install the *Data Visualizer* plugin click on Tools => Plugins => Available plugins. Select checkbox for MPLAB Data Visualizer click on Intall button. To start *Data Visualizer* click the button as shown below
112+
111113
![Data Visualizer - Baud and Connect](images/data_visualizer.png)
112114

113115
The plugin shows up in the kit window on it's own tab.
@@ -135,6 +137,7 @@ To be able to graph the measurement, click *Variable Streamers*. Select PIC18F57
135137
![Data Visualizer - Graph creation](images/plot_streaming_data_from_com.png)
136138

137139
*Plot variable*.
140+
138141
![Data Visualizer - Graph creation](images/plot_streaming_data_from_com1.png)
139142

140143
When you have done this, you would expect to get a similar output as the graph above.

images/tmr1_configuration.png

-2.05 KB
Loading

0 commit comments

Comments
 (0)