Skip to content

Commit 906671c

Browse files
committed
MPAE-3074 adding code example
1 parent 6103ccb commit 906671c

File tree

7 files changed

+379
-45
lines changed

7 files changed

+379
-45
lines changed

.main-meta/main.json

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,71 @@
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-low-bom-mic-interface-using-opamp",
7+
"version": "1.0.0",
8+
"displayName": "Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral",
9+
"projectName": "avr128db48-low-bom-mic-interface-using-opamp",
10+
"shortDescription": "This Atmel Studio 7 bare metal example in Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) (AN3631) shows how to interface an electret microphone with a microcontroller (MCU) using the OPAMP. In addition to the microphone, only one resistor and one capacitor are required. The OPAMP also provides the ability to adjust the gain under firmware control.",
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
},
25-
"configurator": {
26-
"name": "",
25+
"configurator": {
26+
"name": "N/A",
2727
"semverRange": ""
28-
},
28+
},
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": "AVR128DB48",
3636
"versionRange": "*"
3737
}
3838
},
39-
"author": "",
39+
"author": "Microchip",
4040
"subcategories": [
41-
"",
4241
[
43-
"Peripherals", ""
42+
"Peripherals", "OPAMP"
43+
],
44+
[
45+
"Peripherals", "ADC"
46+
],
47+
[
48+
"Peripherals", "AC"
4449
],
4550
[
46-
"Peripherals", ""
51+
"Development Kit", "AVR128DB48 Curiosity Nano"
4752
]
4853
],
4954
"peripherals": [
50-
"",""
55+
"OPAMP", "ADC", "AC"
5156
],
5257
"keywords": [
53-
"",
54-
""
58+
"Analog Signal Conditioning",
59+
"Operational Amplifier",
60+
"Op Amp",
61+
"Resistor Ladder",
62+
"Electret Microphone",
63+
"Amplifier",
64+
"Adjustable Gain",
65+
"Programmable Gain",
66+
"Low BOM",
67+
"PGA",
68+
"AVR-DB",
69+
"AVRDB",
70+
"low-bom-mic-interface-using-opamp"
5571
],
5672
"additionalData": {
5773
"longDescription": {

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
<!-- 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>
2+
<a href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="300"/></a>
33

4-
# Update the title for avr128db48-low-bom-mic-interface-using-opamp here
4+
# Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral
5+
<p align="left">
6+
<img width=800px height=auto src="images/setup.png">
7+
</p>
58

6-
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
9+
A new feature introduced in the AVR® DB MCU is the Analog Signal Conditioning (OPAMP) peripheral. In this example, the OPAMP is used to amplify a weak signal up to the 100-millivolt range so that it can be detected by an analog comparator in the microcontroller (MCU) or converted to a digital signal by the MCU’s analog-to-digital converter (ADC).
10+
Three internal op amps are available for configuration in the AVR DB. The configuration for this example can be seen in the figure above. Including the MCU the setup uses an external electret microphone, a resistor, and a capacitor. For more information about setup and code, see the [application note](https://microchip.com/DS00003631).
711

812
## Related Documentation
913

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) -->
14+
* [AN3631 - Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral](https://microchip.com/DS00003631)
15+
* [AVR128DB48 Curiosity Nano User Guide](https://www.microchip.com/DS50003037)
16+
* [AVR128DB48 Device Page](https://www.microchip.com/wwwproducts/en/AVR128DB48)
1417

1518
## Software Used
16-
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/) -->
19+
* [Atmel Studio](https://www.microchip.com/mplab/avr-support/atmel-studio-7) 7.0.2397 or later
20+
* Atmel Studio AVR-Dx_DFP version 1.3.67 or later
21+
* For the MPLAB X version of this project, please go to [this repository](https://github.com/microchip-pic-avr-examples/avr128db48-low-bom-mic-interface-using-opamp-mplab)
2322

2423
## Hardware Used
2524

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) -->
25+
* [AVR128DB48 Curiosity Nano](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/EV35L43A)
26+
* Electret microphone
27+
* One 2.2kΩ resistor
28+
* One 1µF capacitor
3029

3130
## Setup
3231

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 -->
32+
* Connect the hardware together as seen in the schematic of the application note
3433

3534
## Operation
35+
* Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
36+
* Download the zip file or clone the example to get the source code
37+
* Open the .atsln file with Atmel Studio
38+
* Press *Start Without Debugging* (CTRL+ALT+F5) to run the application
3639

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+
## Conclusion
41+
After going through this example, you should have a better understanding of how to set up the OPAMP peripheral to amplify weak signals from sensors into detectable signals for the MCU.
4042

41-
<!-- Summarize what the example has shown -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+

2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Atmel Studio Solution File, Format Version 11.00
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "avr128db48-low-bom-mic-interface-using-opamp", "avr128db48-low-bom-mic-interface-using-opamp\avr128db48-low-bom-mic-interface-using-opamp.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|AVR = Debug|AVR
11+
Release|AVR = Release|AVR
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
15+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
16+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
17+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
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>

0 commit comments

Comments
 (0)