Skip to content

Commit d3514ca

Browse files
Dradnatsegilro
authored andcommitted
MPAE-16711: Updated readme and support files
Merge in EBE/atmega4809-adc-basics-mplab from feature/MPAE-16711_maintenance_updates to develop
1 parent 327b457 commit d3514ca

File tree

5 files changed

+138
-50
lines changed

5 files changed

+138
-50
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
!/**/nbproject/*.xml
55
/**/[Ff]ree/production/*
66
/**/[Pp]ro/production/*
7+
/**/.generated_files/*
78

89
# Uncomment these to include hex/elf files
910
#!/**/[Ff]ree/production/*.hex

.main-meta/main.json

+5-27
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
"metaDataVersion": "1.0.0",
33
"category": "com.microchip.ide.project",
44
"content": {
5-
"metaDataVersion": "1.1.0",
5+
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mcu8.mplabx.project.atmega4809-adc-basics-mplab",
77
"version": "1.0.1",
88
"displayName": "ADC Basics with tinyAVR 0- and 1-series, and megaAVR 0-series",
99
"projectName": "atmega4809-adc-basics-mplab",
1010
"shortDescription": "This MPLAB X example demonstrates how to get started with the ADC on the ATmega4809",
1111
"ide": {
1212
"name": "MPLAB X",
13-
"semverRange": ">=5.40.0"
13+
"semverRange": ">=6.15.0"
1414
},
1515
"compiler": [
1616
{
1717
"name": "XC8",
18-
"semverRange": "^2.20.0"
18+
"semverRange": "^2.45.0"
1919
}
2020
],
2121
"dfp": {
2222
"name": "ATmega_DFP",
23-
"semverRange": "^2.2.108"
23+
"semverRange": "^3.0.158"
2424
},
2525
"configurator": {
2626
"name": "START",
@@ -32,33 +32,11 @@
3232
"content": {
3333
"metaDataVersion": "1.0.0",
3434
"category": "com.microchip.device",
35-
"name": "ATmega4809",
35+
"name": "ATMEGA4809",
3636
"versionRange": "*"
3737
}
3838
},
3939
"author": "Microchip",
40-
"subcategories": [
41-
[
42-
"Peripherals",
43-
"VREF"
44-
],
45-
[
46-
"Peripherals",
47-
"ADC"
48-
],
49-
[
50-
"Peripherals",
51-
"USART"
52-
],
53-
[
54-
"Development Kit",
55-
"ATmega4809 Xplained Pro"
56-
],
57-
[
58-
"Supporting Tools",
59-
"MPLAB Data Visualizer"
60-
]
61-
],
6240
"peripherals": [
6341
"VREF",
6442
"ADC",

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<a href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="300"/></a>
22

3-
# ATmega4809 Xplained Pro ADC basics
3+
# ATmega4809 Xplained Pro ADC Basics
44

5-
MegaAVR® 0-series devices feature a 10-bit successive approximation register (SAR) Analog-to-Digital Converter (ADC) and is capable of conversion rates up to 115 ksps. It features a flexible multiplexer, which allows the ADC to measure the voltage at multiplesingle-ended input pins.
5+
MegaAVR® 0-series devices feature a 10-bit Successive Approximation register (SAR) Analog-to-Digital Converter (ADC) capable of conversion rates up to 115 ksps. It features a flexible multiplexer, which allows the ADC to measure the voltage at multiple single-ended input pins.
66

77
There are four modes we will explore in this example:
88
* ADC Free-Running mode
@@ -19,12 +19,11 @@ This is an example of how to get started with the ADC on the ATmega4809. This is
1919

2020
## Software Used
2121

22-
- [MPLAB X IDE v5.40 or later](https://www.microchip.com/mplab/mplab-x-ide)
23-
- Data Visualizer
24-
- [MPLAB Data Visualizer](https://gallery.microchip.com/packages/MPLAB-Data-Visualizer-Standalone(Windows)/)
25-
- [Studio Data visualizer](https://www.microchip.com/mplab/avr-support/data-visualizer)
26-
- [XC8 (v2.20)](https://www.microchip.com/mplab/compilers) alternatively [AVR/GNU C Compiler 5.4.0](https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers) can be used
27-
- ATmega_DFP 2.2.108 or later
22+
- [MPLAB® X IDE v6.15 or later](https://www.microchip.com/mplab/mplab-x-ide)
23+
- [MPLAB® Data Visualizer](https://gallery.microchip.com/packages/MPLAB-Data-Visualizer-Standalone(Windows)/)
24+
- [Studio Data Visualizer](https://www.microchip.com/mplab/avr-support/data-visualizer)
25+
- [XC8 (v2.45)](https://www.microchip.com/mplab/compilers) alternatively [AVR/GNU C Compiler 5.4.0](https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers) can be used
26+
- ATmega_DFP 3.0.158 or later
2827

2928
## Hardware Used
3029

@@ -38,10 +37,10 @@ This is an example of how to get started with the ADC on the ATmega4809. This is
3837

3938
1. Download the zip file or clone the example to get the source code.
4039
2. Open `atmega4809-adc-basics-mplab.X` in MPLAB.
41-
3. Connect the ATmega4809 Xplained Pro to your computer with a micro usb cable.
40+
3. Connect the ATmega4809 Xplained Pro to the computer with a micro USB cable.
4241
4. Make sure the kit is selected as the tool to be programmed under project settings.
4342
5. Press the make and program button to program the device.
44-
6. Open your favorite terminal application or Data visualizer and open the serial port associated with the Xplained Pro.
43+
6. Open the desired terminal application or Data visualizer and open the serial port associated with the Xplained Pro.
4544

4645
As mentioned in the appnote [AN2573](https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en601379) you can change the voltage level of the adc input port and the approximated value will be shown over UART through data visualizer.
4746

atmega4809-adc-basics-mplab.X/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void usart_send_float(float number)
6565
{
6666
char string[6];
6767

68-
dtostrf(number, 2, 3, string);
68+
sprintf(string, "%.*f", 3, number);
6969
usart_put_string(string, 5);
7070
usart_put_string("V\n", 2);
7171
}

atmega4809-adc-basics-mplab.X/nbproject/configurations.xml

+122-12
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@
8888
<targetPluginBoard></targetPluginBoard>
8989
<platformTool>EdbgTool</platformTool>
9090
<languageToolchain>XC8</languageToolchain>
91-
<languageToolchainVersion>2.20</languageToolchainVersion>
91+
<languageToolchainVersion>2.45</languageToolchainVersion>
9292
<platform>3</platform>
9393
</toolsSet>
9494
<packs>
95-
<pack name="ATmega_DFP" vendor="Microchip" version="2.2.108"/>
95+
<pack name="ATmega_DFP" vendor="Microchip" version="3.0.158"/>
9696
</packs>
9797
<ScriptingSettings>
9898
</ScriptingSettings>
@@ -113,6 +113,7 @@
113113
</compileType>
114114
<makeCustomizationType>
115115
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
116+
<makeUseCleanTarget>false</makeUseCleanTarget>
116117
<makeCustomizationPreStep></makeCustomizationPreStep>
117118
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
118119
<makeCustomizationPostStep></makeCustomizationPostStep>
@@ -125,12 +126,18 @@
125126
<property key="communication.activationmode" value="nohv"/>
126127
<property key="communication.interface" value="updi"/>
127128
<property key="communication.speed" value="0,500"/>
129+
<property key="debugoptions.debug-startup" value="Use system settings"/>
130+
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
128131
<property key="debugoptions.useswbreakpoints" value="false"/>
132+
<property key="event.recorder.enabled" value="false"/>
133+
<property key="event.recorder.scvd.files" value=""/>
129134
<property key="firmware.path"
130135
value="Press to browse for a specific firmware version"/>
131136
<property key="firmware.toolpack"
132137
value="Press to select which tool pack to use"/>
133138
<property key="firmware.update.action" value="firmware.update.use.latest"/>
139+
<property key="freeze.timers" value="false"/>
140+
<property key="lastid" value=""/>
134141
<property key="memories.aux" value="false"/>
135142
<property key="memories.bootflash" value="true"/>
136143
<property key="memories.configurationmemory" value="true"/>
@@ -186,9 +193,9 @@
186193
<property key="optimization-level" value="-O0"/>
187194
<property key="optimization-speed" value="false"/>
188195
<property key="optimization-stable-enable" value="false"/>
189-
<property key="pack-struct" value="true"/>
190196
<property key="preprocess-assembler" value="true"/>
191197
<property key="short-enums" value="true"/>
198+
<property key="tentative-definitions" value="-fno-common"/>
192199
<property key="undefine-macros" value=""/>
193200
<property key="use-cci" value="false"/>
194201
<property key="use-iar" value="false"/>
@@ -701,22 +708,70 @@
701708
value=""/>
702709
<property key="warningmessagebreakoptions.warningmessages" value="holdstate"/>
703710
</Simulator>
704-
<XC8-CO>
705-
<property key="coverage-enable" value=""/>
706-
</XC8-CO>
711+
<Tool>
712+
<property key="AutoSelectMemRanges" value="auto"/>
713+
<property key="communication.activationmode" value="nohv"/>
714+
<property key="communication.interface" value="updi"/>
715+
<property key="communication.speed" value="0,500"/>
716+
<property key="debugoptions.debug-startup" value="Use system settings"/>
717+
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
718+
<property key="debugoptions.useswbreakpoints" value="false"/>
719+
<property key="event.recorder.enabled" value="false"/>
720+
<property key="event.recorder.scvd.files" value=""/>
721+
<property key="firmware.path"
722+
value="Press to browse for a specific firmware version"/>
723+
<property key="firmware.toolpack"
724+
value="Press to select which tool pack to use"/>
725+
<property key="firmware.update.action" value="firmware.update.use.latest"/>
726+
<property key="freeze.timers" value="false"/>
727+
<property key="lastid" value=""/>
728+
<property key="memories.aux" value="false"/>
729+
<property key="memories.bootflash" value="true"/>
730+
<property key="memories.configurationmemory" value="true"/>
731+
<property key="memories.configurationmemory2" value="true"/>
732+
<property key="memories.dataflash" value="true"/>
733+
<property key="memories.eeprom" value="true"/>
734+
<property key="memories.exclude.configurationmemory" value="true"/>
735+
<property key="memories.flashdata" value="true"/>
736+
<property key="memories.id" value="true"/>
737+
<property key="memories.instruction.ram.ranges"
738+
value="${memories.instruction.ram.ranges}"/>
739+
<property key="memories.programmemory" value="true"/>
740+
<property key="memories.programmemory.ranges" value="0-5fff"/>
741+
<property key="poweroptions.powerenable" value="false"/>
742+
<property key="programoptions.eraseb4program" value="true"/>
743+
<property key="programoptions.preservedataflash" value="false"/>
744+
<property key="programoptions.preservedataflash.ranges"
745+
value="${memories.dataflash.default}"/>
746+
<property key="programoptions.preserveeeprom" value="false"/>
747+
<property key="programoptions.preserveeeprom.ranges" value="1400-14ff"/>
748+
<property key="programoptions.preserveprogram.ranges" value=""/>
749+
<property key="programoptions.preserveprogramrange" value="false"/>
750+
<property key="programoptions.preserveuserid" value="false"/>
751+
<property key="programoptions.programuserotp" value="false"/>
752+
<property key="toolpack.updateoptions"
753+
value="toolpack.updateoptions.uselatestoolpack"/>
754+
<property key="toolpack.updateoptions.packversion"
755+
value="Press to select which tool pack to use"/>
756+
<property key="voltagevalue" value=""/>
757+
</Tool>
707758
<XC8-config-global>
708759
<property key="advanced-elf" value="true"/>
760+
<property key="constdata-progmem" value="true"/>
709761
<property key="gcc-opt-driver-new" value="false"/>
710762
<property key="gcc-opt-std" value="${gcc-opt-std.default}"/>
711763
<property key="gcc-output-file-format" value="dwarf-3"/>
764+
<property key="mapped-progmem" value="false"/>
712765
<property key="omit-pack-options" value="false"/>
713766
<property key="omit-pack-options-new" value="3"/>
714767
<property key="output-file-format" value="-mcof,+elf"/>
768+
<property key="smart-io-format" value=""/>
715769
<property key="stack-size-high" value="auto"/>
716770
<property key="stack-size-low" value="auto"/>
717771
<property key="stack-size-main" value="auto"/>
718772
<property key="stack-type" value="compiled"/>
719773
<property key="user-pack-device-support" value=""/>
774+
<property key="wpo-lto" value="false"/>
720775
<appendMe value="-std=gnu99"/>
721776
</XC8-config-global>
722777
</conf>
@@ -728,11 +783,11 @@
728783
<targetPluginBoard></targetPluginBoard>
729784
<platformTool>EdbgTool</platformTool>
730785
<languageToolchain>XC8</languageToolchain>
731-
<languageToolchainVersion>2.20</languageToolchainVersion>
786+
<languageToolchainVersion>2.45</languageToolchainVersion>
732787
<platform>3</platform>
733788
</toolsSet>
734789
<packs>
735-
<pack name="ATmega_DFP" vendor="Microchip" version="2.2.108"/>
790+
<pack name="ATmega_DFP" vendor="Microchip" version="3.0.158"/>
736791
</packs>
737792
<ScriptingSettings>
738793
</ScriptingSettings>
@@ -753,6 +808,7 @@
753808
</compileType>
754809
<makeCustomizationType>
755810
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
811+
<makeUseCleanTarget>false</makeUseCleanTarget>
756812
<makeCustomizationPreStep></makeCustomizationPreStep>
757813
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
758814
<makeCustomizationPostStep></makeCustomizationPostStep>
@@ -765,12 +821,18 @@
765821
<property key="communication.activationmode" value="nohv"/>
766822
<property key="communication.interface" value="updi"/>
767823
<property key="communication.speed" value="0,500"/>
824+
<property key="debugoptions.debug-startup" value="Use system settings"/>
825+
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
768826
<property key="debugoptions.useswbreakpoints" value="false"/>
827+
<property key="event.recorder.enabled" value="false"/>
828+
<property key="event.recorder.scvd.files" value=""/>
769829
<property key="firmware.path"
770830
value="Press to browse for a specific firmware version"/>
771831
<property key="firmware.toolpack"
772832
value="Press to select which tool pack to use"/>
773833
<property key="firmware.update.action" value="firmware.update.use.latest"/>
834+
<property key="freeze.timers" value="false"/>
835+
<property key="lastid" value=""/>
774836
<property key="memories.aux" value="false"/>
775837
<property key="memories.bootflash" value="true"/>
776838
<property key="memories.configurationmemory" value="true"/>
@@ -826,9 +888,9 @@
826888
<property key="optimization-level" value="-Os"/>
827889
<property key="optimization-speed" value="false"/>
828890
<property key="optimization-stable-enable" value="false"/>
829-
<property key="pack-struct" value="true"/>
830891
<property key="preprocess-assembler" value="true"/>
831892
<property key="short-enums" value="true"/>
893+
<property key="tentative-definitions" value="-fno-common"/>
832894
<property key="undefine-macros" value=""/>
833895
<property key="use-cci" value="false"/>
834896
<property key="use-iar" value="false"/>
@@ -1342,22 +1404,70 @@
13421404
value=""/>
13431405
<property key="warningmessagebreakoptions.warningmessages" value="holdstate"/>
13441406
</Simulator>
1345-
<XC8-CO>
1346-
<property key="coverage-enable" value=""/>
1347-
</XC8-CO>
1407+
<Tool>
1408+
<property key="AutoSelectMemRanges" value="auto"/>
1409+
<property key="communication.activationmode" value="nohv"/>
1410+
<property key="communication.interface" value="updi"/>
1411+
<property key="communication.speed" value="0,500"/>
1412+
<property key="debugoptions.debug-startup" value="Use system settings"/>
1413+
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
1414+
<property key="debugoptions.useswbreakpoints" value="false"/>
1415+
<property key="event.recorder.enabled" value="false"/>
1416+
<property key="event.recorder.scvd.files" value=""/>
1417+
<property key="firmware.path"
1418+
value="Press to browse for a specific firmware version"/>
1419+
<property key="firmware.toolpack"
1420+
value="Press to select which tool pack to use"/>
1421+
<property key="firmware.update.action" value="firmware.update.use.latest"/>
1422+
<property key="freeze.timers" value="false"/>
1423+
<property key="lastid" value=""/>
1424+
<property key="memories.aux" value="false"/>
1425+
<property key="memories.bootflash" value="true"/>
1426+
<property key="memories.configurationmemory" value="true"/>
1427+
<property key="memories.configurationmemory2" value="true"/>
1428+
<property key="memories.dataflash" value="true"/>
1429+
<property key="memories.eeprom" value="true"/>
1430+
<property key="memories.exclude.configurationmemory" value="true"/>
1431+
<property key="memories.flashdata" value="true"/>
1432+
<property key="memories.id" value="true"/>
1433+
<property key="memories.instruction.ram.ranges"
1434+
value="${memories.instruction.ram.ranges}"/>
1435+
<property key="memories.programmemory" value="true"/>
1436+
<property key="memories.programmemory.ranges" value="0-5fff"/>
1437+
<property key="poweroptions.powerenable" value="false"/>
1438+
<property key="programoptions.eraseb4program" value="true"/>
1439+
<property key="programoptions.preservedataflash" value="false"/>
1440+
<property key="programoptions.preservedataflash.ranges"
1441+
value="${memories.dataflash.default}"/>
1442+
<property key="programoptions.preserveeeprom" value="false"/>
1443+
<property key="programoptions.preserveeeprom.ranges" value="1400-14ff"/>
1444+
<property key="programoptions.preserveprogram.ranges" value=""/>
1445+
<property key="programoptions.preserveprogramrange" value="false"/>
1446+
<property key="programoptions.preserveuserid" value="false"/>
1447+
<property key="programoptions.programuserotp" value="false"/>
1448+
<property key="toolpack.updateoptions"
1449+
value="toolpack.updateoptions.uselatestoolpack"/>
1450+
<property key="toolpack.updateoptions.packversion"
1451+
value="Press to select which tool pack to use"/>
1452+
<property key="voltagevalue" value=""/>
1453+
</Tool>
13481454
<XC8-config-global>
13491455
<property key="advanced-elf" value="true"/>
1456+
<property key="constdata-progmem" value="true"/>
13501457
<property key="gcc-opt-driver-new" value="false"/>
13511458
<property key="gcc-opt-std" value="${gcc-opt-std.default}"/>
13521459
<property key="gcc-output-file-format" value="dwarf-3"/>
1460+
<property key="mapped-progmem" value="false"/>
13531461
<property key="omit-pack-options" value="false"/>
13541462
<property key="omit-pack-options-new" value="3"/>
13551463
<property key="output-file-format" value="-mcof,+elf"/>
1464+
<property key="smart-io-format" value=""/>
13561465
<property key="stack-size-high" value="auto"/>
13571466
<property key="stack-size-low" value="auto"/>
13581467
<property key="stack-size-main" value="auto"/>
13591468
<property key="stack-type" value="compiled"/>
13601469
<property key="user-pack-device-support" value=""/>
1470+
<property key="wpo-lto" value="false"/>
13611471
<appendMe value="-std=gnu99 -flto"/>
13621472
</XC8-config-global>
13631473
</conf>

0 commit comments

Comments
 (0)