Synchronous ADC

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I am building a sensor which detects radiation reflected by surfaces. The signals are very low, so I have problems with noise. To reduce quantization noise at the ADC I want to duplicate my signal using voltage followers. The duplicated signals should be converted synchronously. Because I have two real signals, which have to be converted synchronously in first place it is very important to know, how many synced inputs I can run on my XMC4500. Is it possible to use 4 synced inputs per signal, so 8 synchronous conversions in total?

I have searched in the manuals and in the forums but unfortunately I haven't found an answer yet.

Thanks for your help!

Best regards,
MTR
0 Likes
12 Replies
Not applicable
Are you using DAVE3?

I think that you can configure 4 ADC002 apps, and 2 sync channels in each.
Each ADC002 can be trigger by some signal that you can define.
0 Likes
lock attach
Attachments are accessible only for community members.
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
MTR wrote:
Hello,

Because I have two real signals, which have to be converted synchronously in first place it is very important to know, how many synced inputs I can run on my XMC4500. Is it possible to use 4 synced inputs per signal, so 8 synchronous conversions in total?


Best regards,
MTR


Hi MTR,

I had created x4 synchronous AD chs with x4 slaves AD chs for your reference. Can you give this example a try?

Please click on manual pin assignment to understand ADC pins assignments

Best regards
Travis
0 Likes
Not applicable
Happy New Year and thanks for the posts!

Sorry for the late response! I had no possibility to check your answers due to a new installation of Windows...

I examined the uploaded file and it looks like what I need, thank you very much!
Just to be sure, that I understand it right:
In the example, I have 4 Masterchannels with 2 Slavechannels each.
With every complete conversion in all channels the interrupt is set and the results are written in AD_Result[0...7]
I have to request the conversion because it is not in scan-mode, right?
I can access the Results with a pointer to the AD_Result-Registers.

Sorry, if the questions are self-explanatory, but I could not find a 100% answer for these questions.

Thank you very much!
Best regards
MTR
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
MTR wrote:
Happy New Year and thanks for the posts!

Sorry for the late response! I had no possibility to check your answers due to a new installation of Windows...

I examined the uploaded file and it looks like what I need, thank you very much!
Just to be sure, that I understand it right:
In the example, I have 4 Masterchannels with 2 Slavechannels each.
Travis: Yes, x4 Master (ADC0) and x4 Slave (ADC2)

With every complete conversion in all channels the interrupt is set and the results are written in AD_Result[0...7]
Travis: Interrupt is set when AD result is copied into the result register for the last conversion. Pls help to verify on this.

I have to request the conversion because it is not in scan-mode, right?
Travis: No this is in queue mode with refill. You can have the option of continuous conversion by unchecking "External Trigger" at the Queue Configuration tab of ADC002/0.

I can access the Results with a pointer to the AD_Result-Registers.
Travis: Sure you can.

Sorry, if the questions are self-explanatory, but I could not find a 100% answer for these questions.

Thank you very much!
Best regards
MTR



Hi MTR,

Please see my reply above.

Best Regards
Travis
0 Likes
Not applicable
Hello again,

I tested the programm and did my own version of it. I want to convert a 40 kHz rectangular signal. With the displayed "Total Conversion Time" of 550ns it yould be about 45 values in one period of the 40 kHz signal. Unfortunately I only get about 3-4 Values in one Period, which would be a conversion time of 6,25µs. What am I doing wrong?

For testing purposes I reduced the Channels to 2 slaves again, because I thought, this might have an effect.

Here is some code, I'm using to store the results in my own array:

for(count=1; count<2001; ++count)
{
ADCSYNC001_GetResult(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_Handle0, &Result[0]);

ADCSYNC001_GetResult(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_SA_Handle0, &Result[1]);

ADCSYNC001_GetResult(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_SB_Handle0, &Result[2]);

ADCSYNC001_ClearResultEvtFlag(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_Handle0);

Array[count][0]=count;
Array[count][1]=Result[1]; //R
Array[count][2]=Result[2]; //G

}

The ADC002 is running in Standard Conversion Mode.

Can you help me with this? I need at least 10 values but the more the better.



Unfortunately the conversion is not synced with the PWM-Signal I am using for the signal. The signal changes with a beat frequency and is not usable for my sensor method. Can you help me with that, too? I thought about doing only a few conversions each time the period match interrupt of the pwm-signals occurs. That would be pretty circular... Is there a better way for that?


Thank you very much for your help.

Best regards,
MTR
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Can I confirmed that you are asking to have as many ADC conversions within the time frame of 250usec (40KHz)? If this is the case then, I think it would be sensible to use the FIFO method.

