Xmega ADC again questions

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

Hi, sorry if I post again a question about the XMEGA ADC but I need help.
I'm using an ATXMEGA256A3 REV_ID N° 0001.
Someone know from what rev_id the ADC problems are resolved?
I've strange problems, if I use the ADC in single ended the errors are very big 16-20 LSB.
If I use differential mode decrease at 4-6 LSB but I've an other problem....
I set the ADC like this:

ADC_CalibrationValues_Load(&ADCB);
ADC_ConvMode_and_Resolution_Config(&ADCB,
ADC_ConvMode_Signed,
ADC_RESOLUTION_12BIT_gc);
ADC_Prescaler_Config(&ADCB, ADC_PRESCALER_DIV512_gc);
ADC_Reference_Config(&ADCB,ADC_REFSEL_VCC_gc);
ADC_Ch_InputMode_and_Gain_Config(&ADCB.CH0,
ADC_CH_INPUTMODE_DIFFWGAIN_gc,
ADC_DRIVER_CH_GAIN_NONE);
ADC_Ch_InputMode_and_Gain_Config(&ADCB.CH1,
ADC_CH_INPUTMODE_DIFFWGAIN_gc,
ADC_DRIVER_CH_GAIN_NONE);

ADC_Ch_InputMux_Config(&ADCB.CH0,
DC_CH_MUXPOS_PIN4_gc,
ADC_CH_MUXNEG_PIN5_gc);
ADC_Ch_InputMux_Config(&ADCB.CH1,
ADC_CH_MUXPOS_PIN6_gc,
ADC_CH_MUXNEG_PIN7_gc);
ADC_SweepChannels_Config(&ADCB, ADC_SWEEP_0123_gc);

ADC_Enable(&ADCB);

ADC_Wait_32MHz(&ADCB);
ADC_FreeRunning_Enable(&ADCB);

I've two trimmers one on PB4 and one on PB6.
If I set trimmer1 and trimmer2 to 0V I rea 0001(decimal) on both channels.
If I increase trimmer1 to read 0455 (decimal) or some other value, on CH0, it increase a little bit also CH1 and I read ( CH0=0455 and CH1=0015) ?
How it's possible?

Where I can read the history of the REV_ID for to know if my microcontroller have a good ADC and I'm wrong or if it has bug?
Thanks.
Davide

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

You did read the Errata in the latest datasheet for the ATxmega256A3, didn't you?

Your Rev_ID indicates you have a Rev B chip (latest and greatest). According to the Errata, the ADC is limited to a reference voltage of 2.4 Volts. Not really knowing the real details of the circuit driving the input to the ADC, I cannot say more.

I will say that we use the ADC on a 128A1 (it has the same limitations) and have had no LSB issues with it, once we took the limited input voltage into account.

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

you are aware that, in single ended mode, the value is around 200 decimal when the input voltage is 0V, right?

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

Hi and thanks for your answers.
I read the errata but I did not understand if REVB was the version with the defects listed or were resolved defects listed. Unfortunately my English is not special and do not understand everything I read at 100% :)
Yes, in single ended I've an offset but not 200 it's about 140. The strange things is that in differential mode, if I increase the value on CH0 it increase a little bit also the value on CH1.(?) Now I'll try to use CH0 and CH2 for to see if something change. Thanks again.
Davide