AnsweredAssumed Answered

Round robin ADC on HVPKV31

Question asked by Matt Schafer on Apr 5, 2018
Latest reply on Apr 5, 2018 by Philip Drake

I'm trying to modify the KMS generated code to enable the round robin sampling of analog inputs on our custom board.  I'm looking in the ADCS_getUserSamples function within the HVPKV31F120M_POS_MXP_1_2_0_426 reference code and see a couple potential issues.

 

1) We have a few inputs using the SExxb side and it looks like the code below won't configure the b input on ADC1 channels.

/* Configure ADC1 to sample the user channel */
ADC1->CFG2 |= ADC_CFG2_MUXSEL(adc0HWMux);
/* Input channel select. */
ADC1->SC1[0] = ADC_SC1_ADCH(adc1Channel);

 

2) The MUXSEL bits appear to be getting bitwise OR into a register bit that was only cleared during the ADC init.  

ADC0->CFG2 |= ADC_CFG2_MUXSEL(adc0HWMux);

Outcomes