Skip to content

Commit 902ac23

Browse files
authored
Merge pull request #2 from jerryneedell/jerryn_reset
set RESET to Pull.UP when set to input
2 parents cc7cbd6 + 78407f9 commit 902ac23

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.rst

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ Usage Example
3030
=============
3131

3232
See examples/simpletest.py for a demo of the usage.
33+
Note: the default baudrate for the SPI is 10000000 (10MHz). This works well when you are using a board with
34+
the radio module built in (FeatherM0 RFM9x) or with an RFM9x FeatherWing mounted directly to a feather board.
35+
For breakout boards or other configurations where the boards are separated, it may be necessary to reduce
36+
the baudrate for reliable data transmission.
37+
The baud rate may be specified as an keyword parameter when initializing the board.
38+
To set it to 1000000 use :
39+
40+
.. code-block:: python
41+
42+
# Initialze RFM radio
43+
rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ,baudrate=1000000)
44+
45+
3346
3447
Contributing
3548
============

adafruit_rfm9x.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Author(s): Tony DiCola
3131
"""
3232
import time
33-
33+
import digitalio
3434
from micropython import const
3535

3636
import adafruit_bus_device.spi_device as spi_device
@@ -344,7 +344,7 @@ def __init__(self, spi, cs, reset, frequency, *, preamble_length=8,
344344
# trigger a reset. Note that reset MUST be done like this and set as
345345
# a high impedence input or else the chip cannot change modes (trust me!).
346346
self._reset = reset
347-
self._reset.switch_to_input()
347+
self._reset.switch_to_input(pull=digitalio.Pull.UP)
348348
self.reset()
349349
# No device type check! Catch an error from the very first request and
350350
# throw a nicer message to indicate possible wiring problems.
@@ -421,7 +421,7 @@ def reset(self):
421421
# See section 7.2.2 of the datasheet for reset description.
422422
self._reset.switch_to_output(value=False)
423423
time.sleep(0.0001) # 100 us
424-
self._reset.switch_to_input()
424+
self._reset.switch_to_input(pull=digitalio.Pull.UP)
425425
time.sleep(0.005) # 5 ms
426426

427427
def idle(self):

0 commit comments

Comments
 (0)