-
Notifications
You must be signed in to change notification settings - Fork 2k
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
MSP430: periph_timer clock config wrong #8251
Comments
@roberthartung on my TelosB |
@PeterKietzmann Nevermind, it was 1 second, not two. But still, we're off the same factor! |
Whoops, yes. It helps if you can read... |
nono, it was wrong in the issue/my code. You didnt do any mistake :D I edited the issue sneaky beaky like ;) |
@roberthartung if the hardware is exactly the same, then the behaviour should be the same. AFAIK we don't support TmoteSky, so I guess there should be at least one difference. As you may know, xtimer timings rely strongly on the initialisation of the hardware timer, which must be multiple of 1MHz. Thus, for me it seems that the problem might be periph_timer related. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
@roberthartung does the issue still exist? I'll set the "don't stale" label so it's not automatically being closed |
@PeterKietzmann Good question. Have to test again! |
@MichelRottleuthner Tested again with a simple xtimer_sleep(n), n \in {1,2,4}:
The configuration still seems off:
Tested on a MAXFOR MTM-CM5000MSP. |
I think this is not related to xtimer itself. Changing this in ---TIMER_BASE->CTL = (TIMER_CTL_TASSEL_SMCLK | TIMER_CTL_ID_DIV8);
+++TIMER_BASE->CTL = (TIMER_CTL_TASSEL_SMCLK | TIMER_CTL_ID_DIV2); gives me something at least close to the expected speed. Note: changing only the above line was just meant as a quick test and will probably break configuration of other peripherals driven by SMCLK (if not already broken as is). @maribu aren't you also using MSP430s? What do you think about this? |
Not really. I worked once on some code cleanup, but I even can remember what exactly I did. But I can recommend Inrias IoT-Lab for testing, if you (like me) have no MSP430 boards to test your changes on.
I have no idea about the hardware, but if I guess correctly currently an internal clock source (DSO) is used and you suggest to use an external crystal for higher precision. This sounds like a good idea, but maybe external crystals are not available on all boards. But in any case, I don't really have the expertise in the MSP430 area to be of much help. |
Ok, thanks for the quick response.
Yep, that's pretty much what I wanted to say. I'm also no active user of the MSPs but from the datasheet it looks rather straight forward. @roberthartung do you want to put some effort into fixing this? I'd be happy to assist. |
I don't think there is an external crystal available on these boards. |
Yep it seems like there is indeed no HF crystal available. But for the Tmote Sky it looks like it has at least some LF crystal X0. |
I just rediscovered this issue. #20582 fixes it |
The TelosB node and Tmote Sky node should be identical (hardware wise). However, using
xtimer_sleep(2)
is not sleeping two seconds, but more like 7 seconds. Will investigate.The text was updated successfully, but these errors were encountered: