Skip to main content
Associate
January 11, 2024
Question

STM32H7 periodical TIM triggered SPI transfer w/o DMA?

  • January 11, 2024
  • 28 replies
  • 5809 views

On a STM32H745ZI-Q - Board I want to create periodical 4-byte SPI transfers  triggered by a timer. 

So far I got this working the following way:

TIM triggers DMA
DMA initiates the SPI transfer.

However, the SPI transfer timing (CS low) has a high jitter of 100 ns, which is not acceptable.

To reduce the jitter: Is there any known way to trigger the SPI transfer start directly by a timer on this specific MCU (from reading the RM, I don't think so)? 

The data to be transfered could be written to the SPI FIFO in advance by an ISR triggered with a proper delay. 

This topic has been closed for replies.

28 replies

LCE
Principal II
January 16, 2024

At least for some other H7s (H723, 725, 733, 735) the 960 MHz after DIVN1 would be too much.
Maybe you are above the limit and CubeMX doesn't recognize it?

MSZBAuthor
Associate
January 16, 2024

At least for some other H7s (H723, 725, 733, 735) the 960 MHz after DIVN1 would be too much.
> Maybe you are above the limit and CubeMX doesn't recognize it?

For H745 the limit is 960 MHz (from STM32H745xI/G, table 59)

waclawek.jan
Super User
January 16, 2024

> HSE is used, 8 MHz MCO from ST-LINK.

As I've said above, the primary clock there is *not* HSE but HSI.

> It's jitter is roughly 1 ns.

Cycle-to-cycle jitter of HSI may be way better than long-term jitter.

Try to switch STLink to output the HSE-originated 25MHz/3 clock, and change the target's clock accordingly.

JW