Posts: 2
Registered: ‎04-14-2017
Accepted Solution

get micros for efm32 series

Hello, I managed the SysTick handler for the sleep process, with SysTick_Config (CMU_ClockFreqGet (cmuClock_CORE) / 1000)); implemented the millis () procedure. I would need for microseconds in a project but going to SysTick_Config procedure (CMU_ClockFreqGet (cmuClock_CORE) / 100,000)); It is always Interupt. there is a way to implement this, and have two procedures millis () and micros ().


excuse for my easy english

thank you


regards James

Posts: 557
Registered: ‎09-18-2015

Re: get micros for efm32 series

Hi @jamesmola,


It is unrealistic to use SysTick for microsecond delays/


At 14 MHz (default HFRCO frequency for Series 0), 1 SysTick would be 71.4 ns, so 1 microsecond would be 14 SysTicks.


That's only a few Cortex M-series instructions, which is why you get interrupts all the time.


A higher frequency CPU clock would mean more instructions, but, ultimately SysTick is not a suitable choice for microsecond timing.


If you want microsecond timers, consider using the emdrv USTIMER.



Posts: 248
Registered: ‎11-17-2013

Re: get micros for efm32 series

Worse: Interrupt entry and exit take at least 12 clock cycles on a Cortex-M3. So your 1 µs Systick would just keep the µC in the interrupt handler, even when there is zero code in it.


Note: In practise you need at least the

bx lr

instruction in the handler function - which is the default.

Posts: 2
Registered: ‎04-14-2017

Re: get micros for efm32 series

They will use a timer to sleep and implentare the two functions of millis and micros

Thank you