Skip to content

K20 general and timer adjustments #264

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

Merged
merged 5 commits into from
Apr 22, 2014
Merged

K20 general and timer adjustments #264

merged 5 commits into from
Apr 22, 2014

Conversation

Sissors
Copy link
Contributor

@Sissors Sissors commented Apr 18, 2014

Some bugs squished and interrupt code added to be compatible with current mbed api.

The K20 cannot chain its PIT timers, so no option to get 1us tick rate for them. Solution for the 'timer' timer was to create an interrupt every 1us and use a software timer. Now it uses almost the complete 32-bit range of the timer, and only does the last few bits in software. Downside: Software and hardware timer need to stay synced. Upside, don't need an interrupt every 1us, timer not working in irq context, etc.

Also the 'ticker' timer is moved to a PIT channel. 32-bit with no prescaler is better than 16-bit with prescaler. Especially since the K20 is a core-M4, and has no problems with integer multiplications and divisions (contrary to M0s).

Sissors added 5 commits April 16, 2014 08:12
Added the required gpio-irq enable/disable + fixed bus_frequency
Timer/Wait timer
The timer which creates interrupts is now also done using one of the PIT
channels. Since also here no chaining is possible we still need to do
some bits in software, but 32-bit without prescaling is still better
than 16-bit with.

Also some code was moved around and naming conventions changes, since no
lptmr is used anymore, and calling both pit-timer would get confusing
Pretty much copy pasta of KLxx sleep code with only tiny change
@Sissors
Copy link
Contributor Author

Sissors commented Apr 19, 2014

And added sleep code also. For whoever is interested, all with default setup, so if you actually want to use regular sleep you should start disabling peripherals first:
Running current: 16.5mA
Sleep current: 9.5mA
Deepsleep current: 3.5uA :)

bogdanm added a commit that referenced this pull request Apr 22, 2014
K20 general and timer adjustments
@bogdanm bogdanm merged commit 8215203 into ARMmbed:master Apr 22, 2014
bridadan pushed a commit that referenced this pull request Jun 21, 2016
initial issue and PR github templates
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.

2 participants