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

Possible to change the SPI bus speed on RPi before creation of RF24 object #15

Closed
dsilva-vd opened this issue Sep 24, 2020 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@dsilva-vd
Copy link

dsilva-vd commented Sep 24, 2020

@2bndy5 Our application uses the nRF24 module but because we have the module on the end of a long cable we had to change the SPI bus speed. The popular RF24 library (version 1.3.8) allows for the SPI bus speed to be set when creating the class i.e. RF24(CSN, CE, <SPI Bus speed>). Is there some way to do this with the module you wrote? Or does the CircuitPython's board module allow this to be done?

@2bndy5 2bndy5 added the enhancement New feature or request label Sep 24, 2020
@2bndy5
Copy link
Member

2bndy5 commented Sep 24, 2020

I actually already added this arg to the c'tor on my latest branch (forgot to document it though). The branch isn't released yet but you could try it out right now using
pip3 install git+https://github.com/2bndy5/CircuitPython_nRF24L01@lite-beta. Its a very stable branch, but PA/LNA modules are have trouble TXing (might be a hardware issue about higher power requirements)

@2bndy5
Copy link
Member

2bndy5 commented Sep 24, 2020

sorry kwarg to the c'tor is named spi_frequency

@2bndy5
Copy link
Member

2bndy5 commented Sep 24, 2020

its now documented

@2bndy5
Copy link
Member

2bndy5 commented Oct 2, 2020

I can confirm that the spi_frequency kwarg in the c'tor works. Apparently "long" wires mean anything longer than a couple inches. I ran into the same problem you described on my Feather M0 Express board when testing the rf24_lite.py module (designed specifically for that ATSAMD21 CPU). Using the default SPI speed (10 MHz), I would get weird data returned from SPI transactions (some write operations wouldn't take either), but lowering it to 2.5 MHz solved it. @dsilva-vd thank you for this insight!

@2bndy5
Copy link
Member

2bndy5 commented Oct 6, 2020

@dsilva-vd I'm closing this issue because I just released v1.2.0 to pypi.org which includes the requested constructor argument. If have any other questions or suggestions I'm eager to discuss them in another issue. Thank you again for your input.

@2bndy5 2bndy5 closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants