RF430FRL152HEVM SPI write example


I am trying to find an example code that would help to communicate with RF430FRL152 SPI interface.

I have created a custom command which would send 0xBB data on SPI when triggered:

#pragma CODE_SECTION (userCustomCommand, ".fram_driver_code") //see .cmd file for details - all new firmware must go into fram_driver_code memory section space
void userCustomCommand()
    if( RF13MFIFOFL_L == CRC_LENGTH_IN_BUFFER + 1)         // CRC_LENGTH + 1 byte expected
      P1SEL0      |=  BIT3 + BIT2 + BIT1 + BIT0;                           // CLK, MOSI, MISO, CS option select registers
      P1SEL1      |=  BIT3 + BIT2 + BIT1 + BIT0;
      P1DIR       |=  BIT3 + BIT2 + BIT0;                            // Enable, output direction

      UCB0CTLW0   |=  UCSWRST;                       // reset

      UCB0CTL1    |=  UCSSEL_2;                       // SMCLK as clock source
      UCB0BR0     =   0x02;
      UCB0BR1     =   0;

      UCB0CTLW0 &= ~UCSWRST;

      UCB0TXBUF = 0xBB;

      RF13MTXF_L = 0x0;      // no error, send out
       RF13MTXF_L = 0x1;   // an error response

The problem is that I lack documentation on how to correctly implement SPI communication. What I have tried to develop is not working. I have checked with digital analyzer: MISO, MOSI, CLK lines are low, CS (P.1.3) periodically toggles on and off (looks like a clock signal). I haven’t expected that behavior.

Where I could find any working samples on how to implement SPI communication on RF430FRL152? Thank you.

P.S. I removed R20 resistor on the EVM board in order to use SPI communication.

I have not worked with the RF430 so cannot comment directly, I did find the post https://e2e.ti.com/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/553393/sample-spi-code-for-the-rf430 on TI’s E2E forum that may be relevant. Not sure if you have run across it.

Yes, I have read it. It covers the scenario where RF430FRL is an SPI slave - it’s registers are controlled by an external microcontroller. I am trying to find any guidance when RF430RFL is SPI master - it controls an external SPI device by itself.

I have studied RF430FRL15xH Family Technical Reference Manual. Looks like I set registers correctly, but I missed something or there are hardware modifications required for the EVM board.