Wireless not working with SPI device

Started by BIA, June 09, 2014, 02:34:52 PM

BIA

Wireless is not working with this SPI device: http://www.st.com/web/catalog/sense_power/FM142/CL851/SC1794/SS1498/LN1723/PF248592. The code is hanging on line 219 of RFM69.cpp: while ((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00); // Wait for ModeReady.

It appears the wireless can receive but not transmit.

Felix

Can you provide more details?

How do you have it wired to the Moteino?
You may need pullup/pulldowns on the SDO/SDI lines if that chip is noisy or introduces junk data on the SPI lines when other SPI devices are talking. I've seen this happen before with another device, deemed it unworkable, until I pulled the logic analyzer and realized it was behaving unexpectedly.

You probably want this chip digital side very well isolated from the analog side otherwise you could be introducing massive amounts of noise and EMI in the Moteino circuit since it's a motor driver.

BIA

As I said previously, the Moteino can receive fine, it just can't transmit. Seems that if it were a noise issue it wouldn't be able to send or receive.

It is wired as follows: SDI -> 11, SDO -> 12, CLK -> 13, SS -> 14. Were you able to pull up the pins with software (writing HIGH to 11 & 12) or did you have to do it externally?

Felix

Pin 11 in an OUTPUT, pin 12 is an INPUT, in SPI mode. So writing a 1 to an INPUT will activate the pullup. But writing a 1 to an OUTPUT will set that pin to HIGH.
You are better off using external pull[up/down]s. I would recommend not messing with the SPI pins after you call SPI.initialize().
Also make sure to pull your SS pin for the motor driver, I assume active low so pull it up with a 10K.