Helpful Replycan I use ADC channel 4 and channel 49 at the same time?

New Member
  • Total Posts : 24
  • Reward points : 0
  • Joined: 2019/02/20 03:17:39
  • Location: 0
  • Status: offline
2019/04/11 02:32:16 (permalink)

can I use ADC channel 4 and channel 49 at the same time?

Hi all,
I'm working on a project (based on PIC32MZ1024EFM144), which required 12 ADC channels for voltage and current reading. Now, my hardware designer has chosen the ADC 'channel 4' as well as ADC 'channel 49' for reading two different voltages. My concern is, can I read two different signals on these pins simultaneously? or I've to do the 'RE-INIT' process every single time before reading these pins?. In addition to that, how to initialize the channel-48, which is an alternate option of channel-3?
If it is not possible or right way, is there a more precise way to manage it?
post edited by aatifshaikh66 - 2019/04/11 04:01:57
Super Member
  • Total Posts : 220
  • Reward points : 0
  • Joined: 2016/03/11 22:47:59
  • Location: 0
  • Status: offline
Re: can I use ADC channel 4 and channel 49 at the same time? 2019/04/15 18:14:45 (permalink) ☄ Helpfulby aatifshaikh66 2019/04/15 21:33:48
4 (1)
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.
Jump to:
© 2019 APG vNext Commercial Version 4.5