How to setup a queue source for the VADC on an XMC1200 with data reduction

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

cross mob
Not applicable
I am trying to setup a queue source on the VADC to perform equidistant sampling of Group0, CH0. The distance between each sample should be 15.625us.
I would like to accumulate 4 consecutive samples before writing the result in a result register. When the result is written into the result register, an ISR should be called and P0.0 toggled.
I would like to use a CCU4 timer slice to repeatedly trigger this sequence.

Once the fourth sample of Group0_CH0 has been written into the result register, four consecutive samples of a second ADC channel, e.g. Group1, CH0, should be sampled as fast as the sampling unit allows. After the fourth sample an ISR should be called and P0.1 toggled.
The goal here is noise reduction. I am not sure whether to use a scan or queue source for sampling this second channel.

Can someone please explain the best way to do this?

2122.attach
0 Likes
2 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,



// Result register 1
{
.post_processing_mode = XMC_VADC_DMM_REDUCTION_MODE, //DMM = 0 (Data reduction mode)

#if DATA_REDUCTION
.data_reduction_control = 1, //DRCTR = 1 (Accumulate 2 result value)
//.data_reduction_control = 2, //DRCTR = 1 (Accumulate 2 result value)
#else
.data_reduction_control = 0, //DRCTR = 0 (Data reduction disabled)
#endif


0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

you can reference to this attached project.

The VADC is trigger by a 10Khz PWM from CCU4. Please make the necessary changes to the result register for data reduction as show by previous thread.
0 Likes