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.

MSP430F4132 Asynchronous interface to NRF24AP2

Other Parts Discussed in Thread: MSP430F4132

I am using an MSP430F4132 to communicates asynchronously with a Nordic Semiconductor NRF24AP2 ANT protocol/Transceiver IC.  The NRF24AP2 does not seem to recognize any of the UART commands that I have sent, although they are at the correct baud rate and the information being sent has been verified with an oscilloscope.  Is there anything incorrect twith the UART setup I have used here:

 void UARTInit(void)
{
    UCA0CTL1 |= UCSWRST;        //disable UART

    P6SEL |= BIT5+BIT6;         // P6.5,6 = USCI_A0 RXD/TXD

    /*    UCPEN = 0;            //parity disabled
        UCMSB = 0;            //LSB first transmission
        UC7BIT = 0;            //8 bit data length
        UCSPB = 0;            //1 stop bit
        UCMODE1 = 0;
        UCMODE0 = 0;                //UART Mode
        UCSYNC = 0;            //asynchronous mode */
    UCA0CTL0 &= 0x00;
   
    /*    UCSSEL0 = 1;
        UCSSEL1 = 0;        //UART runs on ACLK */
    UCA0CTL1 |= UCSSEL0;
   
    UCA0BR0 = 0x06;         // 4800BPS Baud Rate
    UCA0BR1 = 0x00;         //
    UCA0MCTL = 0x0E;        // Modulation   
   
    UCA0CTL1 &= ~UCSWRST;        //initialize UART
    IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
                                              // interrupt vector 9
                                             
    /* from sample code msp430x41x2_uscia0_uart_9600
     *   P6SEL |= BIT5+BIT6;                       // P6.5,6 = USCI_A0 RXD/TXD
           UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK
          UCA0BR0 = 0x03;                           // 32k/9600 - 3.41
          UCA0BR1 = 0x00;                           //
          UCA0MCTL = 0x06;                          // Modulation
          UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
          IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
      */
   
} //end UARTInit()

 

Here is the section from the NRF24AP2 datasheet about communications setup:

"The UART communication is for one start bit, one stop bit, 8 bits of data and no parity.  Data is sent and
received LSBit first. "

 

Any help would be greatly appreciated, and I have also contacted Nordic Semiconductor about any issues or special handling their chip may have, I just wanted to explore the possibility of an incorrect setup in the MSP430 UART.

  • Hi,

    The initialization looks okay to me.

    A couple of questions.

    You have 32Khz crystal connected to the board?

    You have enabled the RX interrupt. Do you have an ISR to handle any chars that are received?

    The interrupt for the transmit is not enabled, so you are using polling to transmit the data out?

     

    Barry

  • I don't see anythign wrong here too, and if the baudrate and the commands have been verified by a scope, then the problem isn't in the MSP software.

    What about the required voltage levels?

    It may be that the NRF (which I don't know) requires 5V signal levels and the MSP-generated ~2.8V are not high enough to be accepted as 'high'.

    What you can do if it is the output voltage is to put a serial resistor into the TX line (actually you should do for both then, as teh RX line then is likely stuffed with overvoltage) and a pullup resistor to 5V on the NRF side.
    The series resistors should be ~1k and the pullup ~4,7k.. This will rise the output high voltage by ~0.5v, but also rise the low voltage by 0.9V (for 10k pullup it is 0.36/0.45V)
    A dedicated level shifter of course would be better, but if the simple two resistors can shift the voltage over the threshold without messing up the detection of the low level, why going for a more complex solution.

    Well, I just downloaded the datasheet, and the NRF wruns 0. 3.0V (3.6V max), so the voltag elevels shouldn't be a problem.

    However, the asynchronous communicaiton protocol uses RTS/CTS line.

    From the datasheet:

    "When nRF24AP2 raises the RTS signal high, the host MCU may not send any more data until the RTS signal is lowered again."

    Do you check for RTS? The MSp UART doesn't know about RTS, so if you stuff its TXBUF, it continues to send until done. If the NRF raises RTS in-between, it will still get data sent, and will silently ignore it.
    I don't known what will cause RTS to get high - whether it can happen during a message or only after a message has been received), but it makes the transfer a lot more difficult if you really need to check it between bytes.

    Another possible erro may be that you switched RX and TX (if so, then you're not the first). MSP TX needs to be connected to NRF RX and v.v.

  • I fixed the issue, it was a problem in calculating the checksums for the UART commands to the nrf24ap2 chip, thanks for your response though!

**Attention** This is a public forum