0
\$\begingroup\$

I realise that the LPC1768's Systick is a standard accross ARM boards, while Timer0 and co, are NXP additions.

Is there any particular reason to use one over the other? Say you want to generate a periodic interrupt every was, which one would be best suited?

\$\endgroup\$
1
  • \$\begingroup\$ One simple difference: SysTick has 24 bit counter, Timer0 havs 32 bits in LPC17xx. \$\endgroup\$
    – Turbo J
    Commented Nov 17, 2018 at 9:06

4 Answers 4

1
\$\begingroup\$

They're different resources for different things. I can't speak to the LPC1768 specifically, but usually the peripheral timers can be used to trigger or feed other peripherals (i.e., an ADC read or a PWM output) while the core timer can't. Also, usually the peripherals can be turned off to save power, while the core timer is going to be running anyway.

If it's just going to be there to provide a software tick, then not only is the core timer ideally suited to that, but you can get it working once and then use that code in other Cortex M-whatever devices.

\$\endgroup\$
1
\$\begingroup\$

The purpose of the systick is provide a timer that is equal on all Cortex M platforms.
For example, an operating system for Cortex M systems will use the systick since that would make it manufacturer independent.

The systick has several unique features:
- Standardised.
- Guaranteed exclusive exception entry in the NVIC.
- Clocked from core clock domain.
- Located in the SCS (system control space) meaning DMA or other cores have no access.
- Only accessible in privileged mode. Meaning threads cannot access it.

Normal peripherals do not provide this security, unless a memory protection unit (MPU) is present.

\$\endgroup\$
0
\$\begingroup\$

The difference is "interrupt priority".

The Systick is used for RTOS, and it is better to have the max priority over other interrupts.

in addition, using the main core Timer(Systick ) across all cortex_m, simplifying the RTOS design.

enter image description here

\$\endgroup\$
0
\$\begingroup\$

Neither one is preferred over the other, as long as your boss or client does not tell you otherwise.

Both SysTick and TIMER can provide periodic interrupts, as well as the RIT, PWM and MCPWM peripherals, or anything that does stuff that takes a fixed amount of time, e.g. an UART. Pick one which is not required for other purposes.

SysTick has one advantage over the others, that it's the easiest to setup.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.