Coder Social home page Coder Social logo

microchip-pic-avr-examples / atmega4809-adc-basics-mplab Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 601 KB

An introduction to adc's on megaavr 0 series

Makefile 0.27% C 99.66% Assembly 0.07%
free-running led mplab-data-visualizer sample-accumulation start window-compare sar-adc

atmega4809-adc-basics-mplab's Introduction

MCHP

ATmega4809 Xplained Pro ADC Basics

MegaAVR® 0-series devices feature a 10-bit Successive Approximation register (SAR) Analog-to-Digital Converter (ADC) capable of conversion rates up to 115 ksps. It features a flexible multiplexer, which allows the ADC to measure the voltage at multiple single-ended input pins.

There are four modes we will explore in this example:

  • ADC Free-Running mode
  • ADC Single Conversion mode
  • ADC Window Comparator mode
  • ADC Sample Accumulator mode

This is an example of how to get started with the ADC on the ATmega4809. This is based on the application note AN2573.

Related Documentation

Software Used

Hardware Used

Setup

  • Port PD6 is the ADC channel input, connect a cable here to interract with the ADC

Operation

  1. Download the zip file or clone the example to get the source code.
  2. Open atmega4809-adc-basics-mplab.X in MPLAB.
  3. Connect the ATmega4809 Xplained Pro to the computer with a micro USB cable.
  4. Make sure the kit is selected as the tool to be programmed under project settings.
  5. Press the make and program button to program the device.
  6. Open the desired terminal application or Data visualizer and open the serial port associated with the Xplained Pro.

As mentioned in the appnote AN2573 you can change the voltage level of the adc input port and the approximated value will be shown over UART through data visualizer.

Conclusion

We have here shown how to setup and get started with the ADC basics project. For more details about this example and how the ADC works please see the AN2573 Application Note.

atmega4809-adc-basics-mplab's People

Contributors

aku-work avatar carlehe avatar dradnats avatar egilro avatar

Watchers

 avatar  avatar  avatar

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.