Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simply delayNano Mod Add delayCycles #387

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Defragster
Copy link
Contributor

Demonstrated in https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=212280&viewfull=1#post212280

Does this have possible utility worthy of supporting?

Did a compare of overhead factor -10 to -13 and change to -11 tracks better.

Did a loop of 20 passes of 5 inline calls and divided the CycCnt /100 - using offset of -10 tracks better than -12.
>> uint32_t begin = ARM_DWT_CYCCNT-10; // Overhead Factor for execution

Calling delayCycles() cusps on groups of 4 cycles because of while().
returns in 6 cycles up to 13
then 15 cycles up to 21
then 23 and counting cycles starting at 22 in groups of 4.
* integer math rounded down - put table in the forum post.

Tested at 600 and 300 MHz and looked the same - of course that is twice as long :)
@Defragster
Copy link
Contributor Author

It would need tweaking to work on T_3.x's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant