From d67613b58f11686794899ce64293b658fa15547f Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 2 May 2018 18:15:00 -0400 Subject: [PATCH 1/4] set RESET to Pull.UP when set to input --- adafruit_rfm9x.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_rfm9x.py b/adafruit_rfm9x.py index d5afcef..72d5d93 100644 --- a/adafruit_rfm9x.py +++ b/adafruit_rfm9x.py @@ -30,7 +30,7 @@ * Author(s): Tony DiCola """ import time - +import digitalio from micropython import const import adafruit_bus_device.spi_device as spi_device @@ -344,7 +344,7 @@ def __init__(self, spi, cs, reset, frequency, *, preamble_length=8, # trigger a reset. Note that reset MUST be done like this and set as # a high impedence input or else the chip cannot change modes (trust me!). self._reset = reset - self._reset.switch_to_input() + self._reset.switch_to_input(pull=digitalio.Pull.UP) self.reset() # No device type check! Catch an error from the very first request and # throw a nicer message to indicate possible wiring problems. @@ -421,7 +421,7 @@ def reset(self): # See section 7.2.2 of the datasheet for reset description. self._reset.switch_to_output(value=False) time.sleep(0.0001) # 100 us - self._reset.switch_to_input() + self._reset.switch_to_input(pull=digitalio.Pull.UP) time.sleep(0.005) # 5 ms def idle(self): From 9634161e32a25065b5a4db9a293259907b638447 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 2 May 2018 21:29:11 -0400 Subject: [PATCH 2/4] update README.rst --- README.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.rst b/README.rst index 284f48e..e17808f 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,16 @@ Usage Example ============= See examples/simpletest.py for a demo of the usage. +Note: the default baudrate for the SPI is 10000000 (10MHz). This works well when you are using a board with +the radio module built in (FeatherM0 RFM9x) or with an RFM9x FeatherWing mounted directly to a feather board. +For breakout boards or other configurations where the boards are separated, it may be necessary to reduce +the baudrate for reliable data transmission. +The baud rate may be specified as an keyword parameter when initializing the board. +To set it to 1000000 use : +.. code-block:: python# Initialze RFM radio + rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ,baudrate=1000000) + + Contributing ============ From 32e69780bf7ecd08c2264e418daab24bbfd956f0 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Wed, 2 May 2018 21:32:21 -0400 Subject: [PATCH 3/4] update README.rst --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e17808f..7098312 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,8 @@ For breakout boards or other configurations where the boards are separated, it m the baudrate for reliable data transmission. The baud rate may be specified as an keyword parameter when initializing the board. To set it to 1000000 use : -.. code-block:: python# Initialze RFM radio +.. code-block:: python + # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ,baudrate=1000000) From 78407f98e11f3e3093bc07a7b73e0ae358351602 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Wed, 2 May 2018 21:35:47 -0400 Subject: [PATCH 4/4] Update README.rst --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 7098312..a256667 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,9 @@ For breakout boards or other configurations where the boards are separated, it m the baudrate for reliable data transmission. The baud rate may be specified as an keyword parameter when initializing the board. To set it to 1000000 use : + .. code-block:: python + # Initialze RFM radio rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ,baudrate=1000000)