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.

CCS/CC3120BOOST: MSP432P401R + CC3120BOOST SPI Enable

Part Number: CC3120BOOST
Other Parts Discussed in Thread: CC3120, UNIFLASH

Tool/software: Code Composer Studio

Hello,
I have been struggling with binding MSP432P401R Launchpad board and CC3120 Booster pack together.

I have looked over Datasheets of both boards, TI Resource Explorer, examples, Simplelink Academy, even most of the TI E2E forums for similar examples

and tried to use these but could not figure out.

The features i am using in MSP432 is just the ADC and SPI master. In CC3120, SPI slave and WIFI packet transfers.

I was hoping if someone had some insights or could give some tips about where to start about these, since I am very new to this area.

What I am trying to do is to is, (Using CCS)

1. In MSP432P401R board, Use 14bit ADC to sample at maximum sampling frequency (1 MSPS).

2. Use DMA to transfer the ADC samples to RAM

3. Use SPI to transfer from MSP432 to CC3120 Boost

4. Send from CC3120 Boost to my PC WIFI module by either UDP or TCP packets.

5. Repeat the above process.

By following the msp432 forum answers and examples, I can sample the ADC at 1 MSPS for about 30000 samples (maximum is 31700 samples due to RAM size I believe) and store it in RAM

using nortos. (step 1 &2)

Even though I have not finished step 3( SPI transfer), I am trying to enable WIFI process.

From the datasheets, I thought the SPI transfer data throughput and the UDP or TCP throughput may be enough.

I have tried the network terminal example from ti. But I am not sure how to extract the parts I want to use from it. From what I have learned, I think I should use socket.c parts or transceiver.c parts.

So my overall question is that does the above steps (1~5) look possible? 

to be more specific, 

1. All of the code and compiling is put in MSP432? There is nothing to be done for cc3120? (I did update the service pack using EMULBOOST and Uniflash) (how can the CC3120 be initialized and work as programmed (know that SPI transfers data and send it through WIFI)?)

2. Is it possible to retrieve only some parts from network_terminal.c example and use it alone? (only the socket part, or transceiver part)

3. how can I implement (insert) my own data (ADC data from MSP432 via SPI) in the UDP or TCP sockets? (will it be possible to send ADC data from msp432 through SPI to cc3120 to send it over WIFI?)

or is it possible to retrieve the data from ram and send it through WIFI 

4. Is it correct (possible?) way to combine my nortos ADC code with CC3120 code into a single code and put it inside the MSP432? 

I tried to figure it by myself by looking at/studying forums, MSP432 (datasheet, user guide, driverlib, examples), CC3120 programmer's guide but feel like trapped in a infinite loop of confusion.

If someone could answer, or even give me some tips about anything, it would be great.

Thank you.

  • Hi Jinwoo,

    It is very possible to create the application that you have in mind. If you aren't already using it, the SimpleLink Wifi CC3120 SDK Plugin is the easiest starting point, as it has out of box examples for the MSP432P4. 

    To answer your questions:

    1. Other than flashing the CC3120 servicepack, there is nothing that needs to be done on the CC3120 side. The CC3120 is configured to act as a network processor, and accept commands and other data through the interface exposed on the SPI port. The full programming guide of the CC3120 documents the entire API.

    2. It is definitely possible to only use parts of the network_terminal example. In fact, the example is meant as an all-encompassing example so that most of the networking capabilities of the cc3120 can be tested, used as references, and reused. In your case, the important code you would want to take is main() from main_tirtos.c (which spawns the main thread), mainThread() from network_terminal.c (which handles all of the wifi init) and UDPClient() from socket_cmd.c. You'll also need to include any supporting code that the above functions require. uart_term.c comes to mind - it handles all of the UART debug printing.

    3. If you look at UDPClient(), it is designed as a UDP throughput testing function. Thus, when you call it the function will prepare dummy data in a buffer, than then send that buffer over UDP to the target address. You can rework that function to instead use your own predefined ADC global buffer, or even better pass in a pointer to your ADC DMA buffer into the function and send that.

    4. Once you have reworked UDPClient() to send your own data, you will need to implement your ADC code, and have it call UDPClient() when data is ready to be sent. There are many ways to go about doing this. If you are using an RTOS, you can have the ADC code be in a seperate thread from the main networking thread. In the ADC thread, you will setup the ADC + DMA, and then when the DMA is done, post to a message queue. This will be consumed by the networking thread, which will take the ADC buffer passed in, and then send it over UDP. See the mailbox example in the MSP432 SDK for an example showing how you would do this for TIRTOS. For this to work properly, you will most likely need a ping-pong buffering scheme for your DMA transfers.

    I hope that helps to clear up your confusion, and let me know if you have further questions.

     

    Regards,

    Michael

     

  • Thank you for the nice & helpful answer.
    I will look through the code like you have suggested.

    I think in the network_terminal.c , UDPClient code, I should modify the gDataBuffer.nwData (global data buffer). I will work around it!
    Also I am not sure if I can implement the NORTOS adc code directly to the TIRTOS main thread code but I will try or modify.


    Thank you again Michael!