Skip to content

Commit 7091e23

Browse files
carleheegilro
authored andcommitted
MPAE-3063: updated code to new DFP, updated readme
1 parent 517290b commit 7091e23

File tree

4 files changed

+46
-26
lines changed

4 files changed

+46
-26
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ A new feature introduced in the AVR® DB MCU is the Analog Signal Conditioning (
99

1010
## Related Documentation
1111

12-
* [ANxxxx - AVR128DB48 Constant-Current Driver Using the Analog Signal Conditioning (OPAMP) Peripheral](https://microchip.com/DSxxxxxxxxxx) <!--fill in DS number once it has been assigned-->
12+
* ANxxxx - Constant-Current Driver Using the Analog Signal Conditioning (OPAMP) Peripheral
1313
* [AVR128DB48 device page](https://www.microchip.com/wwwproducts/en/AVR128DB48)
1414

1515
## Software Used
16-
16+
### Studio
1717
* [Atmel Studio](https://www.microchip.com/mplab/avr-support/atmel-studio-7) 7.0.2397 or later
18-
* Atmel Studio AVR-Dx_DFP version 1.1.45 or later
18+
* Atmel Studio AVR-Dx_DFP version 1.3.67 or later
19+
### MPLAB® X
20+
* [MPLAB® X](https://www.microchip.com/mplab/mplab-x-ide) v5.40 or later
21+
* [MPLAB® XC8 Compiler](https://www.microchip.com/mplab/compilers) v2.20 or later
22+
* MPLABX AVR-Dx_DFP version 1.4.75 or later
1923

2024
## Hardware Used
2125

22-
* [AVR128DB48 Curiosity Nano](https://www.microchip.com/wwwproducts/en/AVR128DB48) <!-- Not the correct link, fix when curiosity nano page exists-->
26+
* [AVR128DB48 Curiosity Nano](https://www.microchip.com/wwwproducts/en/AVR128DB48)
2327
* One resistor (value dependent on desired current)
2428
* Load (LED, etc)
2529

2630
## Setup
2731

28-
* Connect the hardware together as seen in the schematic of the [application note](https://microchip.com/DSxxxxxxxxxx) <!--fill in DS number once it has been assigned-->
32+
* Connect the hardware together as seen in the schematic of the application note
2933

3034
## Operation
3135
* Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable

avr128db48-constant-current-driver-using-opamp/avr128db48-constant-current-driver-using-opamp/avr128db48-constant-current-driver-using-opamp.componentinfo.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@
99
<CSub></CSub>
1010
<CVariant></CVariant>
1111
<CVendor>Atmel</CVendor>
12-
<CVersion>1.1.0</CVersion>
12+
<CVersion>1.3.0</CVersion>
1313
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
1414
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
1515
<Description></Description>
1616
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
1717
<d4p1:anyType i:type="FileInfo">
18-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.1.45\include</AbsolutePath>
18+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\include\</AbsolutePath>
1919
<Attribute></Attribute>
2020
<Category>include</Category>
2121
<Condition>C</Condition>
2222
<FileContentHash i:nil="true" />
2323
<FileVersion></FileVersion>
24-
<Name>include</Name>
24+
<Name>include/</Name>
2525
<SelectString></SelectString>
2626
<SourcePath></SourcePath>
2727
</d4p1:anyType>
2828
<d4p1:anyType i:type="FileInfo">
29-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.1.45\include\avr\ioavr128db48.h</AbsolutePath>
29+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\include\avr\ioavr128db48.h</AbsolutePath>
3030
<Attribute></Attribute>
3131
<Category>header</Category>
3232
<Condition>C</Condition>
33-
<FileContentHash>n0t0P6Gb+2Not6ByRQCgcQ==</FileContentHash>
33+
<FileContentHash>cKZGjdWnZfqdgmz4JswqPw==</FileContentHash>
3434
<FileVersion></FileVersion>
3535
<Name>include/avr/ioavr128db48.h</Name>
3636
<SelectString></SelectString>
3737
<SourcePath></SourcePath>
3838
</d4p1:anyType>
3939
<d4p1:anyType i:type="FileInfo">
40-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.1.45\templates\main.c</AbsolutePath>
40+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\templates\main.c</AbsolutePath>
4141
<Attribute>template</Attribute>
4242
<Category>source</Category>
4343
<Condition>C Exe</Condition>
@@ -48,7 +48,7 @@
4848
<SourcePath></SourcePath>
4949
</d4p1:anyType>
5050
<d4p1:anyType i:type="FileInfo">
51-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.1.45\templates\main.cpp</AbsolutePath>
51+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\templates\main.cpp</AbsolutePath>
5252
<Attribute>template</Attribute>
5353
<Category>source</Category>
5454
<Condition>C Exe</Condition>
@@ -59,7 +59,7 @@
5959
<SourcePath></SourcePath>
6060
</d4p1:anyType>
6161
<d4p1:anyType i:type="FileInfo">
62-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.1.45\gcc\dev\avr128db48</AbsolutePath>
62+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48</AbsolutePath>
6363
<Attribute></Attribute>
6464
<Category>libraryPrefix</Category>
6565
<Condition>GCC</Condition>
@@ -71,8 +71,8 @@
7171
</d4p1:anyType>
7272
</Files>
7373
<PackName>AVR-Dx_DFP</PackName>
74-
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/AVR-Dx_DFP/1.1.45/Atmel.AVR-Dx_DFP.pdsc</PackPath>
75-
<PackVersion>1.1.45</PackVersion>
74+
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/AVR-Dx_DFP/1.3.67/Atmel.AVR-Dx_DFP.pdsc</PackPath>
75+
<PackVersion>1.3.67</PackVersion>
7676
<PresentInProject>true</PresentInProject>
7777
<ReferenceConditionId>AVR128DB48</ReferenceConditionId>
7878
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

avr128db48-constant-current-driver-using-opamp/avr128db48-constant-current-driver-using-opamp/avr128db48-constant-current-driver-using-opamp.cproj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
<OverrideVtor>false</OverrideVtor>
2121
<CacheFlash>true</CacheFlash>
2222
<ProgFlashFromRam>true</ProgFlashFromRam>
23-
<RamSnippetAddress />
23+
<RamSnippetAddress>0x20000000</RamSnippetAddress>
2424
<UncachedRange />
2525
<preserveEEPROM>true</preserveEEPROM>
26-
<OverrideVtorValue />
26+
<OverrideVtorValue>exception_table</OverrideVtorValue>
2727
<BootSegment>2</BootSegment>
2828
<ResetRule>0</ResetRule>
2929
<eraseonlaunchrule>0</eraseonlaunchrule>
@@ -40,11 +40,27 @@
4040
</dependencies>
4141
</framework-data>
4242
</AsfFrameworkConfig>
43+
<avrtool>com.atmel.avrdbg.tool.nedbg</avrtool>
44+
<avrtoolserialnumber>MCHP3094071800002768</avrtoolserialnumber>
45+
<avrdeviceexpectedsignature>0x1E970C</avrdeviceexpectedsignature>
46+
<avrtoolinterface>UPDI</avrtoolinterface>
47+
<com_atmel_avrdbg_tool_nedbg>
48+
<ToolOptions>
49+
<InterfaceProperties>
50+
<UpdiClock>750000</UpdiClock>
51+
</InterfaceProperties>
52+
<InterfaceName>UPDI</InterfaceName>
53+
</ToolOptions>
54+
<ToolType>com.atmel.avrdbg.tool.nedbg</ToolType>
55+
<ToolNumber>MCHP3094071800002768</ToolNumber>
56+
<ToolName>nEDBG</ToolName>
57+
</com_atmel_avrdbg_tool_nedbg>
58+
<avrtoolinterfaceclock>750000</avrtoolinterfaceclock>
4359
</PropertyGroup>
4460
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
4561
<ToolchainSettings>
4662
<AvrGcc>
47-
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\gcc\dev\avr128db48"</avrgcc.common.Device>
63+
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48"</avrgcc.common.Device>
4864
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
4965
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
5066
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
@@ -59,7 +75,7 @@
5975
</avrgcc.compiler.symbols.DefSymbols>
6076
<avrgcc.compiler.directories.IncludePaths>
6177
<ListValues>
62-
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\include</Value>
78+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
6379
</ListValues>
6480
</avrgcc.compiler.directories.IncludePaths>
6581
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
@@ -73,7 +89,7 @@
7389
</avrgcc.linker.libraries.Libraries>
7490
<avrgcc.assembler.general.IncludePaths>
7591
<ListValues>
76-
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\include</Value>
92+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
7793
</ListValues>
7894
</avrgcc.assembler.general.IncludePaths>
7995
</AvrGcc>
@@ -82,7 +98,7 @@
8298
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
8399
<ToolchainSettings>
84100
<AvrGcc>
85-
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\gcc\dev\avr128db48"</avrgcc.common.Device>
101+
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48"</avrgcc.common.Device>
86102
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
87103
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
88104
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
@@ -97,7 +113,7 @@
97113
</avrgcc.compiler.symbols.DefSymbols>
98114
<avrgcc.compiler.directories.IncludePaths>
99115
<ListValues>
100-
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\include</Value>
116+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
101117
</ListValues>
102118
</avrgcc.compiler.directories.IncludePaths>
103119
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
@@ -112,7 +128,7 @@
112128
</avrgcc.linker.libraries.Libraries>
113129
<avrgcc.assembler.general.IncludePaths>
114130
<ListValues>
115-
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.1.45\include</Value>
131+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
116132
</ListValues>
117133
</avrgcc.assembler.general.IncludePaths>
118134
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>

avr128db48-constant-current-driver-using-opamp/avr128db48-constant-current-driver-using-opamp/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ int main(void)
3232
OPAMP.TIMEBASE = 3; // Number of CLK_PER cycles that equal one us, minus one (4-1=3)
3333

3434
//Connect OP0 to wiper and pin connected to sense resistor
35-
OPAMP.OP0INMUX = OPAMP_MUXPOS_WIP_gc | OPAMP_MUXNEG_INN_gc;
35+
OPAMP.OP0INMUX = OPAMP_OP0INMUX_MUXPOS_WIP_gc | OPAMP_OP0INMUX_MUXNEG_INN_gc;
3636
//Connect resistor ladder to VDD and ground so the wiper functions as a voltage divider
37-
OPAMP.OP0RESMUX = OPAMP_MUXBOT_GND_gc | OPAMP_MUXWIP_WIP7_gc | OPAMP_MUXTOP_VDD_gc;
37+
OPAMP.OP0RESMUX = OPAMP_OP0RESMUX_MUXBOT_GND_gc | OPAMP_OP0RESMUX_MUXWIP_WIP7_gc | OPAMP_OP0RESMUX_MUXTOP_VDD_gc;
3838
// Configure OP0 Control A
39-
OPAMP.OP0CTRLA = OPAMP_OUTMODE_NORMAL_gc | OPAMP_ALWAYSON_bm;
39+
OPAMP.OP0CTRLA = OPAMP_OP0CTRLA_OUTMODE_NORMAL_gc | OPAMP_ALWAYSON_bm;
4040

4141
// Enable the OPAMP peripheral
4242
OPAMP.CTRLA = OPAMP_ENABLE_bm;

0 commit comments

Comments
 (0)