cancel
Showing results for 
Search instead for 
Did you mean: 

25 microSecond (not milli) Interrupt Advice

estersci2
Associate III
Posted on September 18, 2015 at 10:43

Hi,

I would be grateful for some advice on Sampling logic-level signal with a timer.

I haven't done embedded programming in a very long time and so have little experience with the current STM32 offering - and at the moment I am still waiting on Hardware to program. The FW will involve sampling at high frequency, and I see from the Forum that others have run into problems with their approach as regards over saturating the micro etc. I would be grateful if those with experience could tell me if the following approach seems reasonable. 

Basically I want to use a timer at 40kHz to sample the level of a pin and write it to an array element, incrementing along once every 25 uS, in an STM32F417 micro. Systick would remain at the usual 1mS. 

I would be using the cube TIM_timebase example for G-Eval board as a starting point and adjusting the timer and periods to achieve the above rate. Is that a bit naive or does it sound ok? Any ideas as to what kind of rate the above approach could be pushed to, i.e 0.5 MHz?

Thanks.

10 REPLIES 10
Posted on May 05, 2017 at 23:45

Well, since you mentioned reading from an 'unfinished' DMA buffer... There's a major gotcha with relying on NDTR alone, in that NDTR is decremented *before* the transfer happens, thus the processor may read value from the memory before it is updated.

https://community.st.com/0D50X00009XkhAxSAJ

Jan