Skip to content

Commit

Permalink
MPAE-8587: 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 46f4b4d commit db47f58
Show file tree
Hide file tree
Showing 31 changed files with 13,136 additions and 32 deletions.
47 changes: 35 additions & 12 deletions .main-meta/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,67 @@
"content": {
"metaDataVersion": "1.1.0",
"name": "com.microchip.mcu8.mplabx.project.avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc",
"version": "",
"displayName": "",
"version": "1.0.0",
"displayName": "Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral",
"projectName": "avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc",
"shortDescription": "",
"shortDescription": "This Microchip MCC 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": "MPLAB X",
"semverRange": ""
"semverRange": ">=5.40.0"
},
"compiler": [
{
"name": "XC8",
"semverRange": ""
"semverRange": "^2.31.0"
}
],
"dfp": {
"name": "",
"semverRange": ""
"name": "AVR-Dx_DFP",
"semverRange": "^1.6.88"
},
"configurator": {
"name": "",
"semverRange": ""
"name": "MCC",
"semverRange": ">=4.0.0"
},
"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": [
"author": "Lloyd Clark",
"subcategories": [ "MCC",
[
"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": {
Expand Down
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
<!-- Please do not change this logo with link -->
[![MCHP](images/microchip.png)](https://www.microchip.com)

# Update the title for avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc 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/) -->
* [MPLAB® X IDE](http://www.microchip.com/mplab/mplab-x-ide) 5.40 or newer
* [MPLAB® XC8](http://www.microchip.com/mplab/compilers) 2.31 or a newer compiler
* [MPLAB® Code Configurator (MCC)](https://www.microchip.com/mplab/mplab-code-configurator) 4.0.0 or newer
* MPLAB® AVR-Dx_DFP version 1.6.88 or newer

## 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

<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
* Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
* Clone the repository or download the zip to get the source code
* Open the .X project with MPLAB
* Press Make and Program Device to run the example

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

## Summary

<!-- Summarize what the example has shown -->
113 changes: 113 additions & 0 deletions avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc.X/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL


# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib


# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl
# Add your post 'build' code here...


# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...
# WARNING: the IDE does not call this target since it takes a long time to
# simply run make. Instead, the IDE removes the configuration directories
# under build and dist directly without calling make.
# This target is left here so people can do a clean when running a clean
# outside the IDE.

.clean-post: .clean-impl
# Add your post 'clean' code here...


# clobber
clobber: .clobber-post

.clobber-pre:
# Add your pre 'clobber' code here...

.clobber-post: .clobber-impl
# Add your post 'clobber' code here...


# all
all: .all-post

.all-pre:
# Add your pre 'all' code here...

.all-post: .all-impl
# Add your post 'all' code here...


# help
help: .help-post

.help-pre:
# Add your pre 'help' code here...

.help-post: .help-impl
# Add your post 'help' code here...



# include project implementation makefile
include nbproject/Makefile-impl.mk

# include project make variables
include nbproject/Makefile-variables.mk
Loading

0 comments on commit db47f58

Please sign in to comment.