Skip to content

Commit b0b6e99

Browse files
committed
MPAE-2241 adding source code
1 parent 7ff14ae commit b0b6e99

18 files changed

+1216
-45
lines changed

.main-meta/main.json

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
"category": "com.microchip.ide.project",
44
"content": {
55
"metaDataVersion": "1.1.0",
6-
"name": "com.microchip.mcu8.studio.project.",
7-
"version": " ",
8-
"displayName": " ",
9-
"projectName": "",
10-
"shortDescription": "",
6+
"name": "com.microchip.mcu8.studio.project.avr128db48-getting-started-with-mvio",
7+
"version": "1.0.0",
8+
"displayName": "Getting Started With MVIO",
9+
"projectName": "avr128db48-getting-started-with-mvio",
10+
"shortDescription": "These Atmel Studio 7 bare metal examples in Getting Started with Multi Voltage I/O (MVIO) (TB3287) show how the MVIO is used on the AVR® DB family of microcontrollers.  The MVIO peripheral allows a subset of the I/O pins to be powered by a different I/O voltage domain VDDIO2, eliminating the need for external level shifters.",
1111
"ide": {
12-
"name": "",
13-
"semverRange": ""
12+
"name": "Studio",
13+
"semverRange": ">=7.0.2397"
1414
},
1515
"compiler": [
1616
{
17-
"name": "",
18-
"semverRange": ""
17+
"name": "AVR-GCC",
18+
"semverRange": "^5.4.0"
1919
}
2020
],
2121
"dfp": {
22-
"name": "",
23-
"semverRange": ""
22+
"name": "AVR-Dx_DFP",
23+
"semverRange": "^1.3.67"
2424
},
2525
"configurator": {
26-
"name": "",
26+
"name": "N/A",
2727
"semverRange": ""
2828
},
2929
"device": {
@@ -32,26 +32,36 @@
3232
"content": {
3333
"metaDataVersion": "1.0.0",
3434
"category": "com.microchip.device",
35-
"name": "",
35+
"name": "AVR128DB48",
3636
"versionRange": "*"
3737
}
3838
},
39-
"author": "",
39+
"author": "Microchip",
4040
"subcategories": [
41-
"",
4241
[
43-
"Peripherals", ""
42+
"Peripherals", "MVIO"
43+
],
44+
[
45+
"Peripherals", "ADC"
4446
],
4547
[
46-
"Peripherals", ""
48+
"Development Kit", "AVR128DB48 Curiosity Nano"
4749
]
4850
],
4951
"peripherals": [
50-
"",""
52+
"MVIO","ADC"
5153
],
5254
"keywords": [
53-
"",
54-
""
55+
"Getting Started",
56+
"Multi Voltage Io",
57+
"Led Blink",
58+
"Multi Power Domain",
59+
"Power Monitor",
60+
"VDDIO2",
61+
"Interrupt",
62+
"AVR-DB",
63+
"AVRDB",
64+
"avr128db48-getting-started-with-mvio"
5565
],
5666
"additionalData": {
5767
"longDescription": {

README.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,55 @@
1-
<!-- Please do not change this html logo with link -->
2-
<a href="https://www.microchip.com" rel="nofollow"><img src="images/Microchip.png" alt="MCHP" width="300"/></a>
1+
<a href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="300"/></a>
32

4-
# Update the title for avr128db48-getting-started-with-mvio here
3+
# Getting Started with Multi Voltage I/O (MVIO)
54

6-
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
5+
A new feature introduced in the AVR® DB Family is the Multi-Voltage I/O (MVIO) peripheral. In this example, VDDIO2 supplies a different voltage level PORTC, than on the rest of the PORTs, which are supplied by VDD. It is possible to monitor this voltage level with the internal analog-to-digital converter (ADC) and also possible to get an interrupt when the voltage level for the MVIO, called VDDIO2, goes in and out of acceptable voltage range.
76

7+
<a><img src="images/overview.png" alt="overview" width="800"/></a>
8+
9+
These examples show how the Multi-Voltage I/O feature works on the AVR DB family of microcontrollers. It
10+
covers the following use cases:
11+
12+
* **Polling VDDIO2 Status**:
13+
Checking if the VDDIO2 voltage is within acceptable range by reading the Status bit.
14+
* **Interrupt on VDDIO2 Status**:
15+
Make use of the interrupt that occurs when the Status bit changes state.
16+
* **Measuring VDDIO2**:
17+
Use the internal ADC to measure the VDDIO2 voltage.
18+
* **Blink a 3V LED with VDD at 1.8V**:
19+
Basic example of MVIO blinking an LED with forward voltage higher than VDD.
820
## Related Documentation
921

10-
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
11-
In addition a link to the device family landing page and relevant peripheral pages as well:
12-
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
13-
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
22+
* [TB3287 - Getting Started With MVIO](https://microchip.com/DS90003287)
23+
* [AVR128DB48 device page](https://www.microchip.com/wwwproducts/en/AVR128DB48)
24+
* [AVR128DB48 Curiosity Nano User Guide](https://www.microchip.com/DS50003037)
1425

1526
## Software Used
1627

17-
<!-- All software used in this example must be listed here. Use unbreakable links!
18-
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
19-
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
20-
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
21-
- MPLAB® Code Configurator (MCC) Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
22-
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
28+
* [Atmel Studio](https://www.microchip.com/mplab/avr-support/atmel-studio-7) 7.0.2397 or later
29+
* Atmel Studio AVR-Dx_DFP version 1.3.67 or later
30+
* For the MPLAB® X version of these projects, please go to [this repository](https://github.com/microchip-pic-avr-examples/avr128db48-getting-started-with-mvio-mplab)
2331

2432
## Hardware Used
2533

26-
<!-- All hardware used in this example must be listed here. Use unbreakable links!
27-
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
28-
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
29-
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
34+
* [AVR128DB48 Curiosity Nano](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/EV35L43A)
35+
* One >15Ω resistor
36+
* One LED with forward voltage of ~3V
3037

3138
## Setup
3239

33-
<!-- Explain how to connect hardware and set up software. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
40+
* Connect the hardware together as seen in the schematic of the [application note](https://microchip.com/DS90003287)
3441

3542
## Operation
36-
37-
<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
38-
39-
## Summary
40-
41-
<!-- Summarize what the example has shown -->
43+
* Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
44+
* Download the zip file or clone the example to get the source code
45+
* Open the .atsln file with Atmel Studio
46+
* Right-click on the project you want to run and choose "Set as StartUp Project"
47+
* Press *Start Without Debugging* (CTRL+ALT+F5) to run the application
48+
49+
## Changing Voltage
50+
Drag and drop one of the following files to the "Curiosity" disc on your computer:
51+
* VDD1V8.txt - Sets voltage to 1.8V
52+
* VDD3V3.txt - Sets voltage to 3.3V
53+
54+
## Conclusion
55+
After going through this example, you should have a better understanding of how to set up the MVIO peripheral to utilize the internal level shifters to communicate with and drive external components.

VDD1V8.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CMD:1V8

VDD3V3.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CMD:3V3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
3+
<ProjectComponents>
4+
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
5+
<CApiVersion></CApiVersion>
6+
<CBundle></CBundle>
7+
<CClass>Device</CClass>
8+
<CGroup>Startup</CGroup>
9+
<CSub></CSub>
10+
<CVariant></CVariant>
11+
<CVendor>Atmel</CVendor>
12+
<CVersion>1.3.0</CVersion>
13+
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
14+
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
15+
<Description></Description>
16+
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
17+
<d4p1:anyType i:type="FileInfo">
18+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\include\</AbsolutePath>
19+
<Attribute></Attribute>
20+
<Category>include</Category>
21+
<Condition>C</Condition>
22+
<FileContentHash i:nil="true" />
23+
<FileVersion></FileVersion>
24+
<Name>include/</Name>
25+
<SelectString></SelectString>
26+
<SourcePath></SourcePath>
27+
</d4p1:anyType>
28+
<d4p1:anyType i:type="FileInfo">
29+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\include\avr\ioavr128db48.h</AbsolutePath>
30+
<Attribute></Attribute>
31+
<Category>header</Category>
32+
<Condition>C</Condition>
33+
<FileContentHash>cKZGjdWnZfqdgmz4JswqPw==</FileContentHash>
34+
<FileVersion></FileVersion>
35+
<Name>include/avr/ioavr128db48.h</Name>
36+
<SelectString></SelectString>
37+
<SourcePath></SourcePath>
38+
</d4p1:anyType>
39+
<d4p1:anyType i:type="FileInfo">
40+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\templates\main.c</AbsolutePath>
41+
<Attribute>template</Attribute>
42+
<Category>source</Category>
43+
<Condition>C Exe</Condition>
44+
<FileContentHash>KjvOcFWd++tbnsEMfVPd/w==</FileContentHash>
45+
<FileVersion></FileVersion>
46+
<Name>templates/main.c</Name>
47+
<SelectString>Main file (.c)</SelectString>
48+
<SourcePath></SourcePath>
49+
</d4p1:anyType>
50+
<d4p1:anyType i:type="FileInfo">
51+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\templates\main.cpp</AbsolutePath>
52+
<Attribute>template</Attribute>
53+
<Category>source</Category>
54+
<Condition>C Exe</Condition>
55+
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</FileContentHash>
56+
<FileVersion></FileVersion>
57+
<Name>templates/main.cpp</Name>
58+
<SelectString>Main file (.cpp)</SelectString>
59+
<SourcePath></SourcePath>
60+
</d4p1:anyType>
61+
<d4p1:anyType i:type="FileInfo">
62+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48</AbsolutePath>
63+
<Attribute></Attribute>
64+
<Category>libraryPrefix</Category>
65+
<Condition>GCC</Condition>
66+
<FileContentHash i:nil="true" />
67+
<FileVersion></FileVersion>
68+
<Name>gcc/dev/avr128db48</Name>
69+
<SelectString></SelectString>
70+
<SourcePath></SourcePath>
71+
</d4p1:anyType>
72+
</Files>
73+
<PackName>AVR-Dx_DFP</PackName>
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>
76+
<PresentInProject>true</PresentInProject>
77+
<ReferenceConditionId>AVR128DB48</ReferenceConditionId>
78+
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
79+
<d4p1:string></d4p1:string>
80+
</RteComponents>
81+
<Status>Resolved</Status>
82+
<VersionMode>Latest</VersionMode>
83+
<IsComponentInAtProject>true</IsComponentInAtProject>
84+
</ProjectComponent>
85+
</ProjectComponents>
86+
</Store>
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
3+
<PropertyGroup>
4+
<SchemaVersion>2.0</SchemaVersion>
5+
<ProjectVersion>7.0</ProjectVersion>
6+
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
7+
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
8+
<avrdevice>AVR128DB48</avrdevice>
9+
<avrdeviceseries>none</avrdeviceseries>
10+
<OutputType>Executable</OutputType>
11+
<Language>C</Language>
12+
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
13+
<OutputFileExtension>.elf</OutputFileExtension>
14+
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
15+
<AssemblyName>blinking-a-3v0-led-with-vdd-at-1v8</AssemblyName>
16+
<Name>blinking-a-3v0-led-with-vdd-at-1v8</Name>
17+
<RootNamespace>blinking-a-3v0-led-with-vdd-at-1v8</RootNamespace>
18+
<ToolchainFlavour>Native</ToolchainFlavour>
19+
<KeepTimersRunning>true</KeepTimersRunning>
20+
<OverrideVtor>false</OverrideVtor>
21+
<CacheFlash>true</CacheFlash>
22+
<ProgFlashFromRam>true</ProgFlashFromRam>
23+
<RamSnippetAddress />
24+
<UncachedRange />
25+
<preserveEEPROM>true</preserveEEPROM>
26+
<OverrideVtorValue />
27+
<BootSegment>2</BootSegment>
28+
<ResetRule>0</ResetRule>
29+
<eraseonlaunchrule>0</eraseonlaunchrule>
30+
<EraseKey />
31+
<AsfFrameworkConfig>
32+
<framework-data xmlns="">
33+
<options />
34+
<configurations />
35+
<files />
36+
<documentation help="" />
37+
<offline-documentation help="" />
38+
<dependencies>
39+
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.47.0" />
40+
</dependencies>
41+
</framework-data>
42+
</AsfFrameworkConfig>
43+
</PropertyGroup>
44+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
45+
<ToolchainSettings>
46+
<AvrGcc>
47+
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48"</avrgcc.common.Device>
48+
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
49+
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
50+
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
51+
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
52+
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
53+
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
54+
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
55+
<avrgcc.compiler.symbols.DefSymbols>
56+
<ListValues>
57+
<Value>NDEBUG</Value>
58+
</ListValues>
59+
</avrgcc.compiler.symbols.DefSymbols>
60+
<avrgcc.compiler.directories.IncludePaths>
61+
<ListValues>
62+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
63+
</ListValues>
64+
</avrgcc.compiler.directories.IncludePaths>
65+
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
66+
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
67+
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
68+
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
69+
<avrgcc.linker.libraries.Libraries>
70+
<ListValues>
71+
<Value>libm</Value>
72+
</ListValues>
73+
</avrgcc.linker.libraries.Libraries>
74+
<avrgcc.assembler.general.IncludePaths>
75+
<ListValues>
76+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
77+
</ListValues>
78+
</avrgcc.assembler.general.IncludePaths>
79+
</AvrGcc>
80+
</ToolchainSettings>
81+
</PropertyGroup>
82+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
83+
<ToolchainSettings>
84+
<AvrGcc>
85+
<avrgcc.common.Device>-mmcu=avr128db48 -B "%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\gcc\dev\avr128db48"</avrgcc.common.Device>
86+
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
87+
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
88+
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
89+
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
90+
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
91+
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
92+
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
93+
<avrgcc.compiler.symbols.DefSymbols>
94+
<ListValues>
95+
<Value>DEBUG</Value>
96+
</ListValues>
97+
</avrgcc.compiler.symbols.DefSymbols>
98+
<avrgcc.compiler.directories.IncludePaths>
99+
<ListValues>
100+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
101+
</ListValues>
102+
</avrgcc.compiler.directories.IncludePaths>
103+
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
104+
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
105+
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
106+
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
107+
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
108+
<avrgcc.linker.libraries.Libraries>
109+
<ListValues>
110+
<Value>libm</Value>
111+
</ListValues>
112+
</avrgcc.linker.libraries.Libraries>
113+
<avrgcc.assembler.general.IncludePaths>
114+
<ListValues>
115+
<Value>%24(PackRepoDir)\Atmel\AVR-Dx_DFP\1.3.67\include\</Value>
116+
</ListValues>
117+
</avrgcc.assembler.general.IncludePaths>
118+
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
119+
</AvrGcc>
120+
</ToolchainSettings>
121+
</PropertyGroup>
122+
<ItemGroup>
123+
<Compile Include="main.c">
124+
<SubType>compile</SubType>
125+
</Compile>
126+
</ItemGroup>
127+
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
128+
</Project>

0 commit comments

Comments
 (0)