Skip to main content
saimaddy123
Associate III
March 19, 2011
Question

STM32 USB Library - USB_DELAY from any source other than SysTick??

  • March 19, 2011
  • 1 reply
  • 432 views
Posted on March 19, 2011 at 14:51

STM32 USB Library - USB_DELAY from any source other than SysTick??

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:28

    Couldn't you just spin on the core's DWT cycle counter?

    CycleStart = *DWT_CYCCNT;

    while((*DWT_CYCCNT - CycleStart) < DelayCycles);

    [DEAD LINK /public/STe2ecommunities/mcu/Lists/ARM%20CortexM3%20STM32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/ARM CortexM3 STM32/No definition for DWT in Core_cm3.h&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000626BE2B829C32145B9EB5739142DC17E&currentviews=158]See Here

    I'd also recommend you initialize things, and get the clock frequencies once rather than reading them every time you want a delay.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..