nRF24LE1 + MCU

Discussion about wireless devices

Re: nRF24LE1 + MCU

Postby fintor » Mon Apr 02, 2012 10:59 am

Hi brennen,

Thanks for all the replies.

I just received the items(finally, the postal service never notified us of the arrival :))

I have connected the FT232R board to the nRF24LE1 board, and started the pc side bootloader, and is able to detect the device.

However, I would like to know how you compile the code for the nRF24LE1.

To get started with the RF test program that is provided, do I just download that, and the SDK, and then just run make?(I am running Linux, and have installed sdcc)

with regards,
fintor
fintor
 
Posts: 21
Joined: Thu Mar 01, 2012 9:08 am

Re: nRF24LE1 + MCU

Postby brennen » Mon Apr 02, 2012 12:11 pm

To compile the test program, you first need to install SDCC. After that, it will depend on the operating system you're using. For Windows, you'll need to download and install Cygwin with the full developer package. If you're running Mac OS or Linux, you don't need any additional programs.

After that, unzip both the test program and the SDK into the same parent folder. Then you can "cd" into the top-level directory of either of the RF test program folders (local or remote) and type "make -s all". The -s is for silent mode so make doesn't print all of the directories as it compiles. You can run the command without the -s switch if you prefer to see them. If you want to clean all of the build files, type "make -s clean" and then "make -s all".

If you are a user of Eclipse IDE, the SDK and both folders of the RF example already have Eclipse projects embedded inside them. Download Eclipse for C/C++ Developers (if you don't already have it), then in Eclipse, go to File->Import..., then highlight General->Existing Projects into Workspace and click "Next >", then click "Browse..." by "Select Root Directory", then click one of the three top-level directories (SDK, tutorial remote, tutorial local) and click "OK", then click "Finish". You'll want to repeat this so that you get all three projects added to your workspace. You will then be able to open the project in Eclipse, and you can use the Eclipse menus to build or clean the project (Build->Build All and Build-Clean.., respectively). I also recommend that you uncheck Build->Build Automatically.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Mon Apr 02, 2012 2:03 pm

Thanks for the good answer.

When I have compiled, I find the file to upload under the _/target_sdcc_nrf24le1/flash/ right? And I should upload the main.ihx file to the MCU right?

As I understand the test programs, I upload the "remote" to one of the nRF24LE1 and "local" to the other one, they then send back and forth the character read from the serial terminal?

Ohh yeah, and what is the approximate range of the device?
fintor
 
Posts: 21
Joined: Thu Mar 01, 2012 9:08 am

Re: nRF24LE1 + MCU

Postby brennen » Mon Apr 02, 2012 2:21 pm

The file to upload is _target_sdcc_nrf24le1_24/flash/main.hex. The main.ihx is generated by SDCC, but the .hex file is a bit more cleaned up. The PC bootloader app will only let you send .hex files anyway, so when you navigate to that folder, you'll only be able to see main.hex.

The "local" unit is intended to be connected to your computer over by a serial connection (the same one you would use to program it). The remote unit doesn't need to be connected to the serial connection while it's running, though. To execute the code, you can open the terminal in the PC bootloader app on your computer for the local unit. Then you can type some characters, and you should see them echo back in the window. If you see question marks, then the units aren't communicating.

For two chip antenna units, you get about 50% of your packets through at 60 meters. Range drops off from there.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Tue Apr 03, 2012 1:04 pm

Hi brennen,

I have my boards up and running now, which is great.

Eventually though, I am going to make my own pcb, and then I need to be able to upload programs to the nRF24LE1's. Upon searching for a programmer for them, I came across this thread at sparkfun http://forum.sparkfun.com/viewtopic.php?f=13&t=31913

And there you state that you have code that allows 1 nRF24LE1 to another one. Is it possible to acquire this code from you? And maybe some demonstration on how to use it and how to connect the 2 chips?

with regards,
fintor
fintor
 
Posts: 21
Joined: Thu Mar 01, 2012 9:08 am

Re: nRF24LE1 + MCU

Postby brennen » Tue Apr 03, 2012 10:41 pm

I have uploaded the code here. Unzip the file to the parent directory where your nRF24LE1 SDK is located if you want to build it (this shouldn't be necessary). Load the appropriate .hex file for your package from nrf24le1_based_programmer/_target_sdcc_nrf24le1_XX/flash/ to the programming master nRF24LE1 using the PC bootloader application.

The boards should be connected like this (valid for any variant as either master or slave):

Code: Select all
Master -> Slave
------    -----
GND    -> GND
P0.0   -> PROG
P0.1   -> FCSN
MMOSI  -> FMOSI
MMISO  -> FMISO
MSCK   -> FSCK


Open a terminal at 38400 baud for the master unit (and reset the chip if necessary). You should see a "PGM>" prompt. To erase the slave's program flash memory, type 'e' (no quotes). To program the slave's memory, type 'p' (no quotes), and you will see "Programming... Send hex file now...". Now, use your terminal program to send the .hex file that should be programmed into the slave's flash memory. You will see "Programming complete..." once the operation is done. If you want to verify the slave's flash, press 'v' (no quotes) and then follow the same procedure as in the program instruction. You can also dump the slave's flash memory with the 'd' (no quotes) command.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby rgp64 » Mon Apr 16, 2012 11:02 am

I have tried to use one of my NRF24LE01 to be able to program the other one asi you told me, Brennen, but I'm still not getting any response from it. When I type 'p' after typing 'e' to erase the flash memory, I'm not getting the "Programming... Send hex file now..." message. Can it be reprogrammed without erasing the flash memory?
rgp64
 
Posts: 6
Joined: Mon Mar 12, 2012 9:06 am

Re: nRF24LE1 + MCU

Postby brennen » Mon Apr 16, 2012 12:37 pm

Does it come back to the "PGM>" prompt after you execute the erase ('e') instruction? If not, it's not communicating to the other nRF24LE1 device. If it does come back to the prompt, then there must be some kind of wiring issue that is causing the programming nRF24LE1 to hang somewhere. I tested the code that I sent you from one nRF24LE1-24 to another and it worked fine, so I don't think there's a code bug. And, to answer your question, you do have to do an erase before you do a program, because programming can only change bits from 1 to 0, not 0 to 1 (erasing does the latter part).
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby rgp64 » Tue Apr 17, 2012 8:11 am

No, it doesn't come back to the "PGM>" prompt. That's what I thought, that if I didn't get anything new when pressing 'e', there would be no communication. Do you think it is time to give it a good funeral? xD
rgp64
 
Posts: 6
Joined: Mon Mar 12, 2012 9:06 am

Re: nRF24LE1 + MCU

Postby brennen » Tue Apr 17, 2012 12:03 pm

rgp64 wrote:Do you think it is time to give it a good funeral? xD

:lol:

I would say this is probably a good time to pay your last respects.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

PreviousNext

Return to Wireless

Who is online

Users browsing this forum: No registered users and 2 guests

cron