cancel
Showing results for 
Search instead for 
Did you mean: 

How could I config the CBC(Cycle-By-Cycle) counter of STM32G4?

ZYu.1
Associate III

I want to use STM32G474 controling a boost converter.​

A ADC channel(configered as injected convert) sense the inductor current,I do the configuration like this:

  1. The ADC channel is triggered by at middle of MOSFET on time;
  2. The ADC sensed pin is routed as a COMP1 input(COMP1_INP), and a DAC is configured as another input of COMP1(COMP1_INM);
  3. COMP1's output onfigured as external event of HRTIM;
  4. HRTIM's reset sourece is selected as the external event described ablove;
  5. In my code ,I could set a threshold value , when the ADC pin input voltage grater than the set value,the COMP1 output a high level,and than trigger the HRTIM output reset,that is no problem,but when I let the ADC pin sense voltage below the threshold value, the HRTIM can recover its output, that is the CBC's function ;

As I described avlove,the CBC works normaly,but I want to lock

the power after a few counts of CBC protection(such as if the CBC appear 20 times,the HRTIM will never recover its output, unless I deal with it in my code),that is useful when the power output is short;

So can anyone help to answer me how can I achive the limited CBC counter protection?

S

0 REPLIES 0