SysTick - SystemCoreClock - mismatch?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-12-29 4:56 AM
Posted on December 29, 2010 at 13:56
SysTick - SystemCoreClock - mismatch?
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2011-05-17 5:19 AM
Posted on May 17, 2011 at 14:19
Sounds more like a compiler optimization or code placement issue. Or the length of the test, and the granularity of your timebase.
Software timing loops are notoriously unpredictable, and will be compounded by placement with respect to the flash/cache lines. For predictable timing, I'd use the core's cycle counter. Something like this would generate more consistent code and placement between two compiles. void SetSysTick(int i) { SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK); if (i == 1) SysTick_Config(SystemCoreClock / 1000); // = 1ms else if (i == 2) SysTick_Config(72000); // = 1ms } SetSysTick(1); //SetSysTick(2);
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
