Skip to main content
Associate III
April 4, 2025
Solved

Add a channel to existing Injected Channels ADC in MC Workbench

  • April 4, 2025
  • 2 replies
  • 634 views

Hello,

 

I was reading the RCM Regular Conversion Manager. It states that it is forbidden to add new injected channel on ADCs using current sensing. However, they do give an option to use regular conversion.

 

But in my case, I need to read a sensor at the  same time of the current sensing. Since we have two ADCs used for current sensing since I am using STEVAL-PTOOL4A, is it possible to add this channel as injected one on both ADCs ? and what is the issue in adding it to one of the ADC as injected channel? I don't get what could be the issue?

 

Thank you.

Best answer by GMA

Hello @AnthonyK,

For ADC3, if you are using a different sampling time, you are right.

Using STM32CubeMx and STEVAL-PTOOL4A schematic, you can try to find a solution that does not impact the board.

2 replies

GMA
Technical Moderator
April 4, 2025

Hello @AnthonyK,

If you are not using High Sensitivity Observer, ADC3 is not used and PB1 Pin input is available.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
AnthonyKAuthor
Associate III
April 4, 2025

Aha ok, but the issue I need  this additional ADC to be triggered with the same event of the current ADCs (so it is the middle of the PWM signal). Is it ok than to have an interrupt from the ADC3? 

 

Plus if I have well understood, in the generated cubeMX  from the MC Workbench, the ADC1 and ADC2 interrupts are configured as end of single conversion. However, in the generated code (in the R3_2_Init) we disable the EOC and we enable the end of sequence conversion of one of the ADCs? 

GMA
Technical Moderator
April 4, 2025

Hello @AnthonyK,

Setting ADC3 External Trigger parameters as for ADC1 and ADC2, ADC3 Inj value will be available at the same time as the reading of the ADC1/2 current values.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
AnthonyKAuthor
Associate III
April 7, 2025

Thank you. But this depends also on the sample time of the ADC3. But in general, is it better to poll the EOC or to generate an interrupt which will be lower in priority than the ADC of the current? Plus, since the PB1 input uses the BEMF, I should configure the board and connect the new signal?

GMA
GMABest answer
Technical Moderator
April 8, 2025

Hello @AnthonyK,

For ADC3, if you are using a different sampling time, you are right.

Using STM32CubeMx and STEVAL-PTOOL4A schematic, you can try to find a solution that does not impact the board.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA