-
Notifications
You must be signed in to change notification settings - Fork 49
Pull up required for reset pin? #46
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
Comments
In the arduino code -- it is just toggled https://github.com/adafruit/RadioHead/blob/master/examples/feather/Feather9x_TX/Feather9x_TX.ino#L90 Tony DiCola did the intial CP lib and did it that way -- I recall some discussion like "don't mess with it" ;-) edited to add -- but looking at "blame" in the CP library -- it looks like I added the PULLUP. I think you can just toggle it as an output. |
@caternuson Do you want me to test it an put in a PR if it works? |
@caternuson reread you first post -- originally it was just setting it to input -- but for some reason, I added the PULLUPs.. I don't recall if there was a problem, but it seem like it does have to go high. SO why not leave it as an output and just toggle it? I think that is what Arduino does if I am reading it correctly. |
@jerryneedell I can test. I've swapped back to an Itsy to run some other tests. So can test with and without. |
OK -- but I don't trust just switching to input unless we have reason to believe that guarantees a PULLUP -- I'd feel safer just toggling it as an output. |
I suppose after the RESET is complete we could switch it back to input if that is preferred |
something like
and this line has to be changed as well |
@caternuson FYI #2 |
Hmm. OK. So it seems like at some point it was needed. Could it be chip and/or CP version dependent? I just ran this test and things seemed to work. I simply changed these two lines: self._reset.switch_to_input(pull=digitalio.Pull.UP) to this: self._reset.switch_to_input() so essentially undid that PR. I've got another RFM9x setup on a Pi and had it send Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> import digitalio
>>> import adafruit_rfm9x
>>> cs = digitalio.DigitalInOut(board.D7)
>>> reset = digitalio.DigitalInOut(board.D9)
>>> rfm9x = adafruit_rfm9x.RFM9x(board.SPI(), cs, reset, 915.0)
>>> rfm9x.operation_mode
1
>>> packet = rfm9x.receive(timeout=5.0)
>>> packet
bytearray(b'hello world')
>>> |
hmm -- makes me nervous -- I can play with it tomorrow and test it as an output -- unless you want to try that. |
I'd appreciate your second look at this. But this is low priority. I will also continue to test things FWIW. |
@caternuson This is also how it is done in the Arduino RadioHead library. I also tried setting it back to input after the reset and that also seems o be OK.
here are the diffs to the repo
|
FWIW - TinyLoRa performs a similar 100us toggle on the RST: |
@caternuson this seem to be working well for me -- I've tried it on a feather_m0_rfm9x, an stm32f405 with rfm9x feather wing and a Raspberry Pi 4 with Lora Bonnet. Would you like me to submit a PR? |
Thanks for all the testing. It seems to be working for me too. I'm still trying to test with FT232H with Blinka on Linux PC but running in to some other issues. I'm a little concerned about all the code comment warnings. I don't want to undo some old black magic. This seemed to fix a previous issue (the PR you link above). Any idea what was happening there? |
I just vaguely recall that it broke when we moved from 2.0 to 3.0 and that seemed to fix it.... If you want a reliable way without internal Pull-ups, I am more comfortable with this method then just removing the pull-up settings. I'll be happy to defer to anyone with a good justification for going back to the old way that failed for 3.0 but seems to work now. The only issue I see with setting the output to High is the note that the RESET pin should be floating at POR but I don't know of any case where we would be doing that since it should be connected at power on. |
It's also a little odd that the datasheet explicitly labels the diagram above with "High-Z" and seems to indicate the high/low state doesn't matter. Why not just show a basic HIGH - LOW - HIGH pattern? Maybe the info helps when designing a hardware reset, like with a button? I fell down a rabbit hole testing with FT232H. Found this at the bottom: |
No problem -- I'm still puzzled by the data-sheet -- Not clear to me which side the diagram is talking about. the RFM9x side or the MCU side.... |
@jerryneedell OK, issues with FT232H resolved and I'm now testing with the change-reset-to-digital-out update. It seems to work fine. For TX, I'm using a RPi with LoRa bonnet: (blinka) pi@raspberrypi:~/lora $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import digitalio
>>> import adafruit_rfm9x
>>> CS = digitalio.DigitalInOut(board.CE1)
>>> RESET = digitalio.DigitalInOut(board.D25)
>>> rfm9x = adafruit_rfm9x.RFM9x(board.SPI(), CS, RESET, 915.0)
>>> rfm9x.send(b'hello world')
True
>>> And for RX, using a LoRa breakout with an FT232H connected to a linux box. (blinka) linux:~/lora$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import digitalio
>>> import adafruit_rfm9x
>>> cs = digitalio.DigitalInOut(board.C0)
>>> reset = digitalio.DigitalInOut(board.C1)
>>> rfm9x = adafruit_rfm9x.RFM9x(board.SPI(), cs, reset, 915.0)
>>> rfm9x.receive(timeout=5)
bytearray(b'hello world')
>>> Since it seems to work and the same approach is being taken by other libraries, I guess this change is OK. And if this turns out to be wrong, then we have all this discussion to document things, and can simply revert. Do you want to make a PR? |
Sure . All set to submit. |
resolved by #47 |
Is enabling internal pull up required for the reset pin? Or is simply setting to input adequate? Use case is for a board that lacks internal pull ups on inputs pins.

The text was updated successfully, but these errors were encountered: