Coder Social home page Coder Social logo

microchip-pic-avr-examples / avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 323 KB

This MCC based MPLAB X IDE example shows how to interface an electret microphone with a microcontroller (MCU) using the Analog Signal Conditioning (OPAMP). In addition to the microphone, only one resistor and one capacitor are required.

License: Other

Makefile 3.43% C 93.23% Assembly 3.35%
curiosity-nano gain melody opamp pga resistor-ladder signal-conditioning low-bom

avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc's Introduction

MCHP

Low-BOM Microphone Interface Using the Analog Signal Conditioning (OPAMP) Peripheral

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.

Related Documentation

Software Used

Hardware Used

Peripherals Configuration using MCC

This section describes how this example was configured in MCC.

Added Peripherals

  • The OPAMP driver was found under Device Resources, and added

OPAMP_driver

  • The Builder tab showed the system, with the added OPAMP peripheral

Builder

  • Clicked on the OPAMP block, to enable the OPAMP driver Easy View and configured as shown below

OPAMP System

OP0

Note: System Gain is calculated based on settings from both OP0 and OP1, and the screenshot shows the calculated value once OP1 was setup, as shown below.

OP1

  • Clicked on Generate in the Resource Management tab to generate the source code

Builder

Setup

  • Connect the hardware together as shown in the schematic above:
    • Electret microphone
    • Resistor, R5
    • Capacitor, C1

Operation

  • Connect the AVR128DB48 Curiosity Nano to a computer using a USB cable
  • Clone this repository or download the *.zip to get the source code
  • Open the avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc.X project in MPLAB X
  • Click Clean and Build to build the example

Build

  • Click Make and Program Device to run the example

Program

  • If no tool has been chosen, a window will open, select the AVR128DB48 Curiosity Nano evaluation kit. The tool can also be chosen in the project settings.

Summary

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.

avr128db48-low-bom-mic-interface-using-opamp-mplab-mcc's People

Contributors

aku-work avatar carlehe avatar lloydclark avatar runarsauremicrochip avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

uttambasu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.