nRF24LE1 + MCU

Discussion about wireless devices

Re: nRF24LE1 + MCU

Postby fintor » Mon Apr 23, 2012 2:52 pm

I have the same issue, I think. I am using the PC-side bootloader you wrote.

I Press "check com", and am able to find the device, so I open the port and "PGM>" appears. So I hit "e", but nothing happens(how long should it take?).

Then I hit "p" and nothing happens either. After that I pressed "Send File" and select a .hex file and then a progress bar is shown and a lot of stuff is printed out on the terminal, which takes some time to finish and in the end I get a message saying that the programming was successful

However. I wanted to ask you, if it is safe to connect the programmer, external mcu and the nrf24le1 in my project like this :)

Code: Select all
PROGRAMMER.P0.1 _________________ nRF24LE1.P05
                       |__________ EXT_MCU.GPIO

PROGRAMMER.MMISO _______________ nRF24LE1.P04
                       |__________ EXT_MCU.MMISO

PROGRAMMER.MMOSI _______________ nRF24LE1.P03
                       |__________ EXT_MCU.MMOSI

PROGRAMMER.MSCK ________________ nRF24LE1.P02
                       |__________ EXT_MCU.MSCK


P.S. Hope that the connection gets correctly through, but it should be clear what I mean by these lines. I didn't bother mentioning other pins since they are not connected together at any time.
And of course the programmer is only connected when the nRF24LE1 needs to be programmed, but the external mcu and nRF24LE1 are always connected.

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

Re: nRF24LE1 + MCU

Postby brennen » Mon Apr 23, 2012 3:24 pm

fintor wrote:I Press "check com", and am able to find the device, so I open the port and "PGM>" appears. So I hit "e", but nothing happens(how long should it take?).

If you're not seeing the erase ("e") command return within about 5 seconds, then you aren't communicating to the slave device over SPI. The programming code has to verify that the slave is ready to accept flash commands, and it does this by repeatedly checking the slave's FSR.RDYN bit to see if it is set. If SPI is always reading zero for that bit (which could indicate a communication failure), then the master will hang there indefinitely.

fintor wrote:Then I hit "p" and nothing happens either. After that I pressed "Send File" and select a .hex file and then a progress bar is shown and a lot of stuff is printed out on the terminal, which takes some time to finish and in the end I get a message saying that the programming was successful

I'm confused by what you mean that "nothing happens" when you try the program ("p") instruction. Obviously, something is certainly happening in your second sentence, so you should be a bit more specific on what you mean.

