Problem with multiple hardware digital filters on ADCHS module in PIC32MZ EF part
I have adapted the Harmony v1.06 adcs_oversample project to include measuring two ADC channels using Class 1 inputs. When using a single digital filter (oversampling mode) on either of the ANx inputs, the filter output is as expected. However, an attempt to filter two ANx inputs using two digital filters results in both filter outputs giving the same number.
Using the filters one at a time, the outputs are correct. Say for a 0 V input, the filter result is 0x0000, and for a full scale voltage, the output is 0x7FFF.
But if I attempt to filter two different ANx inputs using two digital filters respectively, both filter outputs come out the same. For several combinations of filter number and ANx input number, the output comes out to be that of the higher numbered ANx input. For example, for a full scale voltage, the output (as measured at the ADCFLTRx register after the AFRDY bit is set) is 0x7FFF for BOTH filters, even though one of them should be filtering 0 V.
This does NOT appear to be a Harmony problem. I have verified that the the only difference in the actual respective ADCFLTRx registers is the CHNLID bits, which select the analog input channels to filter. These are set correctly as expected by the MHC boilerplate code as generated directly by choices in the MHC options.
This is on a PIC32MZ2048EFM064 part, XC32 1.40, MPLABX 3.06, PICKit 3.
Has anyone gotten the ADCHS filters to work independently as expected?
post edited by Paul Bjork - 2015/11/11 11:13:14