ADC – 3 channels demo

  1. What this example do?
  2. How I must configure my ORbit16™ to work with this example?
  3. Where I can learn more about this?
  4. Download this example!

What this example do?

In this example we’ll use 3 ADC (Analog/Digital Converter) inputs. Here we’ll read three analog inputs from 3 potentiometers. Code will auto-scan 3 analog inputs and then will show the results on UART or on USB in serial emulation mode (there are 2 demos: one for UART e one for USB).

When you press SW2 on ORbit16™,firmware will start to execute readings and you can see results on a terminal software (such as Hyperterminal or similar).

How I must configure my ORbit16™ to work with this example?

First you’ll need 3 potentiometers or a trimpots to be connected on AN0, AN1 and AN2 inputs (please see schematic below).

For the UART demo you need a serial adapter that works with a TTL level of 3.3V and set the serial port at 57600,8,N,1. For the USB demo you don’t need the serial adapter since the USB module on ORbit16™ is used in CDC mode and then any baud rate selected in terminal software will works fine.

You can use any terminal software on your pc to see the messages sent by ORbit16™ :

Where I can learn more about this?

My advice is to read the following free documents:

  • dsPIC33_PIC24H_ADC_Library_Help.htm (english language)
    This is an HTML file you’ve got with MPLAB C30 installation. Usually this document is located in the following folder:

    C:\Program files\Microchip\MPLAB C30\docs\periph_lib

    Reading document this will give you extra skills in the usage of ADC. Please notice this document is for dsPIC33 and PIC24H series so some settings are different for PIC24F mounted on ORbit16™. At this date, Microchip still not have furnished the updated document for PIC24F

  • PIC24F Family reference manual (english language)
    This is a set of PDFs about PIC24F features. Read:
    Sect.17 – 10bit A/D converter
  • Impostazione e funzionamento modulo ADC su PIC24F – Ebook (italian language)
    This document talks about the ADC libraries for PIC24FJ64GB002. Here you can download it.

Download this example!

This file is in ZIP format
ADC Demo - 3 channels on UART with autoscan
384.24 kB - Downloaded 26 times
This file is in ZIP format
ADC Demo - 3 channels on USB with autoscan
502.43 kB - Downloaded 24 times