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.

Sample SPI code for the RF430?

Other Parts Discussed in Thread: RF430CL330H, RF430FRL152H, MSP430G2553, RF430FRL152HEVM, MSP430G2253

Hi there,

Do you guys have any sample code demonstrating SPI usage on the RF430?

Thanks for your help!

  • Hello Jeff,

    Do you mean the RF430CL330H?
  • Hi Ralph,

    I'm using the RF430FRL152H, but if the RF430CL330H uses equivalent registers that would work as well :)
  • Here is a RF430FRL152H host controller example using the RF430FRL152HEVM with a MSP430G2553 Launchpad.

    Some things that need to be done:

    1. Remove R20 from the RF430FRL152HEVM.  This resistor is preventing SPI mode detection.
    2. Remove jumper P1.6 (J5) on MSP430G2 LP.  This is interfering with one of the SPI signals.
    3. Timings:  there are some timings that need to be considered in a SPI host controller system.  Unlike with I2C and clock stretching, there is no feedback from the RF430FRL152H if it has enough time to process the SPI packet.  If it the SPI packet is sent too quickly, the CPU on the RF430FRL will not respond properly.  The exact timings for all silicon are not known right  now.  What may work for one device may not work for another.  In this example, it was determined what was working and then slowed down by another at least 4x factor.  These timings are, after a reset is asserted, after a CS is asserted, after a CS is de-asserted, and the SPI clock.
    4. Set S6 to "Supply" on the RF430FRL152HEVM.

    This example code will blink a LED on and off continually.  What is happening is that the MSP430G2 writing to the RF430FRL152H FRAM space to assert and de-assert an interrupt.  It also does some other settings.  Please reference the RF430FRL15xH Firmware Users Guide for more information on the FRAM virtual registers (see http://www.ti.com/product/rf430frl152h documentation tab)

    The example host controller SPI project:

    /cfs-file/__key/communityserver-discussions-components-files/667/RF430FRL15HEVM_5F00_MSP430G2553_5F00_LP_5F00_Host_5F00_Controller_5F00_Example.zip

    The above program is for the MSP430G2253 device.  On the RF430FRL152HEVM the "Default Project" needs to be used since it uses the full ROM code.  This example may not work on the "NFC only" project.  All the RF430FRL15xH available projects can be found on http://www.ti.com/product/rf430frl152h and going to the "Software" tab and then same section.