Jump to content
43oh

G2452 and Spirilis nrf24l01 library


Recommended Posts

So... trying to make G2452 and nrf24l01+ module working with an awesome library Spirilis wrote but I can't make it work. I'm using ping-remote-led example where I just added

if (msprf24_current_state() == RF24_STATE_NOTPRESENT) {
                P1OUT |= BIT0; // Set red LED
                _DINT();
                LPM4;          // Halt completely
        }

after the msprf24_init function so I could see if I hooked everything right. Almost the same code from examples work with G2553 but I cant get 2452 to work. Is there anything I need to do when working with USI instead of USCI? By looking at the code I thought it detects it automatically but I cant think of anything else to try. I just cant get that LED to turn off. No matter what I try I cant make MSP and NRF communicate together. Any help would be greatly appreciated. Thanks

 

Link to post
Share on other sites

First thing is the USI chips like G2452 have their MOSI/MISO pins backwards compared to the G2553. Are you flipping those pins?

 

(Side note if you are using my booster pack for this, you'll need to cut the MOSI & MISO solder jumpers and connect the ones underneath that are listed for USI)

 

Sent from my Android tablet using Tapatalk

 

 

Link to post
Share on other sites

I didn't change anything from the nrf_userconfig.h file I just connected according to it.

 

So: CE    --> P2.0

      CSN --> P2.1

      IRQ  --> P2.2

      SCLK-->P1.5

And of course MOSI and MISO pins which I tried reversing but nothing. As requested my unaltered config file. 

And thanks again, its nice to meet so helpful strangers :)

/* nrf_userconfig.h
 * User configuration of nRF24L01+ connectivity parameters, e.g.
 * IRQ, CSN, CE pin assignments, Serial SPI driver type
 *
 *
 * Copyright (c) 2012, Eric Brundick <spirilis@linux.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any purpose
 * with or without fee is hereby granted, provided that the above copyright notice
 * and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
 * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef _NRF_USERCONFIG_H
#define _NRF_USERCONFIG_H

/* CPU clock cycles for the specified amounts of time--accurate minimum delays
 * required for reliable operation of the nRF24L01+'s state machine.
 */
/* Settings for 1MHz MCLK.
#define DELAY_CYCLES_5MS       5000
#define DELAY_CYCLES_130US     130
#define DELAY_CYCLES_15US      15
 */

/* Settings for 8MHz MCLK.
#define DELAY_CYCLES_5MS       40000
#define DELAY_CYCLES_130US     1040
#define DELAY_CYCLES_15US      120
 */

/* Settings for 16MHz MCLK */
#define DELAY_CYCLES_5MS       80000
#define DELAY_CYCLES_130US     2080
#define DELAY_CYCLES_15US      240

/* Settings for 24MHz MCLK.
#define DELAY_CYCLES_5MS       120000
#define DELAY_CYCLES_130US     3120
#define DELAY_CYCLES_15US      360
 */

/* SPI port--Select which USCI port we're using.
 * Applies only to USCI devices.  USI users can keep these
 * commented out.
 */
#define RF24_SPI_DRIVER_USCI_A 1
#define RF24_SPI_DRIVER_USCI_B 1

/* Define whether this library should use LPM0+IRQs during SPI I/O and whether this library should provide the ISR. */
//#define RF24_SPI_DRIVER_USCI_USE_IRQ 1
//#define RF24_SPI_DRIVER_USCI_PROVIDE_ISR 1


/* Operational pins -- IRQ, CE, CSN (SPI chip-select)
 */

/* IRQ */
#define nrfIRQport 2
#define nrfIRQpin BIT2

/* CSN SPI chip-select */
#define nrfCSNport 2
#define nrfCSNportout P2OUT
#define nrfCSNpin BIT1

/* CE Chip-Enable (used to put RF transceiver on-air for RX or TX) */
#define nrfCEport 2
#define nrfCEportout P2OUT
#define nrfCEpin BIT0

#endif

 

 

      

 

 

Link to post
Share on other sites

OK got it. Stupid me. I didn't P1OUT &= ~BIT0 at startup. So basically I didn't turn off led at startup and it looks like it has been working the whole time but I just didn't thought off of trying it :D. Thanks Spirilis its working great now, my remote LED is happily blinking. Thank you for making an awesome library :D

Link to post
Share on other sites
  • 2 years later...

Hi !

I tried this today, but when i run the code without a transceiver connected i do not get the red led lit.

I understand, that it must lit up if there is no transceiver present.

 

When using gcc compiler under linux i get a lot of error messages that there are undeclared things.

I can get this compiling without an error if i include the ".c" files in the header too, and not only the ".h" files.
But this might be another thing.

 

I use CCS 6 now to try it with this library.

 

What am i doing wrong?

 

Thank You!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...