OK. I finally figured out where I was going wrong, (revised code attached), but now I have a question.
Depending on how many conversions I want, the processing time varies like this:
2 conversions ~7.42uS, 4 conversions ~8.41uS, 8 conversions ~10.41uS, 16 conversions ~14.41uS.
I am assuming that the more conversions I do, the better the accuracy, but I have to balance this with speed of conversion.
I am sampling the channels at specific times in the main loop. Every time I sample a channel I have to wait for the conversion to complete. Instead of waiting, I could enable the conversion complete interrupt and read the register and save it to the appropriate variable within the interrupt. So my question is, how much time would it take to service the interrupt and which method would be most efficient, waiting for the conversion completion or servicing conversion complete interrupt?
Regards,
Robert