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.

Control by SPI the cc112x EM

Other Parts Discussed in Thread: MSP430F5438A, CC1120

Hello,

I am working in a project with the SmartRF Trx Evaluation Board and the CC112x EM. I would like to ask if it would be possible to send packets and receive using only communication by SPI. I mean, I would like to communicate the Raspberry Pi with the SmartRF Trx Evaluation Board by SPI and send packets by wireless with the CC112x module. Can someone tell me if that is possible and where can I learn how to establish those communications?
The schema would be:
Raspberry Pi----SmartRF Trx EB (MSP430F5438A)-----CC112x EM - - - - - - - - (Wireless)- - - - - - CC112x EM-----SmartRF Trx EB (MSP430F5438A)

Thank you in advance

  • Do you intend to use the MSP430 on the TRXEB to do the communication with the CC1120 and only use the Raspberry pi to collect a packet from the MSP or the raspberry to communicate directly with the CC1120 EM?

    For some reason based on what I have seen on this forum and others it looks like not too many have tried to use the raspberry to communicate with our RF platforms.

  • I only pretedn to use the Raspberry pi to collect a packet from the MSP.
    Thank you.

  • The raspberry pi could be used to control the CC1120 EM directly via SPI (4 line interface). In addition a couple of GPIOs could be used for interrupts. This is not required but if you don't have access to interrupts you have to poll the CC1120 to check if it has received anything. With a interrupt you can let the MCU do other stuff when nothing is on the air.

  • I only pretend to use the Raspberry pi to collect a packet from the MSP.
    Thank you

  • Hello again. I would like to know if there is any sample code to send any random data through the SPI port of the board. I just want to read that with the Raspberry Pi.
    thanks

  • Hello I am using this example code which I modified :
    ****************************************************************************************************************************
    #include <msp430.h>

    int main(void)
    {
    WDTCTL = WDTPW+WDTHOLD;                   // Stop watchdog timer

      while(!(P3IN&0x08));                       // If clock sig from mstr stays low,
                                                // it is not yet in SPI mode
      P3SEL |= 0x38;                            // P3.5,4,3 option select (MOSI,MISO, SCLK)
      UCA0CTL1 |= UCSWRST;                      // **Put state machine in reset**
      UCA0CTL0 |= UCSYNC+UCCKPL+UCMSB;          // 3-pin, 8-bit SPI slave,
                                                // Clock polarity high, MSB
      UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
      UCA0IE |= UCRXIE;                         // Enable USCI_A0 RX interrupt
     

      __bis_SR_register(LPM4_bits + GIE);       // Enter LPM4, enable interrupts
    }

    // Echo character
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=USCI_A0_VECTOR
    __interrupt void USCI_A0_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
      switch(__even_in_range(UCA0IV,4))
      {
        case 0:break;                             // Vector 0 - no interrupt
        case 2:                                   // Vector 2 - RXIFG
          while (!(UCA0IFG&UCTXIFG));             // USCI_A0 TX buffer ready?
          UCA0TXBUF = UCA0RXBUF;
          P4DIR=BIT2;
          P4OUT|=BIT2;
          P4OUT &= ~BIT2;
          break;
        case 4:break;                             // Vector 4 - TXIFG
        default: break;
      }
    }

    ***************************************************************************************************************************
    I am sending information from the raspberry pi to the TrxEB and I am getting a square signal in the pin: P7.18 (RF_SPI0_MISO) when what I want is to get an output in the pin P7.7(RF_SPI1_MISO) from this one I don't get anything. The code is supposed to reply the signal that receives but it doesn't. I've been debugging the code and I've realized that it doesn't use the interrupt, I mean it doesn't arrive to the lines in red, it stays in line in green. The lines in blue are just to turn on and off a led when to check the transmission.
    The connections between the Raspberry Pi and the TrxEB:

    CS: Pin 24 of Rasp.Pi (SPI CE0N) with Pin P7.14 of TrxEB (RF_SPI0_CS_N)

    SCLK: Pin 23 of Rasp.Pi (SPI Sclk) with Pin P7.12 o trxEB (RF_SPI0_SCLK)

    MOSI: Pin 19 of Rasp.Pi (SPI MOSI) with Pin P7.9 of TrxEB (RF_SPI1_MISO)

    this are the GPIO of Raspberry pi:http://jeffskinnerbox.files.wordpress.com/2012/12/mini-uart.jpg

    Please, can anyone tell me why my code is not working?

  • Hi

    You have asked the same question in the following post:

    http://e2e.ti.com/support/low_power_rf/f/155/p/327791/1142383.aspx#1142383

    Please use only one thread per question unless you need to post at a different forum. I've given you an answer on this forum so I there is any follow up on this issue please do it on the initial thread.