The reason (I'm assuming) you see a bunch of stuff coming out on the terminal is that, on the 24-pin device at least, the UART TXD function and the FSPI FCSN function both live on the same pin (P0.5). When you're programming the slave device, the FCSN pin coming from the master is very frequently changing, and your computer sees these changes as input to your serial port, so it gets dumped to your terminal.

I'm fairly surprised that the program instruction actually completes, but the erase instruction doesn't. Both of them should either work or fail, since they're based on most of the same commands.

If you want to check whether the programming actually completed, you need to use the verify ("v") instruction. It will check the slave's flash memory against a hex file you send (you would generally program and verify in series with the same hex file).

fintor wrote:However. I wanted to ask you, if it is safe to connect the programmer, external mcu and the nrf24le1 in my project like this

Connecting it like that is fine, so long as you put in series resistors between your external microcontroller's I/O pins and the LE1's I/O pins. The value should be as close to 1k ohm as possible. The programmer tri-states all of its pins while it's not programming, but you want it to win when you are programming, and the series resistors between the external micro and the LE1 accomplish this in a simple way.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Tue Apr 24, 2012 7:13 am

Thanks for the reply.

Here is the output I get: http://pastebin.com/mNRDgC3Z

I pressed "e", waited for about 5-10 seconds, then "p" and selected the file I wanted to send. The weird part is that it took about 20 minutes to complete. Do you think that there is something wrong with my programmer, or the receiving breakout board?
fintor
 
Posts: 21
Joined: Thu Mar 01, 2012 9:08 am

Re: nRF24LE1 + MCU

Postby brennen » Tue Apr 24, 2012 12:08 pm

You're using the commands incorrectly. You must only execute one command, then let it complete and return to the "PGM>" prompt. If you type "ep", then the command interface ignores everything but the last character before you hit "enter", so you're only getting the program command, not the erase command.

If the erase command is taking longer than 10 seconds, then you either have a wiring error or there is a problem with one or both of the boards (this could be a GPIO issue, even).

You can also try the "d" command, which dumps the entire flash of the slave to the serial port. If what comes out is just a bunch of 0xFF entries, then either the slave has been erased or you are not communicating with the slave. If you have the bootloader successfully in the flash, then the first three bytes of your flash memory (bytes 0, 1, and 2) will be "02 3E 00", which is long jump (8051 instruction 0x02) to memory location 0x3E00 (start of the bootloader's flash page).
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Wed Apr 25, 2012 6:51 am

Thanks again for the reply brennen

That is what I am doing. Press "e" then enter, wait for a few seconds, but nothing happens. Then after that I press "p", but nothing happens until after I send the .hex file

If I press "d", nothing happens at all either.

Do you think there is something wrong with the programmer, or the receiving chip?

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

Re: nRF24LE1 + MCU

Postby brennen » Wed Apr 25, 2012 11:59 am

One issue you may be having is line endings that are sent from your terminal program. The programmer code I sent you expects line endings to have a either a '\n' or a '\r\n' termination (which should work with all modern operating systems). If your terminal software is (for whatever reason) only sending a '\r' character as a line feed, then my programmer code will not see that as a return, and will ignore it. If you type 'e' (and see the 'e' character echo on the screen) then press "enter", but you don't see anything happen, then there is an extremely high chance that your terminal is not using the right newline characters.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Tue May 01, 2012 11:15 am

Sounds probable :)

The terminal that I have been using is the one that you wrote(http://www.diyembedded.com/bootloader/PC/nrf24lu1_bootloader_pc.zip)

What terminal would you recommend? I am running Arch Linux and have also tried using a terminal called Cutecom, but I have not been successful in opening the device with it. I suppose it is just a matter of configuration though. The configuration I have been using is:
Device: /dev/ttyUSB2 --> it is the correct device for me.
Baud rate: 38400
Data bits: 8
Stop bits: 1
Parity: None
fintor
 
Posts: 21
Joined: Thu Mar 01, 2012 9:08 am

Re: nRF24LE1 + MCU

Postby brennen » Tue May 01, 2012 12:12 pm

I updated the nRF24LE1 on-chip programmer code to be tolerant of all types of line endings. Download it again (http://www.diyembedded.com/files/nrf24le1_based_programmer.zip) and flash your nRF24LE1 with the firmware. If that doesn't work, then I'm not totally sure what to try.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: nRF24LE1 + MCU

Postby fintor » Thu May 31, 2012 7:06 pm

Hello brennen,

Thanks for all the replies.

It is finally working. Good thing I bought 3 sets of the breakout boards because apparantly the uart_tx pin on the nrfle24 board was not working properly(my fault).

Now I am wondering. Does it matter much where the antenna is placed on the board? The two devices I am making, only need to be able to communicate a few meters(5 meters max) apart

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

Re: nRF24LE1 + MCU

Postby brennen » Thu May 31, 2012 7:13 pm

fintor wrote:It is finally working. Good thing I bought 3 sets of the breakout boards because apparantly the uart_tx pin on the nrfle24 board was not working properly(my fault).

I'm glad to hear you were able to get them going!

fintor wrote:Now I am wondering. Does it matter much where the antenna is placed on the board? The two devices I am making, only need to be able to communicate a few meters(5 meters max) apart

The placement of the antenna is influenced the most by the type of the antenna/connector. If you're using a chip antenna, then you have to put it at the end of the board, because (at least with most chip antennas) you typically don't want to run a ground plane under it or past it. If you're using an edge-mount RP-SMA connector like I do, then that would also connect to the edge of the PCB. Other RP-SMA connectors are meant to be soldered to the board with the antenna coming up from the board. These can be placed just about anywhere on the board.
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 1 guest

cron