for a project I am in need of setting gain stage of XMEGA128A1u to 64X and after a while changing it again to 1X and again after a while changing it to 64X and then 1X and this circle happens several times in a loop.
But as ADC reading happens in a Interrupt routine, I do not want to stop and start ADC module.
I just need to set a new gain before reading the ADC.
Now my questions :
1. Is it possible to set gain of ADC dynamically?
2. if yes, please give me a code snippet to handle it in atmel studio.