- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
04-14-2017 08:18 AM
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
Solved! Go to Solution.
04-15-2017 04:06 AM
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.
04-17-2017 03:14 AM
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
instruction in the handler function - which is the default.