cancel
Showing results for 
Search instead for 
Did you mean: 

STMG431 RBT6 - ADC sync does not seem to work as per manual

Tobe
Senior III

Hi,

i am testing the ADC at the moment, and the values i get out of it look pretty good. Except, when using a squarewave.

See my video:

https://www.youtube.com/watch?v=TmKADM2yQvU 

The manual states for having the ADC run from AHB clock: "... has the advantage of bypassing the clock domain resynchronizations. This can be useful when the ADC is triggered by a timer and if the application requires that the ADC is precisely triggered without any uncertainty ...". But as can be seen, there is an issue, as the blue signal (which represents the bits of the adc - derived from tim2 pwm) does some "steps" over a period of about 1.3us. It does not so when inputting a triangular wave.

Anyone has experience here? Or any idea? I have already changed from checking the ADC measure from NOPs in a loop to PWM, to rule out any delays in code execution. But it still looks, like there is no precise triggering of the ADC.

I would expect the ADC value (blue pulse) to step up at one point.

Edit:

I made another screenshot, where it probably is easier to comprehend whats happening: Steep signals create artefacts in the measurement of unknown source.

1 ACCEPTED SOLUTION

Accepted Solutions
Tobe
Senior III

I found the cause:

I had oversampling on. This, the fact, that the Rigol DG800 could not be used as one would need (could not sync anything with the backside plugs - and much more issues), and that the scope also has its capture and processing "rhythm", most likely caused the issue.

View solution in original post

2 REPLIES 2
Tobe
Senior III

I found the cause:

I had oversampling on. This, the fact, that the Rigol DG800 could not be used as one would need (could not sync anything with the backside plugs - and much more issues), and that the scope also has its capture and processing "rhythm", most likely caused the issue.

Tobe
Senior III

Now i have finished the research:

- It works as in the manual stated.

- The results could be quantified.

AHB freq is 42.5MHz.

The triangular wave is 25kHz with 1% sym.

 

Blue trace is pwm from timer 2 at 170Mhz -> timer tics = adc bits