2016-01-01 07:39 AM
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
2017-01-03 02:24 AM
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.
2017-01-03 04:00 AM
Your goal is unrealistic.
2017-01-03 07:11 AM
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
.2017-01-03 07:53 AM
Hi
arabloo.mohammad
I have moved your post to the
where you should post any future product related questions you have.Thanks
Oli
2017-01-03 08:48 AM
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.
2017-01-04 03:30 AM
Dear khouloud,
It is 48mhz
2017-01-04 03:31 AM
Dear Clive,
why?
2017-01-04 03:36 AM
Dear Jeron3,
your calculation is correct, but it does not matter
it can't less than 2.5us
2017-01-04 05:38 AM
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.