cancel
Showing results for 
Search instead for 
Did you mean: 

can i use systick timer for 1us without isr? If yes please provide example

nevase123
Associate II

Hello Team,

Want to use systick timer for time base of 1uS without interrupt. 

Please help me on this to configure it without interrupt.

 

Regards,

Sachin N

 

4 REPLIES 4
AScha.3
Chief II

Hi,

>can i use systick timer for 1us 

No.

(You can set it to 1us - yes, but you ask for "use" : so what you wanna "use" on a cpu, if your systick keeps cpu busy at almost 100% ?)

You can set any timer to output a 1us PWM , no problem, but to do anything (like INT) at this rate is bad idea.

If you feel a post has answered your question, please click "Accept as Solution".

I want to use 1uS systick timer for scheduler. Basically I want to do this without interrupt.

 

Regards,

Sachin N

Oh, then try it. 

Just - whats your core clock ? 48M ? So about 30...48 instructions can your cpu do here, but :

how much time you need to switch tasks ? 12 clk for registers, then save task stack, and then have maybe 20 instructions , until next task switch comes....

and how switching comes, without INT ? polling ????

and what you expect to do with this then ? (Most time the cpu now busy with task switching, not much time for any program left.

If you feel a post has answered your question, please click "Accept as Solution".

You really should talk to each other...

https://community.st.com/t5/stm32-mcus-boards-and-hardware/systick-timer-configuration-in-microsecond-for-stm32c031c6-mcu/m-p/688843

 

uint16_t start = TIM3->CNT; // Say 10 MHz count

while((TIM3->CNT - start) < 10); // Wait ~1 us

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