Dynamic gain setting for ADC in XMEGA

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Experts,

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.

 

Best wishes,

Mehrdad,

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mehrdad_58 wrote:
1. Is it possible to set gain of ADC dynamically?

It would seem so:

 

mehrdad_58 wrote:
2. if yes, please give me a code snippet to handle it in atmel studio.

Most of us on AVRFreaks are volunteers, who wire code professionally, so since we are paid for code, it's not given away for free..

However, if you will post a small complete program you have written, describe what you expect to happen, and what is happening...

then some one here may be able to help you fix your code to do what you want it to do.

OK?

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274