cancel
Showing results for 
Search instead for 
Did you mean: 

Why doesn't the ADC work when I select the prescaler ratio "HRTIM Clock Multiplied by 32" for the timer that triggers the ADC?

MOys.1
Associate II

Hello

I use a HRTIM timer (Timer B) to trigger the ADC (ADC2_IN5) internally (STM32G4).

I want to increas the high-resolution clock frequency fHRCK with a prescaler ratio: 170MHz*32=5.44GHz to trigger the ADC via a compare value of 54.400.

Unfortunately, the ADC doesn't work properly with this prescaler. If I enter a prescaler ratio of 1, then everything works correctly.

Does anyone have an idea what the problem could be?

(If you need more information to answer the question, let me know.)

Any advice would be helpful. Thanks.

4 REPLIES 4

Hello @MOys.1​ ,

Let me first welcome you to our community :)

Sorry for the delay.

Could you please attach your .ioc file , it will help to investigate the problem ?

Thanks in advance,

Khouloud.

MOys.1
Associate II

Hello @Khouloud OTHMAN​ ,

Thank you for your reply!

I attached the .ioc file and hope it helps.

Regards,

Marit

Hi @MOys.1​ ,

If I well understand your problem, and backing to your attached .ioc file, you're not able to select HRTIM Clock Multiplied by 32 prescaler ratio through CubeMX:

0693W000007D2VBQA0.jpgAs indicated by the displayed contextual help message when hovering the mouse over HRTIM Clock Multiplied by 32 prescaler ratio, the High Resolution should be enabled

0693W000007D2XpQAK.jpgOnce High Resolution is enabled, it will be possible HRTIM Clock Multiplied by 32 prescaler ratio through the Timer B window tab:

0693W000007D2ajQAC.jpg 

Those are the steps in order to increase fHRCK to 5.44GHz.

Feel free to come back to me if your issue isn't resolved.

Khouloud.

MOys.1
Associate II

Hi @Khouloud OTHMAN​ ,

I know that High Resolution must be enabled to select HRTIM Clock Multiplied by 32, but when I selected that for the ADC timer the ADC didn't work properly. I intentionally disabled High Resolution, so I could at least work with the ADC.

I found out, that the problem is the Debugger.

However this is possible, but when the Debugger is connected to the board the ADC doesn't work properly. If I disconnect the Debugger from the board befor starting the program, everything works fine and I can also use High Resolution and HRTIM Clock Multiplied by 32.

But I think why that is the case is a question for another post.

Thanks a lot for your help.

Marit