Skip to content

Commit

Permalink
MPAE-8430: Initial example code and readme added
Browse files Browse the repository at this point in the history
  • Loading branch information
carlehe committed Feb 2, 2021
1 parent dbb081b commit 55b70a2
Show file tree
Hide file tree
Showing 53 changed files with 8,309 additions and 39 deletions.
53 changes: 38 additions & 15 deletions .main-meta/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,67 @@
"metaDataVersion": "1.1.0",
"name": "com.microchip.mcu8.studio.project.avr128db48-low-bom-mic-interface-using-opamp-studio-start",
"version": "1.0.0",
"displayName": " ",
"displayName": "Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral",
"projectName": "avr128db48-low-bom-mic-interface-using-opamp-studio-start",
"shortDescription": "",
"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.",
"ide": {
"name": "STUDIO",
"semverRange": ""
"semverRange": ">=7.0.2542"
},
"compiler": [
{
"name": "",
"semverRange": ""
"name": "AVR GCC",
"semverRange": "^5.4.0"
}
],
"dfp": {
"name": "",
"semverRange": ""
"name": "AVR-Dx_DFP",
"semverRange": "^1.6.76"
},
"configurator": {
"name": "",
"semverRange": ""
"name": "START",
"semverRange": ">=1.8.491"
},
"device": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.portal.contentRef",
"content": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.device",
"name": "",
"name": "AVR128DB48",
"versionRange": "*"
}
},
"author": "",
"subcategories": [
],
"peripherals": [
"author": "Lloyd Clark",
"subcategories": [ "START",
[
"Peripherals", "OPAMP"
],
[
"Peripherals", "ADC"
],
[
"Peripherals", "AC"
],
[
"Development Kit", "AVR128DB48 Curiosity Nano"
]
],
"peripherals": [
"OPAMP", "ADC", "AC"
],
"keywords": [
],
"Analog Signal Conditioning",
"Operational Amplifier",
"Op Amp",
"Resistor Ladder",
"Electret Microphone",
"Adjustable Gain",
"Programmable Gain Amplifiers",
"Low BOM",
"PGA",
"low-bom-mic-interface-using-opamp"
],
"additionalData": {
"longDescription": {
"metaDataVersion": "1.0.0",
Expand Down
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
<!-- Please do not change this logo with link -->
[![MCHP](images/microchip.png)](https://www.microchip.com)
<!-- Please do not change this html logo with link -->
<a href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="300"/></a>

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

<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
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).
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).

## Related Documentation

<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
In addition a link to the device family landing page and relevant peripheral pages as well:
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
* [AN3631 - Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral](https://microchip.com/DS00003631)
* [AVR128DB48 Curiosity Nano User Guide](https://www.microchip.com/DS50003037)
* [AVR128DB48 Device Page](https://www.microchip.com/wwwproducts/en/AVR128DB48)

## Software Used

<!-- All software used in this example must be listed here. Use unbreakable links!
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
- 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)
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
* [Microchip Studio](https://www.microchip.com/mplab/avr-support/atmel-studio-7) 7.0.2542 or later
* Microchip Studio AVR-Dx_DFP version 1.6.76 or later
* 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)

## Hardware Used

<!-- All hardware used in this example must be listed here. Use unbreakable links!
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
* [AVR128DB48 Curiosity Nano](https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/EV35L43A)
* Electret microphone
* One 2.2kΩ resistor
* One 1µF capacitor

## Setup

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

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

<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->

## Summary
## Conclusion
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.

<!-- Summarize what the example has shown -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AVR = Debug|AVR
Release|AVR = Release|AVR
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<environment>
<configurations>
<configuration environment="Atmel Studio" name="All" version="7.0.0">
<linker-config>
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
<value>
</value>
</option>
</linker-config>
<linker-script-config />
<compiler-config>
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
<value>-std=gnu99</value>
</option>
</compiler-config>
</configuration>
<configuration environment="Microchip Studio xc8" name="Release" version="7.0.0">
<linker-config>
<option id="xc8_linker_miscellaneous_LinkerFlags" name="xc8-linker-miscellaneous-LinkerFlags">
<value>
</value>
</option>
</linker-config>
<linker-script-config />
<compiler-config>
<option id="xc8_compiler_miscellaneous_OtherFlags" name="xc8-compiler-miscellaneous-OtherFlags">
<value>-std=gnu99</value>
</option>
</compiler-config>
</configuration>
<configuration environment="Microchip Studio xc8" name="Debug" version="7.0.0">
<linker-config>
<option id="xc8_linker_miscellaneous_LinkerFlags" name="xc8-linker-miscellaneous-LinkerFlags">
<value>
</value>
</option>
</linker-config>
<linker-script-config />
<compiler-config>
<option id="xc8_compiler_miscellaneous_OtherFlags" name="xc8-compiler-miscellaneous-OtherFlags">
<value>-std=gnu99</value>
</option>
</compiler-config>
</configuration>
<configuration environment="Microchip Studio gcc" name="Release" version="7.0.0">
<linker-config>
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
<value>
</value>
</option>
</linker-config>
<linker-script-config />
<compiler-config>
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
<value>-std=gnu99</value>
</option>
</compiler-config>
</configuration>
<configuration environment="Microchip Studio gcc" name="Debug" version="7.0.0">
<linker-config>
<option id="avrgcc_linker_miscellaneous_LinkerFlags" name="avrgcc-linker-miscellaneous-LinkerFlags">
<value>
</value>
</option>
</linker-config>
<linker-script-config />
<compiler-config>
<option id="avrgcc_compiler_miscellaneous_OtherFlags" name="avrgcc-compiler-miscellaneous-OtherFlags">
<value>-std=gnu99</value>
</option>
</compiler-config>
</configuration>
</configurations>
<device-packs>
<device-pack device="AVR128DB48" name="AVR-Dx_DFP" vendor="Atmel" version="1.6.76" />
</device-packs>
</environment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
<vendor>Atmel</vendor>
<name>My Project</name>
<description>Project generated by Atmel Start</description>
<url>http://start.atmel.com/</url>
<releases>
<release version="1.0.1">Initial version</release>
</releases>
<taxonomy>
<description Cclass="AtmelStart" generator="AtmelStart">Configuration Files generated by Atmel Start</description>
</taxonomy>
<generators>
<generator id="AtmelStart">
<description>Atmel Start</description>
<select Dname="AVR128DB48" Dvendor="Atmel:3"/>
<command>http://start.atmel.com/</command>
<files>
<file category="generator" name="atmel_start_config.atstart"/>
<file attr="template" category="other" name="AtmelStart.env_conf" select="Environment configuration"/>
</files>
</generator>
</generators>
<conditions>
<condition id="AVR Device Startup">
<description>Dependency on Device Startup components</description>
<require Cclass="Device" Cgroup="Startup" Cversion="1.6.0"/>
</condition>
<condition id="ARMCC, GCC, IAR, XC8">
<require Dname="AVR128DB48"/>
<accept Tcompiler="ARMCC"/>
<accept Tcompiler="GCC"/>
<accept Tcompiler="IAR"/>
<accept Tcompiler="XC8"/>
</condition>
</conditions>
<components generator="AtmelStart">
<component Cclass="AtmelStart" Cgroup="Framework" Cversion="1.0.0" condition="AVR Device Startup">
<description>Atmel Start Framework</description>
<RTE_Components_h>#define ATMEL_START</RTE_Components_h>
<files>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/DoxygenLayout.xml"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/doxyfile.doxygen"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/mainpage.dox"/>
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/bod/doc/bod.rst"/>
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/clkctrl/doc/clkctrl.rst"/>
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/cpuint/doc/cpuint.rst"/>
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/opamp/doc/opamp.rst"/>
<file category="doc" condition="ARMCC, GCC, IAR, XC8" name="modules/slpctrl/doc/slpctrl.rst"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="main.c"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/driver_init.c"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/driver_init.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/atmel_start_pins.h"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="driver_isr.c"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/mainpage.dox"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/doxyfile.doxygen"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/generator/DoxygenLayout.xml"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/opamp.dox"/>
<file category="other" condition="ARMCC, GCC, IAR, XC8" name="doxygen/system.dox"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/bod.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/ccp.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/clkctrl.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/cpuint.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/opamp_basic.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/port.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/protected_io.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/rstctrl.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/slpctrl.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="include/system.h"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/bod.c"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/clkctrl.c"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/cpuint.c"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/opamp_basic.c"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/protected_io.S"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="src/slpctrl.c"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler/gas.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler/iar.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/atomic.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/compiler.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/interrupt_avr8.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/utils.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="utils/utils_assert.h"/>
<file category="header" condition="ARMCC, GCC, IAR, XC8" name="atmel_start.h"/>
<file category="source" condition="ARMCC, GCC, IAR, XC8" name="atmel_start.c"/>
<file attr="config" category="header" condition="ARMCC, GCC, IAR, XC8" name="config/clock_config.h"/>
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="config"/>
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="include"/>
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="utils"/>
<file category="include" condition="ARMCC, GCC, IAR, XC8" name="utils/assembler"/>
<file category="include" condition="ARMCC, GCC, IAR, XC8" name=""/>
</files>
</component>
</components>
</package>
Loading

0 comments on commit 55b70a2

Please sign in to comment.