This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-EXP432P401R: Is it possible to reconfigure the ADCBuf on the fly?

Part Number: MSP-EXP432P401R

Hi,

So I suspect the answer is no, but I haven't found any documentation telling me otherwise, so I figured I'd ask here.

I'm using my MSP432P401R to sample a bunch of analog channels. Everything is working great.

So here's the issue, after a certain number of samples are taken, I want to stop the conversion, reconfigure the ADCBuf to only sample one specific pin, then start a new conversion.

Here's the sequence of events:

1 - ADCBuf_init is called once.

2 - ADCBuf main thread starts

3 - ADCBuf_Params_init is called and all parameters set.

4 - ADCBuf_Conversion structure parameters are set.

5 - ADCBuf_open is called and buffer opens successfully.

6 - ADCBuf_convert is called and conversion begins.

So up to this point, everything is great, and the conversion chugs along until I reach a certain number of samples.

7 - ADCBuf_convertCancel is called with the (valid) handle from ADCBuf_open.

8 - ADCBuf_close is called with the (valid) handle from ADCBuf_open.

So here everything has stopped, the ADC is no longer sampling and no conversion is happening.

So now what I want to do is this:

9 - Change the ADCBuf_Params and ADCBuf_Conversion settings.

10 - ADCBuf_open is called with the new ADC_Params, but this time it returns NULL.

This is where I'm stuck. I was hoping that after closing the previous handle, that I could reconfigure the ADCBuf and open a new handle, but the call to ADCBuf_open always fails.

I tried called ADCBuf_init again, but there was no difference, and I know that ADCBuf_init should only be called once anyways, so I think that's a dead end.

So is this possible? Can I configure the ADCBuf and do some conversions, then stop everything, release the ADCBuf and reconfigure it? Is there a step I'm missing?

A yes or no answer would be sufficient, I just want to make sure I'm not spinning my wheels trying to do something impossible.

Thanks!