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.

Save received data from MCBSP of OMAP L138 LCDK

Other Parts Discussed in Thread: OMAPL138, ADS1602

Dear Friends,

I'm using the MCBSP_MasterExampleProject example available at:

C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\exampleProjects\MCBSP_MasterExampleProject.

I'm using OMAP L138 LCDK. The digital output of a custom board which contains an ADS1602 Analog to Digital converter is connected to the J15.23 extension of the OMAP L138 LCDK. This custom boards converts some analog signals to digital and then sends them to the OMAP L138 Board. The OMAP L138 LCDK receives this digital data via MCBSP module. As far as I know, by default, the MCBSP_MasterExampleProject saves the received data on the memory, right?

First, I would like to know that this received data is saved in which part of the memory.

Second, I would like to know how can I save this received data (which is on the memory) on an Excel or Matlab file (any other similar format is also acceptable).

Thank you so much in advance :)

  • I'm still trying to figure out how to solve this problem.
    Please let me know if you have any advice.
    Thanks
  • Sorry for the delayed response on this.
    We are working on your post.
  • I think, if OMAP will receive the data via McBSP then you should refer to the McBSP slave example.

    C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\mcbsp\example\omapl138-lcdk\MCBSPSlave\mcbspSampleSlave_io.c

    You can see the below code where the data will be there once RX operation gets completed.

    /*
    * \brief Function to create the required streams for the reception of
    * Mcbsp data.
    *
    * \params None
    *
    * \return None
    */

    void mcbspAppCallback(void* arg, Mcbsp_IOBuf *ioBuf)

    /* create the buffers required for the RX operation */
    for (count = 0; count < (NUM_BUFS); count++)
    {
    buf[count] = (Ptr)Memory_calloc(NULL, BUFSIZE, BUFALIGN, &eb);

    if (NULL == buf[count])
    {
    System_printf("Memory allocaton failed\n");
    }
    }

    You would receive the data in "buf"

    In McBSP master code, used to send the data to other McBSP slave device. (OMAP to OMAP)

    C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\mcbsp\example\omapl138-lcdk\MCBSPMaster\mcbspSampleMaster_io.c

    /*
    * \brief Function to create the required streams for the transmission of
    * Mcbsp data.
    *
    * \params NONE
    *
    * \return NONE
    */
    void mcbspAppCallback(void* arg, Mcbsp_IOBuf *ioBuf)

    /* create the buffers required for the TX operation */
    for (count = 0; count < (NUM_BUFS ); count++)
    {
    buf[count] = (Ptr)Memory_calloc(iheap, BUFSIZE, BUFALIGN, &eb);

    if (NULL == buf[count])
    {
    System_printf("MEM_calloc failed.\r\n");
    }
    }

    If you want to save the data in xls (Excel) file then you need to add support for USB/MMC for storage device and do file operations to save the data.
  • Dear Titusrathinaraj,
    You're a life saver. Thank you so much. You showed me the right way to solve the problem, however, there is one problem left.
    In mcbspSampleSlave_io.c file, I changed the code as you mentioned:

    THE CODE BEFORE:
    void mcbspAppCallback(void* arg, Mcbsp_IOBuf *ioBuf)
    {
    Semaphore_post(semR);
    }

    THE CODE AFTER:
    void mcbspAppCallback(void* arg, Mcbsp_IOBuf *ioBuf)
    {
    Semaphore_post(semR);
    /* create the buffers required for the RX operation */
    uint32_t count = 0;
    for (count = 0; count < (NUM_BUFS); count++)
    {
    buf[count] = (Ptr)Memory_calloc(NULL, BUFSIZE, BUFALIGN, &eb); // ----------> THIS LINE ERROR

    if (NULL == buf[count])
    {
    System_printf("Memory allocaton failed\n");
    }
    System_printf("sajad jaan %d \n", buf[count]);

    }
    }

    Problem:
    The identifier "eb" is not detected, and CSS gives me an error when I try to compile the code.
    I don't know how to solve this error. Please help me out :)
  • You no need to add those stuff in "mcbspAppCallback" function, keep as it is.
    Those buffer handling already used in "mcbspCreateStreams" function, just I shown code when you asked the RX data location.
  • Dear Titusrathinaraj,

    I printf the buf[count] variable using this code in slaveExample file titled "mcbspSampleSlave_io.c"as you mentioned :

    /* create the buffers required for the RX operation */
    for (count = 0; count < (NUM_BUFS); count++)
    {
    buf[count] = (Ptr)Memory_calloc(NULL, BUFSIZE, BUFALIGN, &eb);

    if (NULL == buf[count])
    {
    System_printf("Memory allocaton failed\n");
    }
    System_printf("\n sajad buf %d \n", buf[count]);
    }

    Here is the result on my console:
    sajad buf 293603840

    As you can see we have 1 receive buffer with decimal value of 293603840. This is surprising me because I have no receiving data. I expect the buffer to be zero. So I connected the digital output of our ADS1602 to the J15.21 and another time to J15.23 extensions. But even after doing so, I get the same 293603840 value for the buffer.
    This issue makes me wonder why the buffer value is not changing.
    Any ideas or suggestions on how to solve this issue?
    Thanks bro :)
  • You are printing the address and not value, print the value.
    Also you can check the value in CCS window.
    Are you running this code on CCS ?
  • Yes, I'm running this code on CCS. How should I print out the address, and not value in CCS?
  • I'm currently viewing the memory address by using the Memory Browser. However, I have no idea how to printf the memory address.