cancel
Showing results for 
Search instead for 
Did you mean: 

timer interrupt

mohammad arabloo
Associate II
Posted on January 01, 2017 at 16:39

hi

I have a stm32f4 discovery board and i use stm32 cube.

I want to create a 400ns interrupt but it doesn't less than 2.5us.

my initialization are:

TimHandle.

Init

.

Period

=

1

;

TimHandle.

Init

.

Prescaler

= 0;

TimHandle.

Init

.

ClockDivision

=

0

;

 can you help me?

thank you

9 REPLIES 9
Khouloud GARSI
Lead II
Posted on January 03, 2017 at 11:24

Hi Mohammad,

All STM32F4 devices give you the ability to create a 400ns interrupt.

Could you please tell me the value of the timer clock you are using.

Khouloud.

Posted on January 03, 2017 at 13:00

Your goal is unrealistic.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 03, 2017 at 15:11

Indeed. With the fastest F4  running from SRAM you only have 72 ticks until the next interrupt.

(eg: 400e-9 / (1/180e6) is 72) 

You will have the inevitable 2x12 ticks of latency, meaning there are only 48 cycles for your assembly written ISR to perform what it want to do. Worst case you can go up to 54, but you'll be tail-chaining forever.

See this article in the 

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0439b/ch03s09s01.html

.
Oliver Beirne
Senior
Posted on January 03, 2017 at 16:53

Hi

arabloo.mohammad

I have moved your post to the

https://community.st.com/community/stm32-community/stm32-forum?sr=search&ampsearchId=172c65f8-4e7d-4345-9952-242faac28f6d&ampsearchIndex=0

where you should post any future product related questions you have.

Thanks

Oli

Posted on January 03, 2017 at 16:48

If this is for modulating an LED driver, use the Hardware to driver the PWM using DMA to load from the pattern buffer.

Period = 1 is problematic too as I recall.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 04, 2017 at 11:30

Dear khouloud,

It is 48mhz

Posted on January 04, 2017 at 11:31

Dear Clive,

why?

Posted on January 04, 2017 at 11:36

Dear Jeron3,

your calculation is correct, but it does not matter

it can't less than 2.5us

Posted on January 04, 2017 at 13:38

Because at some point you'll hit a ceiling where you saturate the processor with the time it takes to execute the interrupt entry, exit and body code.

Beyond a few hundred KHz you'll be hard pressed to do useful work, figure out how to do those things with hardware assistance.

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