Microchip | The Embedded Control Solutions Company Register Login
Browse All
Microchip Technology
 305 Code Snippets

ADC Conversion in Sleep mode

Microchip Technology

In this example, ADC is set up to convert AIN5 using CH0 S/H and ADC is operating using its internal RC osc.

About this Code Example

In this example, ADC is set up to convert AIN5 using CH0 S/H and ADC is operating using its internal RC osc.
Start of conversion is issued in the background loop and device enters sleep mode immediately after that.

When the ADC conversion is completed in sleep mode, it wakes up the device and enters ADC ISR.


void initAdc1(void);
ADC CH0 is set-up to covert AIN5 in 10-bit mode. ADC is configured to next sample data immediately after the conversion.
But the start of conversion is issued manually in the background loop.

void _ADC1Interrupt()
Device enters the ADC ISR after waking up from sleep mode. ADC result is read in the ISR and PORTA (RA6) pin is toggled.

Categories

Release History

  • Jun 21, 2012

    Version: 1.0.0

    First Release to ECS

Download Contact the Developer

*Required Fields

  • Current Version:1.0.0
  • Created:Jun 21, 2012
  • Updated:Feb 26, 2015
  • Downloads:4042
  • MPLAB Version:V8.xx or above
  • C Compiler:MCC18 v3.30 or above
  • Development Tools:Explorer 16 Demo board
  • Supported Devices:PIC24FJ128GA010

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.