cancel
Showing results for 
Search instead for 
Did you mean: 

ADC DMA configuration with different groups

Basavanagouda1
Associate II

Hi All, 

We are using the SPC560P50L3 controller in our project. ADC0 and ADC1 are used to read 16 ADC channels.

ADC0 is configured with one group with 6 channels, ADC1 is configured with 2 groups. Group1 - 6channels   Goup2 - 4channels.

We need to read the ADC0 group channels at a higher rate, its conversion is called in the while loop (ADC_Handle_Grp1_Measurements), and ADC1 groups are called in the 1msec timer (ADC_Handle_Grp23_Measurements). 

We are using adc_lld_setup_scan_conversion() to configure the ADC0 to enable DMA to read the ADC channels with 32samples and adc_lld_start_conversion() is used to configure the ADC1 groups to read 1 sample. 

Since we are using 2 groups in the ADC1, the DMA configuration will be shared between 2 groups. Each group will wait until to complete the ADC interrupt to configure the DMA adc_lld_start_conversion(). 

Some time we are facing problems, code is calling adc_lld_start_conversion() configure the DMA and wait for the new ADC values. ADC is stop generating new values and interrupts.  adc1_grp1_conv_completed() and adc1_grp2_conv_completed() callbacks are used to indicate the ADC conversion completion. 

Is there any register that can be used to check the ADC conversion is complete? or how we can configure DMA with two different ADC groups. 

I'm sharing the ADC function in the attachment file. Kindly review the file and let us know how we can solve this issue. 

Thanks,

Basava.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 REPLY 1
Erwan YVIN
ST Employee

Sorry , i do not see the configuration of adc*_group_adc*_grp*

Have you set your ADC in circular mode ?

Best Regards

Erwan