Git Product home page Git Product logo

test-attiny1627-temperature-measure-single-12-bit-adc-mplab-mcc's Introduction

MCHP

Measuring the Internal Temperature Sensor using the 12-bit ADC in Single Mode

This code example shows how to use the ADC on tinyAVR® 2 Family microcontrollers to measure the internal temperature sensor. In Single mode, when the ADC conversion is triggered, the ADC result is available for a single sample. In this mode, ADC resolution can be selected to be 8-bit or 12-bit. In this example, the ADC is used in Single mode to measure the internal temeperature sensor with 12-bit resolution.

Related Documentation

Software Used

Microchip’s free MPLAB X IDE, compiler and MPLAB Code Configurator (MCC) graphical code generator are used throughout the application firmware development to provide easy and hassle-free user experience. Following are the tool versions used for this example:

Hardware Used

Peripherals Configuration using MCC

Added Peripherals

Peripherals

ADC Configuration

ADC ADC

Setup

  • Connect the ATtiny1627 Curiosity Nano to a computer using USB cable
  • Download and install all software components as listed under 'Software Used'

TEST

  • Hello 1

ADC

- Hello 2

ADC

- Hello 3

![ADC](images/ADC_02.png)

	- Hello 4
	  ![ADC](images/ADC_02.png)
  • Hello 5 - 1 space

ADC

  • Hello 6 - 2 space

    ADC

  • Hello 7 - 4 space

    ADC

  • Hello 8 - 10 space

        ![ADC](images/ADC_02.png)
    
    • Hello 9 - 1 space - Nested

    ADC

    • Hello 10 - 1 tab

      ADC

    • Hello 11 - 2 tab

        ![ADC](images/ADC_02.png)
      
    • Hello 12 - 3 tabs

        	![ADC](images/ADC_02.png)
      

Operation

  • Download the zip file or clone the example to get the source code
  • Open the .X file with the MPLAB® X IDE
  • Set the attiny1627-temperature-measure-single-12-bit-adc-mplab-mcc project as Main project by right-clicking on the project title

set_as_main_project

  • Program the project to the ATtiny1627 Curiosity Nano:

    • First clean and build the project by pressing the Clean and Build Main Project button

clean_and_build

- Then make and progam the project to the ATtiny1627 by clicking the *Make and Program Device Main Project* button

make_and_prog

  • To verify that the code is working:

    • Add a Watch to the temperature_in_degC variable found in main.c

- Select the *Watches* tab

- Run code in debugging mode by clicking the *Debug Main Project* button

debug

- Pause the debug session by clicking the *Pause* button

debug_pause

- Now you can read out the latest measurement in the *Watches* tab. Notice that the readout value is in hex format, so remember to convert to decimal value (0x0018 = 24).

Summary

This example shows how to use the ADC in single mode to get a 12-bit resolution measurement of the internal temperature sensor on an tinyAVR® 2-series device.

test-attiny1627-temperature-measure-single-12-bit-adc-mplab-mcc's People

Contributors

muthualagappanm avatar aku-work avatar egilro avatar

Watchers

 avatar

Forkers

servomesh

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.