Re: can I use ADC channel 4 and channel 49 at the same time?
☄ Helpfulby aatifshaikh66 2019/04/15 21:33:48
Refer to figure 28:1 in the current PIC32MZ data sheet. You can see that AN4 and AN49 are both connected to ADC4. You can read both these inputs, but not at the same time. Yes you must reconfigure back and forth to read them both. If the sample rate is slow enough, it could appear like you are reading them at the same time however.
The Main and Alternate settings for any Mux input can be made through the Harmony Configurator. Driver -> ADC -> and so on...
Set the ADC's up in the Configurator, then look in the generated init file (should be called drv_adc_static.c if you used the static driver) to see what functions were called to set the driver up. This will help you if you need to modify things on the fly (or as per your first question).
The example programs: "adchs_pot" and "adc_pot" were very helpful to me when trying to get the ADC going.
Also read the latest PIC32MZ eratta, there are some issues with the ADC.