Skip to main content
Visitor II
April 1, 2025
Question

STM32H7 timer is too slow

  • April 1, 2025
  • 2 replies
  • 556 views

Hi,

I'm using STM32H755 Nucleo board and I'm trying to use TIM2 to trigger Dual ADC conversion. M7 core is running FREERTOS and M4 is bare metal. ADC is controlled by M4 core. DMA is used to transfer data to M7 and then M7 is using ethernet to transfer data further. Sampling rate of my ADC is 1.92MSPS (12bit). I try to use TIM2 to trigger ADC. This should happen with rate of 60Hz. Every 16.67ms (60Hz), I would like to collect 2x2048 samples.

For some reason my TIM2 interrupt occurs every 52ms. It sounds like my clock rate is not 200MHz as shown in .ioc, but it is 64MHz. What might explain the problem?

clock.PNGTIM2.PNG

    This topic has been closed for replies.

    2 replies

    Super User
    April 1, 2025

    Isn't your primary clock source 8MHz instead of 25MHz?

    JW

    mosamasaAuthor
    Visitor II
    April 1, 2025

    That would match with 52ms vs 16.67ms, but according to my understanding my clock source is 25MHz HSE and APB1 timer clock is 200MHz.

    Super User
    April 1, 2025

    If we talking about 

    NUCLEO-H755ZI-Q

    see circuit:

    AScha3_0-1743521412635.png

    so clock from st-link: 8M . (not 25M, or 25/3 ~ 8.33M , depends on st-linkV3 setting on update)

    AScha3_1-1743521508357.png

     

    Super User
    April 1, 2025

    waclawekjan_0-1743521659102.png

    JW