This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interfacing a MSP430 with an nRF24L01+

Other Parts Discussed in Thread: MSP430G2452, CC2500

Hi everybody,

I'm trying to get a communication between the MSP and this RF module. I retrieved a source code for an other µC and adapted the differents I/O functions and declarations. I can't get the good values of the various registers. they depends on the MSP's clock frequency. That's weired. I have the impression that I get pretty close values with a 1MHz clock, it seems that they are just right shift. I don't hunderstand what is happen so I hope that someone here can give me some help to get these things working.

Just for information, I'm using a MSP430G2452 mounted on a lauchpad. I join you the code sources.

Thanks

 

5516.nRF24l01.zip

 

 

  • Hi Benjamin,

     

    could you share your SPI initalization code? 

    EDIT: just got notified that I overlooked the fact that you are using bitbang SPI. Anyway, here is a library, I think it has the code you  are looking for.

  • Oh thanks! This library works great! I can communicate with the nRF24L01+ without any problem. Now, I'm going to try to get a wireless communication between this module and an other one connecter to an other µC (a STM32).

    I know it's a dummy question but what's the default frequency of the MSP430 (when it's not specified in the code) ?

  • Great!

     

    You mean clock frequency? It is around 1.1...1.2 MHz by default.

  • yes, I meant the clock frequency so thanks for the information.

    Now the communication is working fine, I can send a string from a device to an other so it's great!

    It's almost perfect, almost because I can't get the value of the RPD bit (called CD in the previous version of the chip). This bit tells if there is a carrier detected on the same RF Channel. So technically, as long as receive data, this bit should be set to 1 but when I read it and light a LED if it's set, the LED stays off.

    Does anyone have an explanation for this?

    There is a part of my main:

        RF24L01_IO_set();
        init_NRF24L01();

        SetRX_Mode();

        while(1) {

            if(nRF24L01_RxPacket(RxBuf)) {
                SetRX_Mode();
                LCD_Goto(1,1);
                LCD_Print(RxBuf);
            }

            reg = SPI_Read(RPD);
            if(reg==1) {
                P1OUT |= BIT6;
            }
            else {
                P1OUT &= ~BIT6;
            }

            delay_ms(500);

        }

     

    on the transmitter, I have a while(1) with this code inside of it:

            nRF24L01_TxPacket(tx_buf);    // send the buffer packet
            SPI_RW_Reg(WRITE_REG+STATUS,0XFF);

            delay_ms(5000);

  • Hi Benjamin,

     

    I'm afraid your actual question is only related to the nRF transceiver chip now and not to a TI product. Since TI also has a competiting part in this range (CC2500 etc.) it is not really nice from us to discuss these questions here, right?

  • Yes that's right, my apologies. I'll try to find an answer somewhere else. Thanks for your help

  • hi benjamin navarro,
    I am also working on same transceiver but facing the problem on transmitting and receiving.
    could you please share the code of your project in ZIP it will be great help.
    My SPI is working properly and i am aslo working on same MSP430 micro-controller.
    Please help.

**Attention** This is a public forum