Skip to main content
Associate II
June 22, 2024
Question

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

  • June 22, 2024
  • 2 replies
  • 1239 views

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

 

2 replies

AScha.3
Super User
June 22, 2024

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""."
nevase123Author
Associate II
June 22, 2024

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

 

Regards,

Sachin N

AScha.3
Super User
June 22, 2024

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""."
Tesla DeLorean
Guru
June 22, 2024

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 VenmoUp vote any posts that you find helpful, it shows what's working..