Skip to content

set RESET to Pull.UP when set to input #2

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

Merged
merged 4 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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