Skip to content

Latest commit

 

History

History

dspic33e-adc-in-sleep

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

image

ADC Conversion in Sleep mode

Description:

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 (RA4) pin is toggled.

Hardware Used

Software Used