2021-01-13 07:30 AM
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.
2021-01-25 12:11 AM
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.
2021-01-27 02:46 AM
2021-01-28 04:54 AM
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:
As 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
Once High Resolution is enabled, it will be possible HRTIM Clock Multiplied by 32 prescaler ratio through the Timer B window tab:
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.
2021-01-29 05:33 AM
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