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

newbs/avr128da48-cnano-adc-sample-accumulator-mplab

 
 

Repository files navigation

MCHP

AVR128DA48 ADC Sample Accumulator

Objective

In this application, the ADC will accumulate samples, and 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

  • AVR128DA48 Curiosity Nano (DM164151)
  • Curiosity Nano Base for Click boards™ (AC164162)
  • One POT click board

Setup

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


The following configurations must be made:

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

Operation

  1. Connect the board to the PC.

  2. Open the avr128da48-cnano-adc-sample-accumulator-mplab.X project in MPLAB® X IDE.

  3. Set avr128da48-cnano-adc-sample-accumulator-mplab.X project as main project. Right click on the project in the Projects tab and click Set as Main Project:


  1. Select the AVR128DA48 Curiosity Nano in the Connected Hardware Tool drop down list of the project settings:
  • Right click on the project and click Properties;
  • Select the AVR128DA48 Curiosity Nano (click on the SN) in the Connected Hardware Tool list and then click OK:


  1. Program the project to the board: right click on the project and click Make and Program Device:


  1. Open the Data Visualizer
    • From the Curiosity Nano COMn port, open the drop down list:
    • From the drop down list, select New variable streamer...:
    • Configure the Variable Streamer Name and add the desired variable, then click Next:
    • Select all the variables to plot, select New axis per data type, and click Finish:

Result:

Rotating the Potentiometer on the POT click board (after starting the application), the ADC result will be plotted on the graph:
Demo

Summary

This application showcases the sample accumulator feature of the ADC.

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.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 58.4%
  • Makefile 41.6%