Skip to content

This application has the purpose to implement an algorithm to display the data received from the device ADC peripheral using the Data Visualizer tool. The ADC is used as sample accumulator.

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/avr128da48-cnano-adc-sample-accumulator-mplab

Repository files navigation

MCHP

Analog-to-Digital Converter (ADC) — Sample Accumulator Using the AVR128DA48 Microcontroller

In this application, the ADC will accumulate samples, then the result will be divided by the number of samples and transmitted through USART. The software diagram of this application is presented in the figure below.

Related Documentation

Software Used

Hardware Used

Setup

The AVR128DA48 Curiosity Nano Development Board is used as a test platform. The Curiosity Nano Base for Click boards is used to integrate the POT Click board.


The following configurations must be made:

Pin Configuration
PD3 (AIN3) Analog Input
PC0 (TX) Digital Output

Demo

To observe the results plotted on a graph, follow the steps provided in the How to Use the Data Visualizer chapter.

Rotate the Potentiometer on the POT Click board after starting the application, so that the ADC result will be plotted on the graph, as in the image below:

Summary

This application showcases the sample accumulator feature of the ADC.

How to Program the Curiosity Nano board

This chapter shows how to use the MPLAB® X IDE to program an AVR® device with an Example_Project.X. This can be applied for any other projects.

  1. Connect the board to the PC.

  2. Open the Example_Project.X project in MPLAB X IDE.

  3. Set the Example_Project.X project as main project:
    Right click on the project in the Projects tab and click Set as Main Project.

  4. Clean and build the Example_Project.X project:
    Right click on the Example_Project.X project and select Clean and Build.

  5. Select AVRxxxxx Curiosity Nano in the Connected Hardware Tool section of the project settings:
    Right click on the project and click Properties.
    Click on the arrow under the Connected Hardware Tool.
    Select the AVRxxxxx Curiosity Nano by clicking on the SN.
    Click Apply and then OK.

  6. Program the project to the board:
    Right click on the project and then Make and Program Device.


How to Use the Data Visualizer

  1. Open the Data Visualizer:

  2. In the Curiosity Nano COMn tab, click the Source options button and set the Baud Rate:

  3. From the same tab, select New variable streamer:

  4. Configure the Variable Streamer Name and add the desired variable, then click Next:

  5. Select all the variables to plot, select New axis per data type, and click Finish:


About

This application has the purpose to implement an algorithm to display the data received from the device ADC peripheral using the Data Visualizer tool. The ADC is used as sample accumulator.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published