EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

F2812 ADC output fluctuates

Started by Salih Cihan Tek February 17, 2008
Hi all,

I'm trying to use the ADC on the ezDSP F2812 development board.
I made a simple voltage divider in a breadboard using resistors and
then buffered it with a voltage follower before sending it to the
ADC pin for experimenting with the ADC. The breadboard is powered by
a 3V3 voltage regulator. (It doesn't take it power from the board)

When i looked at the output values of the ADC while debugging in CCS,
i saw that the output values of the ADC aren't 1101 and fluctuate btw
1000-1300 for an input voltage of 812mV.

Another weird thing is, when i measured the voltage between the pins
ADCINA0(P9-PIN2) and GND(P9-PIN1) while the circuit on the bread
board is powered off, i saw 0.450V. Similarly, there were 0.730V btw
these pins when i left them floating.(Weird)

I'm using the internal voltage reference and a slow ADC clock
(2.5Mhz).

What could be reason of this? I don't think that it is a software
issue but i'm putting my code below.

Thanks for your help.

/////////////////////////////////////////////////////
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"

int a=0;
int array[10];
void main(void)
{
InitSysCtrl();
InitPieCtrl();
InitPieVectTable();

InitAdc();
// Configure ADC clock

// Divide HSPCLK by 30 (75/30=2.5MSPS)
AdcRegs.ADCTRL3.bit.ADCCLKPS = 15;

// Configure ADC

// Sampling Window = (ACQ_PS+2)/ADCCLK = 2us
AdcRegs.ADCTRL1.bit.ACQ_PS = 3;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; // Cascaded Mode
AdcRegs.ADCTRL1.bit.CONT_RUN = 1; // Continuous run
AdcRegs.ADCTRL1.bit.CPS = 0; // Prescaler = 1
AdcRegs.ADCMAXCONV.all = 0; // 1 conversion sequences
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0;
AdcRegs.ADCTRL3.bit.SMODE_SEL = 0; // Sequental sampling
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; // Start conversion sequence
while(1)
{
while (AdcRegs.ADCST.bit.INT_SEQ1 == 0); // Delay
array[a] = AdcRegs.ADCRESULT0>>4;
a++;
if (a == 10) a=0;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
}
}
///////////////////////////////////////////////////////////

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
hi,
i would suggest that you should look at the ti manual for adc calibration
there are two pins on the 2812 adc pins which produce 1 and 2 volts reference voltages
use that and calibrate the adc

also you can try a simple low pass filter/Kalman filter to stabilize your readings
bye

Salih Cihan Tek wrote:
Hi all,

I'm trying to use the ADC on the ezDSP F2812 development board.
I made a simple voltage divider in a breadboard using resistors and
then buffered it with a voltage follower before sending it to the
ADC pin for experimenting with the ADC. The breadboard is powered by
a 3V3 voltage regulator. (It doesn't take it power from the board)

When i looked at the output values of the ADC while debugging in CCS,
i saw that the output values of the ADC aren't 1101 and fluctuate btw
1000-1300 for an input voltage of 812mV.

Another weird thing is, when i measured the voltage between the pins
ADCINA0(P9-PIN2) and GND(P9-PIN1) while the circuit on the bread
board is powered off, i saw 0.450V. Similarly, there were 0.730V btw
these pins when i left them floating.(Weird)

I'm using the internal voltage reference and a slow ADC clock
(2.5Mhz).

What could be reason of this? I don't think that it is a software
issue but i'm putting my code below.

Thanks for your help.

/////////////////////////////////////////////////////
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"

int a=0;
int array[10];
void main(void)
{
InitSysCtrl();
InitPieCtrl();
InitPieVectTable();

InitAdc();
// Configure ADC clock

// Divide HSPCLK by 30 (75/30=2.5MSPS)
AdcRegs.ADCTRL3.bit.ADCCLKPS = 15;

// Configure ADC

// Sampling Window = (ACQ_PS+2)/ADCCLK = 2us
AdcRegs.ADCTRL1.bit.ACQ_PS = 3;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; // Cascaded Mode
AdcRegs.ADCTRL1.bit.CONT_RUN = 1; // Continuous run
AdcRegs.ADCTRL1.bit.CPS = 0; // Prescaler = 1
AdcRegs.ADCMAXCONV.all = 0; // 1 conversion sequences
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0;
AdcRegs.ADCTRL3.bit.SMODE_SEL = 0; // Sequental sampling

AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; // Start conversion sequence
while(1)
{
while (AdcRegs.ADCST.bit.INT_SEQ1 == 0); // Delay
array[a] = AdcRegs.ADCRESULT0>>4;
a++;
if (a == 10) a=0;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
}
}
///////////////////////////////////////////////////////////

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
I looked at the ADC input signals with a scope and it turned out to be
a 50hz noise problem. I saw 200mV p-p 50Hz noise signal both in the ADC
inputs and supply pins of the expansion connector. The source of this
noise isn't the external circuit i connect, because it still exists
even when i disconnect the breadboard from the DSP board. What is the
source of this noise and how can i eliminate it?

Regards,

--- In c..., chirag jagadish
wrote:
>
> hi,
> i would suggest that you should look at the ti manual for adc
calibration
> there are two pins on the 2812 adc pins which produce 1 and 2 volts
reference voltages
> use that and calibrate the adc
>
> also you can try a simple low pass filter/Kalman filter to
stabilize your readings
> bye
>

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Hello again,

It seems like the noise was coming from the PC. When i disconnected the
board from the PC and powered it while the circuit in the breadboard
was connected to its ADC, the noise was gone. But there should be a
solution that will make the board work properly while its connected to
the parallel port of the PC, or should i run the application from the
FLASH for using the ADC(i hope that this isn't the case).

Regards,

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
hi,
when you connect the 2812 to computer(PC), you can see the watch window and realize that there is noise
i do not understand how you could see the absence of noise when you cannot see the watch window or you dont see the graph in ccs.
can you tell me how you observe data without connecting to ccs.
this might help me with my own project.
thank you
bye

Salih Cihan Tek wrote:
Hello again,

It seems like the noise was coming from the PC. When i disconnected the
board from the PC and powered it while the circuit in the breadboard
was connected to its ADC, the noise was gone. But there should be a
solution that will make the board work properly while its connected to
the parallel port of the PC, or should i run the application from the
FLASH for using the ADC(i hope that this isn't the case).

Regards,

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
I think he meant he is looking noice on Scope (not on watch windows).

And I think noise is coming into circuit due to lack of Isolation.
Try to use optical isolation to reduce noise.
Thanks

Viks

On Feb 19, 2008 9:10 AM, chirag jagadish wrote:
> hi,
> when you connect the 2812 to computer(PC), you can see the watch window and
> realize that there is noise
> i do not understand how you could see the absence of noise when you cannot
> see the watch window or you dont see the graph in ccs.
> can you tell me how you observe data without connecting to ccs.
> this might help me with my own project.
> thank you
>
> bye
> Salih Cihan Tek wrote:
> Hello again,
>
> It seems like the noise was coming from the PC. When i disconnected the
> board from the PC and powered it while the circuit in the breadboard
> was connected to its ADC, the noise was gone. But there should be a
> solution that will make the board work properly while its connected to
> the parallel port of the PC, or should i run the application from the
> FLASH for using the ADC(i hope that this isn't the case).
>
> Regards,
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Hello again,

I did not observe the "data" when the 2812 was disconnected from the
PC.

Initially, i was only observing the values in the watch window and
saw that there is a fluctuation problem. Later, when i started
looking at the analog signal that is applied to the ADC pin with an
oscilloscope, i saw that there is a 50Hz noise signal coupled to the
ADC input with a peak-to-peak value of approx 200mV. After that, i
stopped looking at the watch window and disconnected the board from
the printer cable. When i looked at the same signals again with the
scope, the noise was gone.

If i'm not mistaken, the reason for the fluctuation is this 50Hz
noise which is coupled to every signal both in the DSP board and in
my circuit on the breadboard, while the 2812 is connected to the
parallel port via the printer cable. The parallel port pins have this
50Hz signal on them even when nothing is connected to them.
Unfortunately, i don't know how to get rid of this noise. I would be
very much appreciated if someone would tell me the solution.

By the way, if i would need to observe the ADC data while the board
isn't connected to the PC, i would write the value to the GPIO pins
and connect these pins to an external DAC.
Regards,

--- In c..., chirag jagadish
wrote:
>
> hi,
> when you connect the 2812 to computer(PC), you can see the watch
window and realize that there is noise
> i do not understand how you could see the absence of noise when
you cannot see the watch window or you dont see the graph in ccs.
> can you tell me how you observe data without connecting to ccs.
> this might help me with my own project.
> thank you
> bye
>
>
> Salih Cihan Tek wrote:
> Hello again,
>
> It seems like the noise was coming from the PC. When i disconnected
the
> board from the PC and powered it while the circuit in the
breadboard
> was connected to its ADC, the noise was gone. But there should be a
> solution that will make the board work properly while its connected
to
> the parallel port of the PC, or should i run the application from
the
> FLASH for using the ADC(i hope that this isn't the case).
>
> Regards,
>

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467

The 2024 Embedded Online Conference