Skip to content

Commit ea38925

Browse files
Irene Mary AbrahamIrene Mary Abraham
Irene Mary Abraham
authored and
Irene Mary Abraham
committed
MPAE-9780 Updated Readme and metadata files,added images folder
1 parent 390158d commit ea38925

17 files changed

+74
-57
lines changed

.main-meta/main.json

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,51 @@
33
"category": "com.microchip.ide.project",
44
"content": {
55
"metaDataVersion": "1.1.0",
6-
"name": "com.microchip.mcu8.mplabx.project.",
7-
"version": " ",
8-
"displayName": " ",
9-
"projectName": "",
10-
"shortDescription": "",
6+
"name": "com.microchip.mcu8.mplabx.project.pic18f47q10-dac-waveform-generation",
7+
"version": "1.0.1",
8+
"displayName": "Waveform generation using DAC",
9+
"projectName": "pic18f47q10-dac-waveform-generation",
10+
"shortDescription": "This example demonstrates how DAC peripherals from PICQ10, can be used to generate reference voltage and different signals",
1111
"ide": {
12-
"name": "",
13-
"semverRange": ""
12+
"name": "MPLAB X",
13+
"semverRange": ">=5.30.0"
1414
},
1515
"compiler": [
1616
{
17-
"name": "",
18-
"semverRange": ""
17+
"name": "XC8",
18+
"semverRange": "^2.10.0"
1919
}
2020
],
2121
"dfp": {
22-
"name": "",
23-
"semverRange": ""
22+
"name": "PIC18F-Q_DFP",
23+
"semverRange": "1.3.89"
2424
},
2525
"configurator": {
26-
"name": "",
27-
"semverRange": ""
26+
"name": "MCC",
27+
"semverRange": ">=3.85.1"
2828
},
2929
"device": {
3030
"metaDataVersion": "1.0.0",
3131
"category": "com.microchip.portal.contentRef",
3232
"content": {
3333
"metaDataVersion": "1.0.0",
3434
"category": "com.microchip.device",
35-
"name": "",
35+
"name": "PIC18F47Q10",
3636
"versionRange": "*"
3737
}
3838
},
39-
"author": "",
39+
"author": "Microchip",
4040
"subcategories": [
41-
"",
41+
"MCC",
4242
[
43-
"Peripherals", ""
44-
],
45-
[
46-
"Peripherals", ""
47-
]
43+
"Peripherals", "DAC"
44+
]
4845
],
4946
"peripherals": [
50-
"",""
47+
"DAC"
5148
],
5249
"keywords": [
53-
"",
54-
""
50+
"Waveform generation"
5551
],
5652
"additionalData": {
5753
"longDescription": {

README.md

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
[![MCHP](images/microchip.png)](https://www.microchip.com)
2+
3+
# Waveform generation using DAC
4+
15
# Introduction
26
The Digital-to-Analog Converter (DAC) converts a digital value to an analog voltage. The DAC module offers flexible input source selection, provision to route output to other peripherals such as analog comparator and Analog to Digital converter, and configurable registers set.
37

48
DAC has a flexible option to choose both positive as well as negative reference voltage sources, depending on application requirement.
59

610
This Xpress example discusses how DAC peripherals from PICQ10, can be used to generate reference voltage and different signals.
711

12+
# Related Documents / Useful Links
13+
14+
- [TB3238 - 5-Bit Digital-to-Analog Converter](https://www.microchip.com/wwwappnotes/appnotes.aspx?appnote=en1001182)
15+
- [PIC18-Q10 Product Family Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family)
16+
- [PIC18F47Q10 Data Sheet](http://ww1.microchip.com/downloads/en/DeviceDoc/40002043D.pdf)
17+
- [PIC18F47Q10 Code Examples on GitHub](https://github.com/microchip-pic-avr-examples?q=pic18f47q10-cnano)
818

919
# Reference Voltage and Waveform Generation Using DAC
1020
The signals generated in this example are “Sine wave, Triangular wave, Square wave, Sawtooth wave, and constant (reference) voltage signals”. The digital Look Up Table (LUT) is created and fed into DAC input to generate the corresponding signal.
@@ -20,7 +30,7 @@ The signals generated in this example are “Sine wave, Triangular wave, Square
2030

2131
The following figure 1 shows an overview of the Signal Generator Example.
2232

23-
![](https://i.imgur.com/zFBYrdP.jpg)
33+
![Application_block_diagram](images/Application_block_diagram.jpg)
2434

2535
**Figure 1: Application Block Diagram**
2636

@@ -39,33 +49,44 @@ This example generates the reference voltage 1 at power up, and the signal outpu
3949

4050
Operation of this example is discussed in following section.
4151

52+
# Hardware used
53+
* [PIC18F47Q10 Curiosity nano evaluation board](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
54+
55+
With full program and debug capabilities, the PIC18F47Q10 Curiosity Nano evaluation kit offers complete support for the new design. With the award-winning MPLAB X integrated development platform and MPLAB Code Configurator (MCC), the kit provides access to the Intelligent analog and Core Independent Peripherals on the PIC18F47Q10. Figure 2 shows the PIC18F47Q10 Curiosity Nano board.
56+
57+
![PIC18F47Q10_Curiosity_Nano_board](images/PIC18F47Q10_Curiosity_Nano_board.jpg)
58+
59+
**Figure 2: PIC18F47Q10 Curiosity Nano board**
60+
4261
# Software Tools
4362
Following Microchip’s free IDE, compiler and graphical code generators are used for the application firmware development.
4463

45-
* MPLAB X IDE v5.30
46-
* XC8 Compiler v2.10
47-
* MCC Code Configurator v3.85.1
64+
* [MPLAB® X IDE v5.30](http://www.microchip.com/mplab/mplab-x-ide)
65+
* [XC8 Compiler v2.10](http://www.microchip.com/mplab/compilers)
66+
* [MPLAB® Code Configurator (MCC) v3.85.1](https://www.microchip.com/mplab/mplab-code-configurator)
67+
* [MCC Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs v1.78.0](https://www.microchip.com/mplab/mplab-code-configurator)
68+
* [Microchip PIC18F-Q Series Device Support 1.3.89](https://packs.download.microchip.com/)
4869

4970
# Hardware Setup
50-
The following figures (Figure 2.1 and Figure 2.2) shows the hardware connections/details.
71+
The following figures (Figure 3.1 and Figure 3.2) shows the hardware connections/details.
5172

52-
![](https://i.imgur.com/b0nkWlG.jpg)
73+
![Application_hardware_setup_front_view](images/Application_hardware_setup_front_view.jpg)
5374

54-
**Figure 2.1: Application Hardware Setup, Front View{**
75+
**Figure 3.1: Application Hardware Setup, Front View{**
5576

56-
![](https://i.imgur.com/0lNUV3p.jpg)
77+
![Application_hardware_setup_back_view](images/Application_hardware_setup_back_view.jpg)
5778

58-
**Figure 2.2: Application Hardware Setup, Rear View**
79+
**Figure 3.2: Application Hardware Setup, Rear View**
5980
# Peripheral configurations using MCC
6081
## -> System configuration
6182

6283
System configuration in MCC is used for Microcontroller oscillator configuration, PLL, Watchdog timer and low voltage programming settings. In this example internal oscillator of 4MHz frequency with clock divider 1 is used as a system clock and the Watchdog timer is disabled.
6384

64-
The following figure 3 shows the system configuration settings in MCC.
85+
The following figure 4 shows the system configuration settings in MCC.
6586

66-
![](https://i.imgur.com/AJqnfon.png)
87+
![System_configuration_using_MCC](images/System_configuration_using_MCC.png)
6788

68-
**Figure 3: System Configuration using MCC**
89+
**Figure 4: System Configuration using MCC**
6990

7091
## -> DAC configuration
7192
The Digital to Analog Convertor module is used to convert digital Look Up Table into analog signal. DAC is configured as follows.
@@ -75,71 +96,71 @@ The Digital to Analog Convertor module is used to convert digital Look Up Table
7596
* DAC Output - DAC1OUT1 pin of Microcontroller
7697
* DAC Output Pin - RA2
7798

78-
The following figure 4 shows the DAC configuration using MCC.
99+
The following figure 5 shows the DAC configuration using MCC.
79100

80-
![](https://i.imgur.com/OorEoCx.png)
101+
![DAC_configuration_using_MCC](images/DAC_configuration_using_MCC.png)
81102

82-
**Figure 4: DAC Configuration using MCC**
103+
**Figure 5: DAC Configuration using MCC**
83104

84105
## -> Pin Mapping
85-
The I/O pin mapping of the PIC18F47Q10 MCU for DAC interface and Curiosity Nano on board LED is shown in the following figure 5.
106+
The I/O pin mapping of the PIC18F47Q10 MCU for DAC interface and Curiosity Nano on board LED is shown in the following figure 6.
86107

87-
![](https://i.imgur.com/7wXSO1A.png)
108+
![Pin_module_settings_in_MCC](images/Pin_module_settings_in_MCC.png)
88109

89-
**Figure 5: Pin Module Settings in MCC**
110+
**Figure 6: Pin Module Settings in MCC**
90111

91112
The on-board switch SW0 on the Curiosity Nano board is connected to PE2. As external interrupt configuration is not possible on pin PE2, pin RC2 is configured as Interrupt on Change (IOC) and RC2 is shorted to RE2 using external jumper for detecting button press event using IOC feature.
92113

93114
# Operation
94115

95-
* Setup the hardware, as per Hardware Setup (Refer Figure 2.1 and 2.2).
116+
* Setup the hardware, as per Hardware Setup (Refer Figure 3.1 and 3.2).
96117
* Connect the pins RE2 and RC2 using the jumper.
97118
* Connect RA2 (DAC1OUT1 Pin) to the positive terminal of the Scope (DSO/Oscilloscope) and connect GND (CNANO board ground pin) to GND terminal of scope.
98119
* Power on the CNANO board by connecting the micro USB cable from micro USB socket (Micro USB Connector) on the CNANO board to the PC USB socket.
99120
* The Curiosity Nano board should appear as a Mass Storage Device after connecting to the PC.
100121
* Click on **Make and program device**.
101122

102-
![](https://i.imgur.com/N2eSOtH.png)
123+
![Programming_the_device](images/Programming_the_device.png)
103124

104-
**Figure 6: Programing the device**
125+
**Figure 7: Programing the device**
105126
* IDE generates the .hex file, save the file in local PC.
106127
* Drag the .hex from the downloads section and drop the file on to the Curiosity drive. This should program the device.
107128
* Turn on the Oscilloscope.
108129
* Observe the default Constant Signal (Reference Voltage 1.6V) on the Oscilloscope screen.
109130

110-
![](https://i.imgur.com/62ykDJU.png)
131+
![Generated_reference_voltage_signal_on_oscilloscope_screen](images/Generated_reference_voltage_signal_on_oscilloscope_screen.png)
111132

112-
**Figure 7: Generated Reference voltage (1.6V) Signal on Oscilloscope screen**
133+
**Figure 8: Generated Reference voltage (1.6V) Signal on Oscilloscope screen**
113134

114135
* Press on board button (SW0) to change the generated signal and observe the constant 3.196 volts signal on the Oscilloscope screen.
115136

116-
![](https://i.imgur.com/DvoCjDQ.png)
137+
![Generated_constant_voltage_signal_on_oscilloscope_screen](images/Generated_constant_voltage_signal_on_oscilloscope_screen.png)
117138

118-
**Figure 8: Generated Constant voltage (3.196V) Signal on Oscilloscope screen**
139+
**Figure 9: Generated Constant voltage (3.196V) Signal on Oscilloscope screen**
119140

120141
* Press on board button (SW0) to change the generated signal and observe the Sine wave on the Oscilloscope screen.
121142

122-
![](https://i.imgur.com/7ruiWPF.png)
143+
![Generated_sine_wave_on_oscillosocope](images/Generated_sine_wave_on_oscillosocope.png)
123144

124-
**Figure 9: Generated Sine Wave on Oscilloscope screen**
145+
**Figure 10: Generated Sine Wave on Oscilloscope screen**
125146

126147
* Press on board button (SW0) to change the generated signal and observe the Triangular wave on the Oscilloscope screen.
127148

128-
![](https://i.imgur.com/vskitV2.png)
149+
![Generated_triangle_wave_on_oscilloscope](images/Generated_triangle_wave_on_oscilloscope.png)
129150

130-
**Figure 10: Generated Triangle Wave on Oscilloscope screen**
151+
**Figure 11: Generated Triangle Wave on Oscilloscope screen**
131152

132153
* Press on board button (SW0) to change the generated signal and observe the Square wave on the Oscilloscope screen.
133154

134-
![](https://i.imgur.com/ObnkreO.png)
155+
![Generated_square_wave_on_oscilloscope](images/Generated_square_wave_on_oscilloscope.png)
135156

136-
**Figure 11: Generated Square Wave on Oscilloscope screen**
157+
**Figure 12: Generated Square Wave on Oscilloscope screen**
137158

138159
* Press on board button (SW0) to change the generated signal and observe the Saw tooth wave on the Oscilloscope screen.
139160

140-
![](https://i.imgur.com/ry0mitv.png)
161+
![Generated_sawtooth_wave_on_oscilloscope](images/Generated_sawtooth_wave_on_oscilloscope.png)
141162

142-
**Figure 12: Generated Sawtooth Wave on Oscilloscope screen**
163+
**Figure 13: Generated Sawtooth Wave on Oscilloscope screen**
143164

144165
* Press on board button (SW0) to change the generated signal and observe the default signal Sine wave on the Oscilloscope screen.
145166
* Cycle is repeated, once six signals are generated and displayed.

images/Application_block_diagram.jpg

40.6 KB
Loading
Loading
Loading
58.6 KB
Loading
Loading
Loading
Loading
65.6 KB
Loading
Loading
Loading
19.6 KB
Loading

images/Pin_module_settings_in_MCC.png

45.4 KB
Loading

images/Programming_the_device.png

35.6 KB
Loading
59.5 KB
Loading

images/microchip.png

13.9 KB
Loading

0 commit comments

Comments
 (0)