cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U545 : LPBAM cotinuous ADC multichannel

Aurelien1
Associate III

Hi,

I am using an STM32U545 on which I expect to use ADC4_IN1 and ADC4_IN18 in stop mode 2 (using LPBAM).

I want to create two buffer (buff1 and buff2 uint16_t[32]) dedicated to each input.

I want to read 32 samples from input1 then 32 samples from input2 and restart infintely.

I don't find the correct way to configure LPBAM.

In first try, I use an LPTIM1 as trigger I do :

(sorry my project I can't get image of LPBAM configuration)

1) ADC conversion (channel 1) => ADC Conversion (channel 20) and loop on first conf bloc and use LPTIM1 trigger for both

    => In this case each buffer contain values from correct input but i run only once

2) If I do the same but loop on first data bloc => only last channel ise infinitrly sampled on both buffer

Can someone help me to configure it correctly?

Thanks

Have a good day.

 

Aurélien

 

3 REPLIES 3
Sarra.S
ST Employee

Hello @Aurelien1

One way is to use the DMA linked list to link the nodes and enable buffer chaining

=> check this presentation 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Billy OWEN
ST Employee

Hi @Aurelien1 

 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Billy

Hi Sarra,

I will be on holiday starting tomorrow. I will try to look into it when I return. Regarding the LPBAM configuration, can you confirm if I need to create 3 queues:

  • One for ADC conversion (channel 1).
  • One for ADC conversion (channel 20 in my case).
  • One for LPDMA.

For both queues, I configure the trigger on LPTIM to set the sampling data rate.

For LPDMA, if I don't set any trigger, will the queue switch between each DMA request at the end of the ADC conversion? Or should I use another timer to handle that switching?

I join a project whivh doesn't work (push button won't wake up device) I will correct this part when I come back.

Does the LPDMA and adc configuration is correct? (for this test I expect to connect debug probe in Hot Plug during the 10s sleep).

THanks for your help

Have a good day.

Aurélien