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
cpu/sam3: added RTT driver #7583
Conversation
32d70cd
to
3366b0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 minor comments. I'll see if I can test this week.
cpu/sam3/cpu.c
Outdated
/* enable external oscillator */ | ||
SUPC->SUPC_CR = (SUPC_CR_KEY(SUPCKEY) | SUPC_CR_XTALSEL); | ||
while (!(SUPC->SUPC_OSCSEL & SUPC_SR_OSCSEL)) {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extra line can be removed I think
cpu/sam3/periph/rtt.c
Outdated
#include "cpu.h" | ||
#include "periph/rtt.h" | ||
|
||
#define ENABLE_DEBUG (1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug should be disabled
@haukepetersen, I gave a try to this one with 2017-09-13 13:43:40,729 - INFO # Initializing the RTT driver |
@haukepetersen, any chance that you addressed the comments here before feature freeze ? |
Will try. Tried to debug the behavior further last week, but so far I am completely in the blank why the RTT is to imprecise on the arduino-due. Will take more debugging... |
cpu/sam3/periph/rtt.c
Outdated
#include "debug.h" | ||
|
||
/* guard file to prevent file being build if no RTT was configured */ | ||
#if RTT_NUMOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, its not. Will remove once I find time to actually get this driver working correctly...
looks like this still needs some work and testing, postpone to 2018.04. |
@haukepetersen ping |
I am aware of this PR, though its not very high up my prio list... |
3366b0d
to
bf961ec
Compare
Finally found a minute: this PR should be all good now:
BUT note: per default, the slow clock driving the RTT is clocked by an internal It turns out (at least my google search), that many arduino-due boards do not have the external 32khz oscillator equipped, which would be needed for better timings. So I left the default configuaration to use the internal RC-oscillator. Simply compile with |
got hold of a due board with the external oscillator equipped:
Now the output of the
|
* @name RTT configuration | ||
* @{ | ||
*/ | ||
#define RTT_FREQUENCY (1U) /* 1Hz */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you default this to 1024 or 32768?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scratch that, need to solve this globally.
Tested using |
nope, not that I know of. |
should I squash? |
4113a59
to
8f8eb86
Compare
squashed. |
@fjmolinas can you test this PR ? There should be an arduino-due on my desk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on arduino-due. ACK.
Found and finished this code in one of my branches...