| Author |
Message |
|
|
Posted: Jul 19, 2012 - 03:25 PM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
Hello,
is it possible to measure a Voltage from 0V to 5V on the differntial ADCIF of the UC3C?
I read about setting the negative input to ground (AVR32_ADCIFA_INN_GNDANA).
Nice trick, works great for all positive inputs, but what if I have to connect the signal to an ADC-Pin >= Input8 (which are negative Inputs)?
Setting the positive Input to GND (AVR32_ADCIFA_INP_GNDANA) won't help here, cause normally I'd suggest setting the positive Input to VCC.
Greetings,
jabba |
|
|
| |
|
|
|
|
|
Posted: Jul 19, 2012 - 03:46 PM |
|


Joined: Oct 30, 2002
Posts: 5720
Location: The Netherlands
|
|
| You should bias one input to half way the range. 0-2.5 will read as negative and 2.5-5V as positive (or the other way around depending on which pin you bias). |
|
|
| |
|
|
|
|
|
Posted: Jul 19, 2012 - 04:17 PM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
| so I need a physically existing free positive input? |
|
|
| |
|
|
|
|
|
Posted: Jul 19, 2012 - 07:40 PM |
|


Joined: Oct 30, 2002
Posts: 5720
Location: The Netherlands
|
|
| Maybe yes, maybe not. I don't know not no nothing about the AVR32. |
|
|
| |
|
|
|
|
|
Posted: Jul 19, 2012 - 11:22 PM |
|

Joined: Aug 19, 2003
Posts: 397
Location: Australia
|
|
I connect the positive input to the positive ground (input 10) which gives me a negative ADC result that can be converted to a positive value.
Now., the typedefs for the ADC make the result registers AVR32_ADCIFA.resx[] (incorrectly in my opionion) unsigned,
so if you get some really large numbers from a conversion try typecasting it to a signed 32-bit value. |
|
|
| |
|
|
|
|
|
Posted: Jul 20, 2012 - 07:25 AM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
I get the results from the sequencer which does this typecast already:
Code:
#define ADCIFA_read_resx_sequencer_0(ind) ((int)AVR32_ADCIFA.resx[(ind)])
But nevertheless I think my problem is another one:
my reference is 2.5V at the ADCREF0-Input, but my single-ended measurement inputs have pull-ups to 5V. :/ |
|
|
| |
|
|
|
|
|
Posted: Jul 20, 2012 - 08:42 AM |
|

Joined: Aug 19, 2003
Posts: 397
Location: Australia
|
|
| Can you put a pulldown resistor on those inputs so that they form a voltage divider with the external pullups ? |
|
|
| |
|
|
|
|
|
Posted: Jul 20, 2012 - 10:12 AM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
Actually there is ... sorry for my incomplete explaination:
I now have a 4k7 to 5V VCC and a PTC (KTY11-6) for temperature measuring to GND. ( for testing purposes i replaced the KTYs by 2k resistors)
On the positive input (AVR32_ADCIFA_INP_ADCIN5) I have a voltage of 1,476V and the according negative input is set to AVR32_ADCIFA_INN_GNDANA.
On the negative input (AVR32_ADCIFA_INN_ADCIN13) I have a voltage of 1,485V and the according positive input is set to AVR32_ADCIFA_INP_GNDANA.
My reference is 2.5V on ADCREF0.
So I would expect an ADC-Value of about 1200 for the positive input and according to mikech -1200 for the negative input.
But surprisingly I get 1204 for the positive and -1084 for the negative input.
What went wrong here? |
|
|
| |
|
|
|
|
|
Posted: Jul 21, 2012 - 01:32 AM |
|

Joined: Aug 19, 2003
Posts: 397
Location: Australia
|
|
Your result for ADCIN5 is good, but your ADCIN13 is reading about .16V low, which leads me to suspect the Sample&Hold stage that handles ADCIN8-15.
Section 36.6.16 Calibration in the datasheet says to read the calibration values from the factory-page into the ADCCAL & SHCAL registers.
Factory page 15.10 Calibration Settings
Just did some reading of adcifa_configure(,,) and it sets calibration values into the registers but you will first need to call adcifa_get_calibration_data(,) |
|
|
| |
|
|
|
|
|
Posted: Jul 26, 2012 - 10:52 AM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
already appliedthe factory-page, like it's done in the adc-demo-application.
now i played a little bit with the sampling frequency and reduced it from 1Mhz to 200kHz. And surprise: i get correct values also on the negative inputs.
Why? And what to do so it works with higher frequency? (I need it, because i have to do some more samples in a defined time) |
|
|
| |
|
|
|
|
|
Posted: Jul 26, 2012 - 12:25 PM |
|

Joined: Aug 19, 2003
Posts: 397
Location: Australia
|
|
Do your 'negative' inputs have more impedance than the 'positive' inputs ?
You might need to increase the S/H settling time by setting MUXSET in the CFG register.
Another possibility is to reduce the resolution, do you need 12-bit resolution ?,
because according to the Electrical Characteristics section in the datasheet the maximum ADC clock is somewhere between 1.2 MHz and 2.4 MHz depending on what VDDANA you use and what resolution you want.
Do you really need to sample a
Quote:
PTC (KTY11-6)
thermistor at 1Msamples/sec ?????? |
|
|
| |
|
|
|
|
|
Posted: Jul 26, 2012 - 02:26 PM |
|

Joined: Nov 27, 2007
Posts: 101
|
|
|
Quote:
Do you really need to sample a
Quote:
PTC (KTY11-6)
thermistor at 1Msamples/sec ??????
... not really, but i have to do all samples (incluing some time-uncritical PTCs) within a very short period.
I'll try playing with that MUXSET-Bit you suggested. |
|
|
| |
|
|
|
|
|