To get things right the first time, I hope you can provide a better detail requirement with pictures showing waveforms and when you want to trigger the ADC conversion, when you want to read the ADC result, when the next conversion is going to happen etc. Otherwise I would be guessing .....:o
0 Likes
Not applicable
Thank you for your message, and you are right, that without my signal form it is hard, to get the idea.

I can't provide a picture from the oscilloscope but the simulation looks exactly the same.

465.attach

The signal consists of three different parts. The medium signal comes twice as often (20kHz) as the low and the high signal (10kHz each). The effective frequency is 40 kHz. The signal always return to 2,5 V. I want to set the alternative reference to that voltage to gain some resolution between 2,5 and 0 Volts. (Don't worry about the peak values (only 20 mV difference), it is the lowest signal i can get in my optical design, the typical signal is higher). I get a similar signal from a monitor diode, to normalize the recieved values (so everything times two).

I thought about converting during the signal puls (as many conversions as possible) and maybe store in the "normal state" (2,5V) But I also have to convert at least once, but better several times in the normal state to get the reference. The idea is, to calculate the average of each peak, to do some calculations with the signal values. My next idea was, to put this signal as an input to 4 ADCs to minimize the quantisation noise, to get better results.

Is it better, to do ony cycle with 4 peaks (100µs) and have a little pause to store it and then bring the next signal? Should I use only one ADC, to reduze the amount of values, that have to be stored?

If you have further questions about the application, please let me know!

Thank you very much for your help.

MTR
0 Likes
Not applicable
Hi,

I have another problem with the ADC, or better with the storage of the results.

I created an array with 3000 lines and 3 rows to store the signal two times and the number of the measurement.
I did it like this
uint32_t Array[3000][3];
and store the results like this:

/* Result of the Slave A Channel A */
ADCSYNC001_GetResult(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_SA_Handle0, &Result[1]);
/* Result of the Slave B Channel A */
ADCSYNC001_GetResult(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_SB_Handle0, &Result[2]);

ADCSYNC001_ClearResultEvtFlag(&ADCSYNC001_Handle0, &ADCSYNC001_MSYNCA_Handle0);

Array[count][0]=count; //Übertragung der Rohdaten in Speicherarray
Array[count][1]=Result[1]; //EMPFANG
Array[count][2]=Result[2]; //MONITOR

This is a very small number for testing issues but as I increased it, I got the following error message (each with the path of the directory in front of it):

SD_PWM_DAC_ADC_UART_Test2.elf section `.bss' will not fit in region `DSRAM_1_system'
address 0x20010c3c of SD_PWM_DAC_ADC_UART_Test2.elf section `.data' is not within region `DSRAM_1_system' //(3x)
region `DSRAM_1_system' overflowed by 3132 bytes


I understand, that there are overflows of the great amount of data, but why is it like that? How can I create an array to store at least 10000 values for each row? Do I have to set an DMA or something like that?

Any hints for the problem in the post above would be perfect, too!

Thank your very much!
MTR
0 Likes
Not applicable
Hi Travis,

In your code you are writing:
AD_Result[0] = VADC_G0->RES[4];
AD_Result[1] = VADC_G0->RES[5];
AD_Result[2] = VADC_G0->RES[8];
AD_Result[3] = VADC_G0->RES[15];
AD_Result[4] = VADC_G2->RES[0];
AD_Result[5] = VADC_G2->RES[1];
AD_Result[6] = VADC_G2->RES[2];
AD_Result[7] = VADC_G2->RES[3];

But why not?
AD_Result[0] = VADC_G0->RES[0];
AD_Result[1] = VADC_G0->RES[1];
AD_Result[2] = VADC_G0->RES[2];
AD_Result[3] = VADC_G0->RES[3];
AD_Result[4] = VADC_G2->RES[4];
AD_Result[5] = VADC_G2->RES[5];
AD_Result[6] = VADC_G2->RES[6];
AD_Result[7] = VADC_G2->RES[7];

is there a reason for that?
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
The reason why I am writing in this order is because DAVE had actually assigned the result registers. You can click on the "Resource mapping information" icon to understand this better.
0 Likes
User13476
Level 1
Level 1
Hello Travis,

Reference: XMC4700

I am doing Synchronous method of ADC conversion. I made Group0 G0 as master and all the other groups (G1, G2, G3) as slave. I enabled all the 8 channels of master for conversion.

I am finding that last channel either of the (G1CH15 => P14.15, or G3CH15 => P15.15) are not performing ADC conversion. Some time G1CH15 will not in some time G3CH15 won't work.

Need guidance.

Thanks.
0 Likes
Eric1
Employee
Employee
Hi ADCGuy,

Generally there is no reason that CH15 is not working.
There are only 2 options:
- Wiring of the board.
- Time between 2 Triggers.

1. Please check the warring or the MCU configuration. E.g. with XMC Pinout tool.
2. Please make sure that you have enough time between both triggers.

Best Regards
Eric
0 Likes