If I apply 5V reference to RefinA+ and AGnd for RefinA- will this allow me a fullscale ADC range of 0 to +5V.
The ADuC847 can operate with a supply of 5V or 3V supply depending on the model.
With a 5V supply, (AVDD = 5V), the REFIN range is 1V to 5V. the ADC input is then 0V to 1.024 x 5 / gain in unipolar mode and +/- 1.024 x 5 / gain in bipolar mode.
With a gain of 1, the ADC input range of 0 to AVDD can be achieved in unipolar mode.
Note that the internal ADC buffers might need to be disabled in ADC0CON1 (see pages 26 and 43 of the datasheet).
I'm developing an application using the ADuC847. I am using the primary ADC with ref+ = 5vdc, ref- = 0vdc. With selecting the output as unipolar with chop = on, and SF set to 255. When I attach a (single ended) precision 2.5 voltage referance signal input on ch2, the output of the adc convversion is very unstable. (it is in the correct digital range for the 2.5v input but very unstable) I would expect the output to be very stable under this test condition. BUT if I change the SF ot 30 the output is extreamily stable which is exactly oppsite what I expect to happen. I am doing this test on the EVAL-ADuC847 board. From everythignI have read on the analog websight, all the date sheets, application notes, and referance material I can find on the subject indicates that I'm doing this correctly but the results I get are are wrong. So I'm very confused. Can you please enlighten me why this is not performing as I expect.
You are correct - SF=30 should yield better results than SF=255.
I have the following questions/points:
- How and when are you reading the ADC result? Via an interrupt? Is it possible with SF=255 that you are reading the ADC result too early?
- Could you post the ADC setup code and show how you are reading the ADC data register?
Please elaborate on your statement the SF = 30 should yeild "better" results then SF = 255.
This seems to be in direct contradiction to the ADuC847 datasheet pgs 26-47.Pages 29, 31, and 32 all show that a SF = 255 yields an "effective resolution" of 19.5 bits (chop on) whereas an SF of 13 only yields an "effective resolution" of 16 bits.
Was you statement a TYPO or is the data sheet incorrect?
Here is the way I'm performing the test. using the EVAL-ADUC847 I have anLCD display connected to a parallel port. I am displaying the ADC outputvalue (CarSpeed ) at a 3hz rate on the display.
There is not interrupt conflict betweenthe ADC and the display update with the test program.
Here is the code for setting up the ADC and reading the output.
SF = 255; // 16.06hz wo/chop 5.35hz w/chop
// SF = 30; // 136.5hz wo/chop 45.5hz w/chop ORIGIONAL VALUE
ADC0CON1 = UNI_CODE | BUFFER_OFF | ADC_ADCRANGE2_56V;
ADC0CON2 = AIN7_AINCOM;
ADCMODE = ADC1EN | ADC0EN | CONTENIOUS_CONVERT;
void ADC_int() interrupt 6
iVal = 0;
iVal = ADC0H;
iVal = iVal<<8;
iVal += ADC0M;
CarSpeed = iVal;
RDY0 = 0;
Sorry - there was a typeo in my last post - I meant SF=255 should yield better results than SF=30.
Lower ADC output rates produce lower noise results.
From your code snippet, I can see that you are measuring AIN7 in single ended mode. I also notice that you have switched off the input buffer to the ADC.
Is the signal connected to AIN7 buffered externally?
How is AIN7 driven on your circuit? Does it make a difference if you enable the input buffer to the ADC (ADC0CON1[7:6] = )?
Origionally I had the buffer on but Analog suppoert told me to turn it off because I was using +5v ref.
I turned it off but it made no measurble differance with it on or off.
I do have the input buffered externally via a OP284 configured as a line follower.
I have now recreated this problem on 4 (our design) boards and 2 of the EVAL-ADuC847 boards.
I'm still not able to realize anywhere near a noise free 19 bit resolution out of the ADC using the settings advertised in the data sheet.
The absolute best I have been able to obtain is a noise free 17 bit resolution using a 20K (+5v-10k-tap-10k-gnd) voltage devider feeding the ADC inpt on the eval board. This was with the SF=255. At SF=30 I only acheaved a 16 bit noise free resolution.
I'm (still) wondering about the referance inputs. On all the platforms I have tested with I'm using Avdd for the ref+ and Vgnd for ref-. All the ADC signal input devices (single ended) also use these sources. I have done it this way so that, in therory any noise on the Avdd would be common to the entire system and therefore any error would be ratiometric, and therotecally cancel itself out i.e. not show in the ADC output.
I know this is the commony was of setting up a old style (SAR) ADC, and I've done it sucessfully this way many times. But this is the first experance I have had using sigma-delta ADC's and I'm not entirely sure that this is the correct way to set up this type of ADC circuit.
Yesterday the question was raised (here) if i should drive the ADC ref+ ref- and the ADC input circuits from a precision regulated source instead of Avdd, or posiably placing a external driver/buffer on AVdd and Agnd. The therory there being that this is needed to realize the 19.5 bit resolution advertised in the datasheet.
I'm not convensed this is a good way to do it but my boss instructed me to run the idea by you. What do you say about this concept?
The test setup used to generate the ADC noise tables in the datasheet would have applied 0V to the ADC inputs - usually applied by shorting the external inputs at the pin. For example, AIN1-AIN2 would have been selected and the pins on the part shorted together to eliminate other signal noise sources on the PCB.
When an external reference is selected, this reference voltage is provided by a precision reference voltage, either an ADI chip like the ADR441 2.5V reference part or from an precision voltage source instrument.
The AVDD supply voltage I suspect may not be noise-free enough to be your ADC reference source.
As you suggested, it may be worth repeating your measurement with a precision voltage source source.
I'm back on working on this project from hell. My original question concerned using the ADuC847/845's ADC converter in the unipolar mode, single ended input with a 0-5v range. I have been told by Analog tech support that this is doable even though the data sheet seems to contradict itself and tech support on this subject. So here is my problem. IT DOES NOT WORK. I need in depth assistance from someone who knows this device intimately.
Here is what I wish to do with this device. I am using the ADC converter to read a 0 to 5v unipolar, single ended input. I expect to see an ADC value of 0 at 0v in and a 65535 at 5v (I'm only using the upper 16 bits of the ADC output registers (ADC0H, ADC0M, not the entire 24 bits. This simulates a 16bt ADC). I have the REF- tied to GND 0Vdc and REF+ tied to 5V.
I am setting up the ADC as follows:
ADC0CON1 = 0xA7;
ADC0CON2 = 0x4a;
ADCMODE = 0x2B;
Under these conditions I do not get any output from the ADC converter.
BUT if I change ADC0CON1 to = 0x27; /// use the internal internal 1.25v reference the ADC operates, I get a valid output BUT it maxes out (65535) with a 1.25v input. (I would expect this)
I checked the ADCSTAT reg and find that when using the REFIN+ and REFIN- instead of the internal 1.25v reference the ERR0 primary ADC error bit is set.
Here are my three questions:
1. Why would this bit be set when using the REFIN+ and REFIN- with the conditions I listed above?
2. Why can't I realize a max output of 65525 at 5V with when I use the external ref of 5V? (this is probably due to the ER0 bit).
Solve the ERR0 bit situation and it will probably work.
3. Is it necessary to perform calibration if I'm using the REFIN+ and REFIN- instead of the internal 1.25v reference? I'm not performing a calibration can this be the cause of this problem?
Please help! I'm at the end of my rope on this problem. I need to talk to someone who knows this device.
Message was edited by: Bill Harmon
I just attempted to perform an internal zero calibration followed by an internal full scale calibration.
This is due to thinking that the calibration might be needed to solve this problem. The calibrations failed, returning a value of 32(decimal) in the status register. This indicated an invalid REFIN. This brings us back to THE ORIGINAL QUESTION CONCERNING USING a 5V reference and a 0-5V input.
Message was edited by: Bill Harmon
sorry for the late reply, but we missed that somehow.
I have tested this quickly here on a evaluation-board and everything behaves like AudeR has explained in her very first reply
Retrieving data ...