Skip to content

Commit

Permalink
Merge pull request #2 from jerryneedell/jerryn_reset
Browse files Browse the repository at this point in the history
 set RESET to Pull.UP when set to input
  • Loading branch information
dhalbert committed May 3, 2018
2 parents cc7cbd6 + 78407f9 commit 902ac23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
============
Expand Down
6 changes: 3 additions & 3 deletions adafruit_rfm9x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 902ac23

Please sign in to comment.