Page 1 of 1

3-wire Serial

Posted: 13 February 2014, 15:56 PM
by sturgessb
Hey guys

Im going to be interfacing with this https://www.sparkfun.com/datasheets/IC/nRF2401A.pdf

And just wondering if there is 3 wire support, or do I need to bit bang it in software?

And if there are any examples of this i would greatly appreciate it.

Cheers

Ben

Re: 3-wire Serial

Posted: 13 February 2014, 17:13 PM
by dkinzer
sturgessb wrote:And just wondering if there is 3 wire support, or do I need to bit bang it in software?
As far as I can tell, the "three-wire interface" used by this device isn't compatible with ZBasic SPI routines which are best described a "four-wire interface".

I believe that you could use ShiftInEx() and ShiftOutEx() as building blocks to implement communication with the device.

The Arduino code for the nRF2401 may be useful, either directly or as a guide.
http://playground.arduino.cc/Interfacin ... re/Nrf2401

Posted: 14 February 2014, 5:04 AM
by sturgessb
Thanks, although porting that code over is a bit above my head, I'm rusty with this stuff now :(

I'm just trying to build a simple proximity sensor, I might see if I can do this with xbee's with the power knocked right down as they are easy to work with, I ideally want around 4ft of detection range.

Ben

Posted: 14 February 2014, 10:52 AM
by stevech
Inverse Square Law in RF propagation....
Double the distance to halve the (received) power.

That makes signal strength based ranging hard, with line of sight.

Posted: 14 February 2014, 16:58 PM
by GTBecker
How do you propose to use this module as a proximity detector, Ben? What do you want to detect? A passive object, like a person, or another module?

Posted: 15 February 2014, 6:32 AM
by sturgessb
So yes Tom I'm thinking another active module (transmitting). I just want to know if the transmitting object has come roughly within 4ft of the detector. I was thinking of having each detectable node just continuously (every few seconds) transmitting an ID to the detector. If the detector receives that ID then we know the transmitting object is 'in range'. I don't need to know ranging info or anything like that, just a a 1 or a 0, if it close or not.

Cheers

Posted: 15 February 2014, 8:28 AM
by GTBecker
You could probably make that work, yes, with a very poor, or no, antenna.

At four feet these things can probably communicate with no proper antenna (you might even need to shield them) - but the receiver might also be susceptible to desensing by other 2.4GHz devices like 802.11, Bluetooth, microwave ovens, making the detection distance unreliable. I don't see an RSSI output or data on a quick scan of the datasheet, so valid - or no - data might be the only method, as you suggest.

Worth a try, I'd say.

Posted: 16 February 2014, 5:03 AM
by sturgessb
Ill give it a go, although the xbees are physically bigger that I really want so I think ill just need to try and get that 3wire interface to the nRF2401 working.