Skip to content

Commit 55b70a2

Browse files
committed
MPAE-8430: Initial example code and readme added
1 parent dbb081b commit 55b70a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+8309
-39
lines changed

.main-meta/main.json

+38-15
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,67 @@
55
"metaDataVersion": "1.1.0",
66
"name": "com.microchip.mcu8.studio.project.avr128db48-low-bom-mic-interface-using-opamp-studio-start",
77
"version": "1.0.0",
8-
"displayName": " ",
8+
"displayName": "Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral",
99
"projectName": "avr128db48-low-bom-mic-interface-using-opamp-studio-start",
10-
"shortDescription": "",
10+
"shortDescription": "This Atmel START 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.",
1111
"ide": {
1212
"name": "STUDIO",
13-
"semverRange": ""
13+
"semverRange": ">=7.0.2542"
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.6.76"
2424
},
2525
"configurator": {
26-
"name": "",
27-
"semverRange": ""
26+
"name": "START",
27+
"semverRange": ">=1.8.491"
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": "AVR128DB48",
3636
"versionRange": "*"
3737
}
3838
},
39-
"author": "",
40-
"subcategories": [
41-
],
42-
"peripherals": [
39+
"author": "Lloyd Clark",
40+
"subcategories": [ "START",
41+
[
42+
"Peripherals", "OPAMP"
43+
],
44+
[
45+
"Peripherals", "ADC"
46+
],
47+
[
48+
"Peripherals", "AC"
49+
],
50+
[
51+
"Development Kit", "AVR128DB48 Curiosity Nano"
52+
]
53+
],
54+
"peripherals": [
55+
"OPAMP", "ADC", "AC"
4356
],
4457
"keywords": [
45-
],
58+
"Analog Signal Conditioning",
59+
"Operational Amplifier",
60+
"Op Amp",
61+
"Resistor Ladder",
62+
"Electret Microphone",
63+
"Adjustable Gain",
64+
"Programmable Gain Amplifiers",
65+
"Low BOM",
66+
"PGA",
67+
"low-bom-mic-interface-using-opamp"
68+
],
4669
"additionalData": {
4770
"longDescription": {
4871
"metaDataVersion": "1.0.0",

README.md

+25-24
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
1-
<!-- Please do not change this logo with link -->
2-
[![MCHP](images/microchip.png)](https://www.microchip.com)
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>
33

4-
# Update the title for avr128db48-low-bom-mic-interface-using-opamp-studio-start 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 family of microcontrollers (MCUs) is the Analog Signal Conditioning (OPAMP) peripheral. In this example, the OPAMP peripheral 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 MCU or converted to a digital signal by the MCU’s analog-to-digital converter (ADC).
10+
Up to 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+
* [Microchip Studio](https://www.microchip.com/mplab/avr-support/atmel-studio-7) 7.0.2542 or later
20+
* Microchip Studio AVR-Dx_DFP version 1.6.76 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 Microchip 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 -->
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-studio-start", "avr128db48-low-bom-mic-interface-using-opamp-studio-start\avr128db48-low-bom-mic-interface-using-opamp-studio-start.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,77 @@
1+
<environment>
2+
<configurations>
3+
<configuration environment="Atmel Studio" name="All" version="7.0.0">
4+
<linker-config>
5+
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
6+
<value>
7+
</value>
8+
</option>
9+
</linker-config>
10+
<linker-script-config />
11+
<compiler-config>
12+
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
13+
<value>-std=gnu99</value>
14+
</option>
15+
</compiler-config>
16+
</configuration>
17+
<configuration environment="Microchip Studio xc8" name="Release" version="7.0.0">
18+
<linker-config>
19+
<option id="xc8_linker_miscellaneous_LinkerFlags" name="xc8-linker-miscellaneous-LinkerFlags">
20+
<value>
21+
</value>
22+
</option>
23+
</linker-config>
24+
<linker-script-config />
25+
<compiler-config>
26+
<option id="xc8_compiler_miscellaneous_OtherFlags" name="xc8-compiler-miscellaneous-OtherFlags">
27+
<value>-std=gnu99</value>
28+
</option>
29+
</compiler-config>
30+
</configuration>
31+
<configuration environment="Microchip Studio xc8" name="Debug" version="7.0.0">
32+
<linker-config>
33+
<option id="xc8_linker_miscellaneous_LinkerFlags" name="xc8-linker-miscellaneous-LinkerFlags">
34+
<value>
35+
</value>
36+
</option>
37+
</linker-config>
38+
<linker-script-config />
39+
<compiler-config>
40+
<option id="xc8_compiler_miscellaneous_OtherFlags" name="xc8-compiler-miscellaneous-OtherFlags">
41+
<value>-std=gnu99</value>
42+
</option>
43+
</compiler-config>
44+
</configuration>
45+
<configuration environment="Microchip Studio gcc" name="Release" version="7.0.0">
46+
<linker-config>
47+
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
48+
<value>
49+
</value>
50+
</option>
51+
</linker-config>
52+
<linker-script-config />
53+
<compiler-config>
54+
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
55+
<value>-std=gnu99</value>
56+
</option>
57+
</compiler-config>
58+
</configuration>
59+
<configuration environment="Microchip Studio gcc" name="Debug" version="7.0.0">
60+
<linker-config>
61+
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
62+
<value>
63+
</value>
64+
</option>
65+
</linker-config>
66+
<linker-script-config />
67+
<compiler-config>
68+
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
69+
<value>-std=gnu99</value>
70+
</option>
71+
</compiler-config>
72+
</configuration>
73+
</configurations>
74+
<device-packs>
75+
<device-pack device="AVR128DB48" name="AVR-Dx_DFP" vendor="Atmel" version="1.6.76" />
76+
</device-packs>
77+
</environment>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
2+
<vendor>Atmel</vendor>
3+
<name>My Project</name>
4+
<description>Project generated by Atmel Start</description>
5+
<url>http://start.atmel.com/</url>
6+
<releases>
7+
<release version="1.0.1">Initial version</release>
8+
</releases>
9+
<taxonomy>
10+
<description Cclass="AtmelStart" generator="AtmelStart">Configuration Files generated by Atmel Start</description>
11+
</taxonomy>
12+
<generators>
13+
<generator id="AtmelStart">
14+
<description>Atmel Start</description>
15+
<select Dname="AVR128DB48" Dvendor="Atmel:3"/>
16+
<command>http://start.atmel.com/</command>
17+
<files>
18+
<file category="generator" name="atmel_start_config.atstart"/>
19+
<file attr="template" category="other" name="AtmelStart.env_conf" select="Environment configuration"/>
20+
</files>
21+
</generator>
22+
</generators>
23+
<conditions>
24+
<condition id="AVR Device Startup">
25+
<description>Dependency on Device Startup components</description>
26+
<require Cclass="Device" Cgroup="Startup" Cversion="1.6.0"/>
27+
</condition>
28+
<condition id="ARMCC, GCC, IAR, XC8">
29+
<require Dname="AVR128DB48"/>
30+
<accept Tcompiler="ARMCC"/>
31+
<accept Tcompiler="GCC"/>
32+
<accept Tcompiler="IAR"/>
33+
<accept Tcompiler="XC8"/>
34+
</condition>
35+
</conditions>
36+
<components generator="AtmelStart">
37+
<component Cclass="AtmelStart" Cgroup="Framework" Cversion="1.0.0" condition="AVR Device Startup">
38+
<description>Atmel Start Framework</description>
39+
<RTE_Components_h>#define ATMEL_START</RTE_Components_h>
40+
<files>
41+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/DoxygenLayout.xml"/>
42+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/doxyfile.doxygen"/>
43+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/mainpage.dox"/>
44+
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/bod/doc/bod.rst"/>
45+
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/clkctrl/doc/clkctrl.rst"/>
46+
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/cpuint/doc/cpuint.rst"/>
47+
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/opamp/doc/opamp.rst"/>
48+
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/slpctrl/doc/slpctrl.rst"/>
49+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="main.c"/>
50+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/driver_init.c"/>
51+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/driver_init.h"/>
52+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/atmel_start_pins.h"/>
53+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="driver_isr.c"/>
54+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/mainpage.dox"/>
55+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/doxyfile.doxygen"/>
56+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/DoxygenLayout.xml"/>
57+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/opamp.dox"/>
58+
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/system.dox"/>
59+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/bod.h"/>
60+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/ccp.h"/>
61+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/clkctrl.h"/>
62+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/cpuint.h"/>
63+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/opamp_basic.h"/>
64+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/port.h"/>
65+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/protected_io.h"/>
66+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/rstctrl.h"/>
67+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/slpctrl.h"/>
68+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/system.h"/>
69+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/bod.c"/>
70+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/clkctrl.c"/>
71+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/cpuint.c"/>
72+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/opamp_basic.c"/>
73+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/protected_io.S"/>
74+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/slpctrl.c"/>
75+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler.h"/>
76+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler/gas.h"/>
77+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler/iar.h"/>
78+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/atomic.h"/>
79+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/compiler.h"/>
80+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/interrupt_avr8.h"/>
81+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/utils.h"/>
82+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/utils_assert.h"/>
83+
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="atmel_start.h"/>
84+
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="atmel_start.c"/>
85+
<file attr="config" category="header" condition="ARMCC, GCC, IAR, XC8" name="config/clock_config.h"/>
86+
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="config"/>
87+
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="include"/>
88+
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="utils"/>
89+
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler"/>
90+
<file category="include" condition="ARMCC, GCC, IAR, XC8" name=""/>
91+
</files>
92+
</component>
93+
</components>
94+
</package>

0 commit comments

Comments
 (0)