sampling adc data on psoc

Thread Starter

milinds.747

Joined Mar 7, 2017
2
I am making an oscilloscope using Cypress PSoC 3. The sample data is sent to the computer and plotted. The ADC is used in single ended configuration. Whenever I connect the signal generator to the board, it throws a lot of garbage values to the UART. On the signal generator, the amplitude set is 1Vpp with 1V dc offset at a frequency of 100Hz. The frame received looks something like this $18 18 18 18 18 18 18 18 18 18%. This problem did not occur when I tried connecting a DC power supply. When I read the component data sheet, it mentioned obtaining a 16 bit result for 8 bit resolution to avoid wrap around. When I obtained 16 bit result, I got 277 instead of 18. The peak amplitude applied is 1.5V, so the sample value that should be obtained is 191 or below from the ADC. This problem occurs irrespective of the input waveform, sine, square or triangular. I tried using a different kit and a different function generator. Futile.

The problem is: The ADC does not send proper sample values of the input signal on connecting a signal generator.
 

ScottWang

Joined Aug 23, 2012
7,499
I don't have the PSoc 3 to try for you, you can try to using 8 bit mode, and set the fixed voltage of power source as 0V, 1V 2V, 3V, 4V 5V, read the voltage from ADC and send the value to the DAC and then using DVM to measures the voltage to comparing the input value and output value, are they all the same?

Fixed voltage 0V, 1V 2V, 3V, 4V 5V → (ADC → PSoc 3 → DAC) → DVM

Above is the simple way to check what you get from the input, you also can do this way --
Fixed voltage 0V, 1V 2V, 3V, 4V 5V → ADC → 8 bits data → DO~D7 (8 digital ouput) → 8 leds + 8 resistors → GND

These can be a simple code indicators when you run some errors in the codes, you just send the values to the code indicators to make sure what values you get when program is running.

DO (digital ouput) → 8 leds+8 resistors → GND

If you use 16 bits then you will need 16 leds + 16 resistors.
 

Thread Starter

milinds.747

Joined Mar 7, 2017
2
Yes Sir, I am using the ADC in 8 bit mode. The 16 bit result is acquired to avoid getting a wrap around result. The input range is 2V and I measured the input on a CRO applying it. My apologies for missing such crucial detail.
 
Top