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.

SPI interface in CC2430

Other Parts Discussed in Thread: CC2430

 

I want to use the SPI interface in CC2430 to communicate with a memory device (AT25DF161).

While searching for information related, I found little to almost none information regarding this in the sense that is not present in the API.

My question is: Can i use HalUARTWrite function to interface to the SPI?

II found some references to the function

 HalUARTWrite(SPI_MGR_DEFAULT_PORT,msg_ptr,len);  //SPIMgr.c

but no information at all regarding the "port" SPI_MGR_DEFAULT_PORT or how it was configured.

I guess that the alternative is to use direct memory access, something like:

 SSN=LOW;
 U1BUF = byte;
 while((U1CSR & U_ACTIVE)); /* Wait until byte has been transmitted. */

as described in http://e2e.ti.com/support/low_power_rf/f/155/t/15981.aspx?PageIndex=3

That complicates things a bit and of course I would like to know if something similar to the first option is available at all?

 

  • I think SPI_MGR_DEFAULT_PORT is defined in header file, so you can look into that, if I don't remember want it is 0x00 which represent port0. UART is definitely different from SPI, so I don't believe that it would work. If you are not sure about hardware SPI, you can always port code of software SPI from other MCUs. Personally I prefer software SPI over hardware SPI since it offer better flexibility unless speed is an issue. 

  • On a followup, the DN113 gives very good information about SPI and how to interface with it.

    Unfortunately, I was not able to understand how can I do back-to-back send and receive.

    I need to interface with a flash memory and hence, open the SPI channel, send the commands and after the, receive the requested data.

    How can I do this with DMA? (CC2430 is Master)