-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Move SPI freq to config.h #27
Move SPI freq to config.h #27
Conversation
Shall I instead move the setting into config.h? |
Hi, I discoverded that the Uno r3 is not able to reach such high speeds in #9 too, and I have no opinion about the default frequency, but moving it to config.h is definitely a good idea ! |
RFM95 datasheet says SPI frequency MAX is 10MHz, so it should be okay every time, but playing with limits is not always a good advice, to be sure I would set it to 8MHz by default. |
Thanks, @hallard. It's not necessarily a limit of the RFM95 I'm concerned about. I think we want to pick a number that increases the chance that someone using the library will have success when they first use it. That's why I would choose 1MHz - it's more likely to work with other SPI peripherals on the same bus and with older Arduino boards. People who need to optimize communication (8MHz vs 1MHz) will look for the controls and change them. For them, it's good to bring the value into config.h to make it clear that it is a configurable parameter of the system. In short, we should prefer requiring someone who cares about speed to push the number up rather than requiring someone who's just trying to get a board working to spend time debugging a clock speed that is too high. |
good point @frankleonrose ;-) by the way I never saw SPI device limited to 1MHz, le lowest I saw was 4MHz, for 1Mhz provider may need to get back to I2C ;-) BTW, I'm not sure on the field that users will know it's "just" working at 1Mhz and it's possible to increase speed in code. May be the solution would be to bring a method and call this method into example (or comment it to be sure) so users will see directly and if not called it will works by default at 1MHz
|
I know @matthijskooijman is leery of adding to the LMIC API, so I'm not going to over-implement this one minor setting. I think having it in the config.h with annotation is sufficient. |
I think this would actually be useful, since it allows setting the speed in the example sketches and exposes this possibility to users. I'm not worried about adding extra API for this, since this API would be very much Arduino-specific, and it would not affect the core of LMIC in any way. Having an API called If either of you would care to implement this, I'd be happy to merge that change (note that I'm a bit busy atm, but I'm certainly planning to merge the PR's that have been submitted within the next few weeks).
I'm mostly hesitant to divert too much from "upstream" LMIC as released by IBM. However, I've since learned that IBM will no longer work on LMIC, and there is some talk of moving upstream (e.g. non-Arduino specific) maintainance of LMIC into the community, which should open up options of more invasive changes to the code. |
@matthijskooijman anyway, thanks for this great job |
Soon™, but probably somewhere in the next two weeks. |
IBM is intending to change the license on the LMIC library to the three-clause BSD license. To simplify incorporating your contribution upstream on the next LMIC release, would you be willing to license it under the same license? If so, please explicitly state this in a comment to this PR? Saying something like "This contribution is licensed under the terms of the three-clause BSD license, as linked above" should be sufficient. |
This contribution is licensed under the terms of the three-clause BSD license, as linked above. |
This contribution is licensed under the terms of the three-clause BSD license, as linked above |
This repository is now deprecated, see #297 for some more background. I'm grateful for your contribution, but it will no longer be merged. I'm recommending people to use the MCCI version of LMIC instead. If this PR addresses an issue that also exists in that version, I would encourage you to resubmit your contribution there, so it might benefit other users. I'm sorry for the inconvenience... |
10MHz as a default is too high, IMO. Better to start with a lower frequency that will work with more Arduino boards and SPI peripherals that might be on same SPI circuit.