Skip to main content
TChun.11
Visitor II
January 22, 2021
Question

Isn't this a bug in X-CUBE-SPN8 ?

  • January 22, 2021
  • 1 reply
  • 589 views

I've been working on BLDC motor control using STM32F302R8 with X-CUBE-SPN8. I've found there occurs wrong ADC conversion frequently. Thinking this comes from that the LFtimer period which is related to step changes and varies with motor speed, is not aligned with HFtimer which affects the PWM and ADC conversion, I added the following codes before every ADC conversion(HAL_ADC_GetValue()) in function MC_ADCx_SixStep_Bemf() and solved this problem. Arbitrary step changes seem to cause the corruption of ADC channel change sequence.

if( (((hadc1.Instance->SQR1)>>6 ) & 0xF) == SIXSTEP_parameters.CurrentRegular_BEMF_ch ) for BEMF

if( (((hadc1.Instance->SQR1)>>6 ) & 0xF) == SIXSTEP_parameters.ADC_SEQ_CHANNEL[index_adc_chn] ) for Vbus, current, temperature...

This topic has been closed for replies.

1 reply

Laurent Ca...
Senior III
March 1, 2021

Dear @TChun.1​ 

Just in case, what SDK version do you use?

Best regards

==

Laurent Ca...