Skip to main content
Associate II
February 10, 2025
Solved

EVSPIN32G4NH - opamp ADC setting

  • February 10, 2025
  • 1 reply
  • 1193 views

Dear community 

I would like to ask regarding ADC raw value for current sensing in STSPIN32G4. As we can see on below image the raw value of ADC1 CH3 and ADC2 CH12 is always in range of few hundreds. FYI, the motor is in rotating mode. We can see from the PWM duty cycles, it is changing every time.

When measured using multimeter for phase current W, the current is always alternate from +3.5A to -1.2A which make sense. but the ADC raw values keep in hundreds. I was expecting it alternate from > 2048and < 2048.

ADC resolution is 2^12.

2048 = 0A // >2048 = +A //2048 = -A
But the ADC readout values are always less than 2048, or more specifically, they fluctuate between 172 and 208.

image-20250212-085645.png
Can you help to advise on this weird raw ADC values? below is my multi-channel ADC1 settings.
image-20250212-090058.png
We have also tried changing the ADC alignment to right-aligned, but instead, the values dropped to only two digits.
Sheng123_0-1739353803676.png

We have attached our ADC.c file. Could you kindly point us in the right direction?
Any guidance would be greatly appreciated.

 

many thanks!!!

Best answer by GMA

Hello @Sheng123,

ADC full scale dynamic will depend on Rshunt/Gain/Current values as shown in MC Workbench / Current sensing tab (EVSPIN32G4 board):

GMA_0-1739528284085.png

 

1 reply

GMA
GMABest answer
Technical Moderator
February 14, 2025

Hello @Sheng123,

ADC full scale dynamic will depend on Rshunt/Gain/Current values as shown in MC Workbench / Current sensing tab (EVSPIN32G4 board):

GMA_0-1739528284085.png

 

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