Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
unsigned int channel4; // conversion result as read from result buffer
unsigned int channel5; // conversion result as read from result buffer
unsigned int offset; // buffer offset to point to the base of the idle buffer
// Configure the device for maximum performance but do not change the PBDIV
// Given the options, this function will change the flash wait states and
// enable prefetch cache but will not change the PBDIV. The PBDIV value
// is already set via the pragma FPBDIV option above..
SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
// configure and enable the ADC
CloseADC10(); // ensure the ADC is off before setting the configuration
// define setup parameters for OpenADC10
// Turn module on | ouput in integer | trigger mode auto | enable autosample
#define PARAM1 ADC_FORMAT_INTG | ADC_CLK_AUTO | ADC_AUTO_SAMPLING_ON