waitcnt
anita1984
Posts: 23
Dear forum,
please can someone explain for me if i have waicnt (80 000+cnt) , how much time the cog is paused , i am using a _clkmode = xtal1 + pll16x with a clock of 5MHz
Thank you in advance,
Anita
please can someone explain for me if i have waicnt (80 000+cnt) , how much time the cog is paused , i am using a _clkmode = xtal1 + pll16x with a clock of 5MHz
Thank you in advance,
Anita
Comments
clocks / clocks_per_second = seconds
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 9/27/2009 8:57:39 PM GMT
Was funny, I had just sorted out waitcnt a few minutes before checking into see your query. Perfect.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Each cnt tick in the case of xtal 5MHz and PLL16 is 12.5ns or 80MHz.
So, the calculation is 80_000/80_000_000Hz = ~1ms or waitcnt(clkfreq/1000+cnt).
There is some fudge factor in it because of Spin performance of course.
Yes, welcome new forum participant anita1984.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propeller Tools
Thanks for the nice catch. Was moving quickly, and that will teach me to post and code.
I made the edit, and PM'ed her, just in case.
Well? See, we are a good crowd, and quick too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!