Skip to content

Commit dec0c30

Browse files
author
Ethan Layton
committed
MPAE-19239: TechWriter ReadMe changes
1 parent efaa2f3 commit dec0c30

File tree

1 file changed

+57
-45
lines changed

1 file changed

+57
-45
lines changed

README.md

+57-45
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
In this example, the ADCC will be configured to sample the Temperature Indicator Module in order to measure the device temperature of a PIC18F16Q41 microcontroller.
66
## Related Documentation
77

8-
* [PIC18F16Q41 Datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf)
8+
* [PIC18F16Q41 Data sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf)
99

1010
* [PIC18F16Q41 Device Page](https://www.microchip.com/wwwproducts/en/PIC18F16Q41?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
1111

1212
* [PIC18F16Q41 Curiosity Nano Users Guide](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F16Q41-Curiosity-Nano-Hardware-User-Guide-DS50003048A.pdf)
1313

1414
## Software Used
1515

16-
- MPLAB® X IDE v6.20.0 or newer [(MPLAB X IDE 5.45)](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
17-
- MPLAB XC8 v3.0.0 or newer compiler [(MPLAB XC8 v3.0.0)](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-xc-compilers?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
18-
* [MPLAB Code Configurator (MCC)](https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-code-configurator?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
19-
* Melody Library v5.1.4 or newer
20-
* [MPLAB Data Visualizer Plugin](https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-data-visualizer?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github) or other serial terminal
16+
17+
18+
- [MPLAB® X IDE v6.20.0 or newer](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
19+
- [MPLAB XC8 v3.0.0 or newer compiler](https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-xc-compilers?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
20+
- [MPLAB Code Configurator (MCC)](https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-code-configurator?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github)
21+
- Melody Library v5.1.4 or newer
22+
- [MPLAB Data Visualizer Plugin](https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-data-visualizer?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_MMTCha_pic18q41&utm_content=pic18f16q41-adcc-temp-sensor-mplab-mcc-github) or other serial terminal
23+
2124

2225

2326
## Hardware Used
@@ -28,15 +31,15 @@ In this example, the ADCC will be configured to sample the Temperature Indicator
2831

2932
**Step #1: Creating the Project**
3033

31-
+ On the tool bar, click on New Project
34+
+ On the tool bar, click New Project
3235
+ Microchip Embedded; Standalone Project
3336
+ Enter the Device
3437
+ For this Project: PIC18F16Q41
3538
+ Enter a name for this project, such as *adcc-temp-sensor*
3639
+ Name: “adcc-temp-sensor”
37-
+ **Note: The project name cannot have any empty spaces**
40+
+ **Note**: The project name cannot have any empty spaces
3841

39-
**Step #2: MPLAB Code Configurator (MCC)**
42+
**Step #2: MPLAB Code Configurator (MCC)**
4043

4144
+ Modify the Clock Control
4245
+ Set “Clock Source” to High Frequency Internal Oscillator (HFINTOSC)
@@ -47,45 +50,53 @@ In this example, the ADCC will be configured to sample the Temperature Indicator
4750

4851

4952
+ Set Configuration Bits
50-
+ Disable "External Oscillator Mode Selection"
51-
+ Set "Power-up Default Value for COSC" to "HFINTOSC with HFFRQ = 64MHz and CDIV = 1:1"
52-
+ Ensure that "WDT Operating Mode" is set to "WDT Disabled; SWDTEN is ignored"
53+
+ Disable "External Oscillator Mode Selection" in CONFIG 1
54+
+ Set "Power-up Default Value for COSC" in CONFIG 1 to "HFINTOSC with HFFRQ = 64MHz and CDIV = 1:1"
55+
+ Ensure that "WDT Operating Mode" in CONFIG 5 is set to "WDT Disabled; SWDTEN is ignored"
5356

5457
![Configuration Bits](images/Picture2.PNG)
5558

5659

57-
**Step #3: Adding ADCC, FVR, Memory, Timer, and UART peripherals**
60+
**Step #3: Adding ADCC, FVR, Memory, Timer, and UART Peripherals**
5861

5962
For this project to work properly, the application goes through a specific series of steps to minimize noise in the measurement.
60-
- These steps are: ADCC is set up to run periodically from hardware trigger → Device is put to sleep → Hardware trigger activates → Temperature Sensor is measured multiple times and averaged → Microcontroller is woken up after average is computed → Result is converted to temperature → Print results using UART.
63+
64+
These steps are:
65+
1. Analog-to-Digital Converter with Computation (ADCC) is set up to run periodically from a hardware trigger
66+
2. The device is put to sleep
67+
3. The hardware trigger activates
68+
4. The temperature sensor is measured multiple times and averaged
69+
5. The microcontroller is woken up after the average is computed
70+
6. The result is converted to temperature
71+
7. The results are printed using UART
6172

6273
+ In Device Resources:
63-
+ Drivers → ADCC → ADCC
64-
+ Drivers → FVR → FVR
65-
+ Drivers → Memory → MEMORY
66-
+ Drivers → Timer → TMR2
67-
+ Drivers → UART → UART1
74+
+ Drivers>ADCC>ADCC
75+
+ Drivers>FVR>FVR
76+
+ Drivers>Memory>MEMORY
77+
+ Drivers>Timer>TMR2
78+
+ Drivers>UART>UART1
6879

6980
![Project Resources](images/Picture3.PNG)
7081

7182

72-
**Once the peripherals are added, modify the peripherals:**
83+
Once the peripherals are added, change to following settings:
7384

74-
Please refer to the Temperature Indicator Module on the [PIC18F16Q41 Datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf) when configuring these peripherals.
85+
Please refer to the Temperature Indicator Module on the [PIC18F16Q41 data sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf) when configuring these peripherals.
7586

7687

7788
+ TMR2
7889
+ Hardware Settings
79-
+ ***Control Mode:*** Roll over pulse
80-
+ ***Start/Reset Option:*** Software control
90+
+ Control Mode: Roll over pulse
91+
+ Start/Reset Option: Software control
8192
+ Timer Clock
82-
+ ***Clock Source:*** LFINTOSC
83-
+ ***Prescaler:*** 1:8
84-
+ ***Postscaler:*** 1:12
93+
+ Clock Source: LFINTOSC
94+
+ Prescaler: 1:8
95+
+ Postscaler: 1:12
8596
+ Timer Period(s)
86-
+ ***Time Period (s):*** 0.5
97+
+ Time Period (s): 0.5
8798

88-
![TMR2 Config](images/Picture16.1.PNG)
99+
<img src="images/Picture16.1.PNG" alt="TMR2 Config" width="450">
89100

90101

91102
+ FVR
@@ -117,42 +128,43 @@ For this project to work properly, the application goes through a specific serie
117128
+ ***ADC Threshold is enabled***
118129

119130
![ADCC Config 1](images/Picture4.PNG)
131+
120132
![ADCC Config 2](images/Picture5.PNG)
121133

122134
+ UART1
123135
+ Software Settings:
124-
+ Enable "Redirect STDIO to UART" in order to use the function (printf) for sending messages.
136+
+ Enable "Redirect STDIO to UART" in order to use the function (printf) for sending messages
125137
+ Hardware Settings:
126-
+ Enable UART box should be checked
127-
+ Enable transmit and Receive should be checked
138+
+ Enable UART box must be checked
139+
+ Enable transmit and Receive must be checked
128140
+ Set the Baud Rate to 19200
129141
+ Everything else can be left as default settings
130142

131143
![UART1 Config](images/Picture9.PNG)
132144

133145

134146

135-
+ ***In order for the Temperature calculation to be made, gain and offset need to be read from the Device Information Area (DIA). By configuring the memory peripheral this allows access to read those values.***
147+
+ In order for the temperature calculation to be made, gain and offset need to be read from the Device Information Area (DIA). By configuring the memory peripheral, this allows access to read those values.
136148
+ Memory
137-
+ ***Custom Name:*** FLASH
138-
+ ***Add Data EE Routines:*** Enabled
149+
+ Custom Name: FLASH
150+
+ Add Data EE Routines: Enabled
139151

140152
![Memory Config](images/Picture6.PNG)
141153

142154

143155
**Step #4: Configure the Pins**
144-
+ **TX1** is connected to pin RB7
145-
+ **RX1** is connected to pin RB5
156+
+ TX1 is connected to pin RB7
157+
+ RX1 is connected to pin RB5
146158

147159
![Pin Manager](images/Picture10.PNG)
148160

149-
**Step #5: Generate the project**
150-
+ Click the generate button in MCC to create the appropriate header and source files for this configuration
161+
**Step #5: Generate the Project**
162+
+ Click the **generate** button in MCC to create the appropriate header and source files for this configuration
151163

152164

153165
**Step #6: Modifying main.c**
154-
+ Upon the generation being completed, the new MCC generated header and source files will be in the project window. Select the main.c file and you will see an empty while(1) loop where you can add your application code.
155-
+ Refer to section 39.2 on the [PIC18F16Q41 Datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf) to fully understand the Temperature Calculation
166+
+ Once the project is generated, the new MCC generated header and source files will be in the project window. Select the `main.c` file and you will see an empty while(1) loop where you can add your application code.
167+
+ Refer to section 39.2 on the [PIC18F16Q41 data sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F06-16Q41-DataSheet-40002214C.pdf) to fully understand the temperature calculation
156168

157169
```
158170
#include "mcc_generated_files/system/system.h"
@@ -198,20 +210,20 @@ int main(void)
198210

199211

200212
**Step #7: MPLAB Data Visualizer**
201-
+ Open up the Data Visualizer on the host computer and select the COM port associated with the Curiosity Nano.
213+
+ Open up the Data Visualizer on the host computer and select the COM port associated with the Curiosity Nano
202214

203215
![COM PORT Settings](images/Picture11.PNG)
204216

205-
+ Ensure that the Terminal tab is selected
217+
+ Ensure that the **Terminal** tab is selected
206218

207219
![Terminal Tab](images/Picture12.PNG)
208220

209-
+ Once selected, configure the data visualizer to communicate at 19200 baud, no parity, and 1 stop bit.
221+
+ Once selected, configure the data visualizer to communicate at: 19200 baud, no parity, and 1 stop bit
210222

211223
![COM PORT Configuration](images/Picture14.PNG)
212224

213-
+ If everything is setup correctly, then the Data Visualizer should start displaying the device temperature every half a second.
214-
+ If you cover or touch the die on the device, you will notice the temperature start to increase.
225+
+ If everything is set up correctly, then the Data Visualizer will start displaying the device temperature every half a second
226+
+ If you cover or touch the DIE on the device, you will notice the temperature start to increase
215227

216228
![Terminal Emulator Results](images/Picture16.2.PNG)
217229

0 commit comments

Comments
 (0)