cancel
Showing results for 
Search instead for 
Did you mean: 

tim2 of stm32h753: 32-bit counter can only count up to 65,536.

chenwei97
Visitor

1pc.png2pc.png3pc.png

9 REPLIES 9

Perhaps look at and show the code that's running on the part.

The generated code and the print output routines will be far more informative as to why it's not working as expected.

Definitely 32-bit, inspect registers with debugger. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Ok, thank you. Here I'll ask my friend about the code that runs in this part.
In this case, it doesn't necessarily mean the sector has gone bad, does it

>>In this case, it doesn't necessarily mean the sector has gone bad, does it

I don't understand what you mean.

Show the generated code, the configuration screens aren't helping me understand the source of the problem.

Make sure you're not reading the TIM2->CNT value into a smaller variable and truncating.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
    if(htim->Instance==TIM2)
    {
      if(htim->Channel==HAL_TIM_ACTIVE_CHANNEL_1
      {
        up_value=HAL_TIM_ReadCapturedValue(htim,HAL_TIM_ACTIVE_CHANNEL_1);          
        up_counter=__HAL_TIM_GET_COUNTER(htim);

This is the latest test for capturing peripherals, with no captured values at all

56119556d31eb8a35dad9eb2d42b26e.png

 

In the test of capturing peripherals, both upvalue and downvalue should have been captured, but the corresponding values were not obtained at all, they were both 0. That is to say, there is no corresponding hardware for capturing

 

92c97281ea1ebe8232d6eb755add132.png

 

 

On a microcontroller with a frequency of 480M, when running this code, the interrupt can only run up to 70K

Clock-tree setting shows: cpu running at 64 MHz. Why this ?

 

AScha3_0-1752328441841.png

>On a microcontroller with a frequency of 480M, when running this code, the interrupt can only run up to 70K

Seems you run the 480M cpu at 64M . right ?

If you feel a post has answered your question, please click "Accept as Solution".

Show the variable definitions 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

super screens and code parts, but stil dont show if your up_value and other is realy

volatile uint32_t up_value...