Skip to main content
gapryun
Associate II
July 15, 2014
Question

How to convert the DWT CYCCNT to ns ?

  • July 15, 2014
  • 3 replies
  • 918 views
Posted on July 15, 2014 at 17:26

Dear

I have read Ch16.2 Trace component DWT, the definition guide of Cortex M3 2nd. But I still confuse it. 

If I take the CYCCNT, the corresponding time is CYCCNT * 168 MHz * 1e9 ?

Am I correct?  

Thanks 
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    July 15, 2014
    Posted on July 15, 2014 at 17:36

    You understand the basic relationship between frequency and period, right?

    At 168 MHz each tick is about 5.95ns

    [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/How%20to%20convert%20the%20systick%20to%20ns&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=5]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fHow%20to%20convert%20the%20systick%20to%20ns&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https%3A%2F%2Fmy.st.com%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FAllItems.aspx¤tviews=5
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    gapryun
    gapryunAuthor
    Associate II
    July 15, 2014
    Posted on July 15, 2014 at 17:49

    Sorry, clivel, My smartphone have strange problem so it did not submit my question.  For now, I have updated. And thank you for your nice reply.

    Tesla DeLorean
    Guru
    July 15, 2014
    Posted on July 15, 2014 at 17:58

    This forum does not work well with smartphones or tablets

    >> CYCCNT * 168 MHz * 1e9

    You need to make an initial, and final measurement, and subtract them to understand how many ticks occurred in the measurement period.

    Then  (DeltaTicks / 168000000.0) * 1e9 would give you nanoseconds
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..