RFM12B & RFM69CW #533
Replies: 18 comments
-
Posted at 2014-06-19 by @gfwilliams Personally I haven't, but I'd be very interested if someone did produce a module for them. It doesn't look hard. I'm not sure what they add over the NRF modules though? Ideally we'd come up with some kind of shared 'low power radio' module that would use either that or the NRF, and would handle syncing transmitters/receivers so that you didn't have to have the receiver on all the time (which draws 11mA). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-19 by StuntMonkeh They operate at a lower radio frequency and you can get quite a bit more distance on them. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-19 by @gfwilliams Ahh, good point. Yes - that'd make a big difference... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-19 by StuntMonkeh I had a look but if I'm honest I don't know where to start. Once its connected is there any way I can just test by reading some information on it? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-20 by @gfwilliams Which one are you trying, the RFM12B? The info you need will be in the datasheet and the arduino library You can follow the steps that the library uses to initialise: https://github.com/LowPowerLab/RFM12B/blob/master/RFM12B.cpp#L114 Looks like the XFER function's equivalent in Espruino is just:
so you can start off with:
So if the function finishes then at least you've had some success in talking to the chip and getting it to lower the IRQ line. That last bit is nasty though, and if it works I'd consider re-writing it as:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-20 by StuntMonkeh Progress...
Okay so good progress. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-20 by @gfwilliams great! I guess it's just a matter of hacking through and implementing the rest of the initialisation code. I just realised I got the polarity wrong in my last bit of code :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-22 by StuntMonkeh I knew it was too good to be true! On further investigation it appears as soon as I send the first command, in this case when Anyone got any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-24 by StuntMonkeh Can I just check that these connections are correct. Espruino --> RFM12B |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-24 by TrapperBob It could be the MISO and MOSI are reversed? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-24 by StuntMonkeh That's weird. So I started again from scratch, hence the pulling all the wires out and making sure I had got the physical connections correct. @TrapperBob, I tried swapping the MISO and MOSI but that is definitely not it. Definitely worth a try though! I setup a setWatch on the IRQ pin to log to the console when the state changes (rising and falling). Looking at the Arduino libraries for the RFM12B, I think quite a bit of the code is related to some sort of software SPI. We don't have to worry about this on the Espruino :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-24 by @gfwilliams @StuntMonkeh it seems like good news if the IRQ line is moving. Yes, IIRC quite a lot of the top part of the RFM12B file is for bit-bashed SPI - which isn't needed :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-24 by StuntMonkeh WHAT THE HELL!!!! Its stopped working, I unplugged the board for some reason and then had to plug back in and reload the code and now it doesn't work. This is what I have. I was simply running
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-25 by @gfwilliams Did you have some code in there that had been save()d already? That could be causing you problems I guess ... Maybe there is some other pin (a reset pin?) that needs its state changing first... Also aren't you supposed to wait for it to initialise at some point? You don't appear to be doing that... The code is looking good though. It'd make a module really easily. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-25 by StuntMonkeh I figured I must have sent the RFM12B module some commands that must have caused it to jump into life. I have tried sending just the first two commands and then manually sending the rest. No luck. I have had a look at different uses in other projects, all wired the same way. No reset pin. I had another go tonight, starting from scratch rewiring all over again but I'm back square one with the IRQ line just being triggered high as soon as I send I tried just sending the first two commands
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-25 by DrAzzy I'm looking at the datasheet, and it looks like the nIRQ pin is active low. Furthermore, in the case of a power-on reset, it sounds like the nIRQ should be reset by simply reading the status: • POR: both the nIRQ pin and status bit can be cleared by the read status command As I interpret that, you're getting correct behavior, so far. nIRQ starts out getting pulled low, then you read the status, which clears the interrupt, and IRQ goes high again. It wasn't clear to me that a RFM12B that's just sitting there will generate IRQ activity - especially when all the radio-related functionality was just turned off (with 0x8205) Why aren't you recording what the RFM12B is sending back? You should certainly be getting data back when you send 0x0000. I think looking for this would be a better way of seeing whether you're communicating with the device.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-26 by StuntMonkeh @drazzy - Added the console.log part as suggested.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-01 by StuntMonkeh I invested in a cheapo Saleae clone logic analyser so I can see what's going. It was my understanding that was lacking, its starting to make a little more sense now :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-06-19 by StuntMonkeh
Has anyone done anything with these on the Espruino platform?
They are used extensively in other projects it would be handy to have a module for them.
Beta Was this translation helpful? Give feedback.
All reactions