diff --git a/README.rst b/README.rst index 284f48e..a256667 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,19 @@ 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 ============ 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):