Adrien van den Bossche
New member
RF22 library (http://www.airspayce.com/mikem/arduino/RF22/) is working properly with Teensy 3.0 and 3.1.
The pinout is:
With this pinout, the construtor is RF22(10,0).
The RF22 library is nearly working out of the box, meanwhile the following must be added in RF22.cpp in the RF22::init()
Note that the last lines released the pin 13 for the LED and other purpose.
Paul, do you plan to wrap-up this library with Teensyduino? We are wilingful to help you to support this library port since we got 30 nodes testbed based on T3.x+RFM22b.
Regards
The pinout is:
Code:
RFM22b <-> T3 (#pin)
SCK <---> SCK (14)
SDO <---> DIN (12)
SDI <---> DOUT (11)
NSEL <---> CS (10)
NIRQ <---> GPIO0 (0)
With this pinout, the construtor is RF22(10,0).
The RF22 library is nearly working out of the box, meanwhile the following must be added in RF22.cpp in the RF22::init()
Code:
// Initialise the slave select pin
pinMode(_slaveSelectPin, OUTPUT);
digitalWrite(_slaveSelectPin, HIGH);
// Add by Adrien van den Bossche <vandenbo@univ-tlse2.fr>
#if defined (__MK20DX128__) || defined (__MK20DX256__)
pinMode(_interrupt, INPUT);
#endif
// start the SPI library:
// Note the RF22 wants mode 0, MSB first and default to 1 Mbps
_spi->begin();
_spi->setDataMode(SPI_MODE0);
_spi->setBitOrder(MSBFIRST);
_spi->setClockDivider(SPI_CLOCK_DIV16); // (16 Mhz / 16) = 1 MHz
// Add by Adrien van den Bossche <vandenbo@univ-tlse2.fr>
#if defined (__MK20DX128__) || defined (__MK20DX256__)
// First reassign pin 13 to Alt1 so that it is not SCK but the LED still works
CORE_PIN13_CONFIG = PORT_PCR_MUX(1);
// and then reassign pin 14 to SCK
CORE_PIN14_CONFIG = PORT_PCR_DSE | PORT_PCR_MUX(2);
#endif
Note that the last lines released the pin 13 for the LED and other purpose.
Paul, do you plan to wrap-up this library with Teensyduino? We are wilingful to help you to support this library port since we got 30 nodes testbed based on T3.x+RFM22b.
Regards
Last edited: