I'm trying to get a Teensy2 I got from here a while back working with an RFM12B kit from JeeLabs and using their RFM12 Arduino library. The library comes with a demo sketch(RF12Demo) that I've compiled and uploaded to the Teensy, as well as to a second Arduino Uno board and another RFM12B kit. I wired up the Uno as per the instructions here, and the sketch runs, outputs configuration and help text to the serial monitor, and takes commands to control the RFM12B module. The module uses an SPI interface so I hooked it up to the Teensy like so. When I run the sketch, the initial library configuration is printed to the serial monitor just like on the Uno, but the help text does not show up and the Teensy locks up in an infinite loop. I traced it down via successive serial prints in the RF12 library to where it is trying to establish SPI communication with the RFM12B module. It appears to be waiting for a reply from the radio module which never comes. To make sure I didn't have a bad radio module, I switched the modules in the Teensy and the Uno and the same problem occurred. The one in the Uno always works and the one in the Teensy always hangs. I'm new to SPI communication so I'm not sure where to start troubleshooting this. I'm fairly certain I've made the right connections for the module to use the Teensy2's hardware SPI:
Does anyone have an idea of where I'm going wrong here?
Radio Module | –> | Teensy |
SPI clock (SCK) | –> | Pin 2 (PB1 - SCLK) |
SPI data out (SDO) | –> | Pin 4 (PB3 - MISO) |
SPI data in (SDI) | –> | Pin 3 - (PB2 - MOSI) |
SPI select (SEL) | –> | Pin 1 - (PB0 - SS) |
IRQ | –> | Pin 6 (PD0 - INT0) |
Does anyone have an idea of where I'm going wrong here?