cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h7 spi interrupt latency

kgang
Associate II

Hi all,

I interfaced external(off board ADC) to stm32h743 microcontroller. i am receiveing data in spi interrupt mode. i enabled RXPIE interrupt.But the interrupt latency is increasing as Baud rate of SPI is increased.at lower speeds latency is small(KBPS around 5ons) but at higher speed around 40Mbps latency increased(1us) can i know the reason what all configarations should be made.

Any suggestion is highly appreciated.

Regards,

krishna.

7 REPLIES 7
Danish1
Lead II

This seems counter-intuitive. How are you measuring it?

If it is by detecting overrun / lost bytes in a sequence, remember that you'll only lose a byte if you fail to read that byte before the next one is received (which happens more rapidly if you're sending at a higher data-rate).

If you need a high throughput, you might be better off using DMA to transfer incoming data to a buffer in memory.

Hope this helps,

Danish

Ozone
Lead II

> This seems counter-intuitive. How are you measuring it?

I would agree.

Perhaps you get the handler runtime involved (tailgating).

You don't use Cube and it's dreaded callbacks, do you ?

i am toggling the Gpio in the interrupt handler and probing on CRO .i am not using cube  callbacks.or APIs

What is CRO?

What event triggers the interrupt?

What is the SPI setup? Is the FIFO enabled?

berendi
Principal

> 5ons

Is it 50 ns? As in, 24 cycles at 480 MHz?

For comparison, i.MX RT1050 manages that in 73.4 ns.

Receive packet triggers the interrupt . CRO - oscilloscope. SPI is in master receive only mode .

yes