18F4550 and nrf24L01

Discussion about wireless devices

18F4550 and nrf24L01

Postby cdosrun » Mon Jan 12, 2009 3:49 pm

I think I have sucessfully ported the code to the 18F4550 One last problem remains Im using Pin 26 for SDO but it is also the RX pin connected to the max 232 how would i be able to use the same pin for 2 separate functions? Also is there any way to drastically reduce the range of the NRF24L01 to about 7 feet or so???
cdosrun
 
Posts: 41
Joined: Sat Sep 13, 2008 8:59 pm

Re: 18F4550 and nrf24L01

Postby brennen » Tue Jan 13, 2009 12:44 am

If you put a resistor (around 1k ohm) between the MAX232 and your SDO pin, you should be OK. Make sure that the wire that goes to the 24L01 goes *directly* to your SDO pin, and *not* to the MAX232-side of the resistor.

Code: Select all
SDO->----------/\/\/\----<-MAX232
          |     ~1k
          |
          |
        MOSI


You can reduce the range of the 24L01 by reducing the RF_PWR field of the RF_SETUP register ('00' will give the lowest, at -18 dBm...see p. 54 of the datasheet). You can also remove your antenna, change it out for a lower gain antenna, put a conductor with GND on it in the field of the antenna, etc. Get creative. 8-)
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: 18F4550 and nrf24L01

Postby cdosrun » Tue Jan 13, 2009 1:58 am

So if I just remove the antenna and (take a soldering gun and quickly remove it from the chip) maybe play with some of the other settings I should still have a short range?
cdosrun
 
Posts: 41
Joined: Sat Sep 13, 2008 8:59 pm

Re: 18F4550 and nrf24L01

Postby brennen » Tue Jan 13, 2009 3:03 am

I would play with the settings first. If that's still not enough, then you could take off the antenna. However, make sure you can put the antenna back on, because you might find that your range without it is 0.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: 18F4550 and nrf24L01

Postby cdosrun » Tue Jan 13, 2009 3:41 pm

One Last question If i Have one transciever connected to the PC and multiple nrf's (10-20) communicating with it at random intervals(difference could be a matter of minutes) Is there anything I need to do make sure they don't interfear with each other? I thought about some code that maybe checks to see if the reciever is communicating with one of the nrf's and if so tells another nrf to wait a couple minutes before trying to send but im not sure.

Thanks for the Help Glad to see you have a store going!
cdosrun
 
Posts: 41
Joined: Sat Sep 13, 2008 8:59 pm

Re: 18F4550 and nrf24L01

Postby brennen » Tue Jan 13, 2009 6:57 pm

If each node can have some knowledge of current time (whether it's through a beacon, RTC, etc.), you could simply use a round robin scheme to give each unit a time slot out of a given amount of total transmitting time (essentially TDMA. If all of the units have the same RX address, then they will all know when a message is being sent from any node. Also, there is a CD bit that will go high if the chip detects RF energy in its RF channel, so you could also use that. There are entire text books based on the question you just asked, so you might want to skim through some of the basic communications formats to get an idea of what they do (see this link). No problem on the help!
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: 18F4550 and nrf24L01

Postby cdosrun » Tue Jan 13, 2009 10:54 pm

I like the time Slot idea this would ensure that no 2 nrfs run into each other. How would I mak the PIC "aware of time" ? Any good clock tutorials?
cdosrun
 
Posts: 41
Joined: Sat Sep 13, 2008 8:59 pm

Re: 18F4550 and nrf24L01

Postby brennen » Wed Jan 14, 2009 12:46 pm

The easiest way would be to strap an RTC, or real-time clock, up to each PIC. Sparkfun sells one that has an I2C interface. They also have example code listed on the site. You could have one clock that would be a master and would broadcast its time to the other nodes so that they were all at least reasonably synchronized with respect to time.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm


Return to Wireless

Who is online

Users browsing this forum: No registered users and 1 guest

cron