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.

Using McASP and I/OExpander simultaneously crashes McASP transmission

Other Parts Discussed in Thread: OMAPL138, STARTERWARE-DSPARM

Hello.

I'm using examples from here http://processors.wiki.ti.com/index.php/QuickStartOMAPL1x_rCSL so I assume everything is configured riight. For me it looks ok. My project is build from union of McASP example and I2C (use IOExpander) example.First example only pass through audio signal using interrupt service function. Second works like this: it waits for user to change DIP1 position. In this state it sends commends through I2C to check condition of DIP1 and didn't crash. Problem appears when I switch DIP and proogram goes to toggle LED where it also using only I2C communication. Then, audio transsmision stops. I don't have any idea why. Please help me.

 

 

I don't see any code include options so I just copy it:

 

static Bool wait_for_user_input (void)
{
    // Read from the Port 1 Input Register
    readIoExpCmd[COMMAND_BYTE] = INPUT_PORT1;
   
    // Send Address to IO Expander
    while(I2C_write(I2C_IO_EXPANDER_ADDR, readIoExpCmd, sizeof(readIoExpCmd)));
   
    // Read from IO Expander
    while(I2C_read(I2C_IO_EXPANDER_ADDR, inputRegP1, sizeof(inputRegP1)));
   
    // Process Current DIP Switch Configuration
    newInputP1 = inputRegP1[0] & userSW1;
   
    // Test for User Input
    if(prevInputP1 != newInputP1)
        return FALSE;
   
    return TRUE;
}/* wait_for_user_input */

static void toggle_user_LED (void)
{
    // Write to the Port 0 Output Register
    writeIoExpCmd[COMMAND_BYTE] = OUTPUT_PORT0;
    dummyDelay(1000);
    for(counter = 0; counter < LED_BLINK_COUNT; counter++)
    {
        // Turn LED1 On
        writeIoExpCmd[DATA_BYTE] = LED1_ON;
        while(I2C_write(I2C_IO_EXPANDER_ADDR, writeIoExpCmd, sizeof(writeIoExpCmd)));
        dummyDelay(1000);
   
        // Turn LED1 Off
        writeIoExpCmd[DATA_BYTE] = LED1_OFF;
        while(I2C_write(I2C_IO_EXPANDER_ADDR, writeIoExpCmd, sizeof(writeIoExpCmd)));
        dummyDelay(1000);
    }
}/* toggle_user_LED */

  • Pawel,

    In the examples you reference, the McASP is being serviced directly by the DSP using interrupts.  If interrupts happen to be disabled for a sufficiently long time, then there's a possiblility of missing a sample which may cause what you're seeing.While this is a good example to illustrate many of the low level details of the McASP operation, it is generally recommended to use the EDMA to service the McASP, as the EDMA operate independently from the DSP processor.

    I strongly recommend you use the StarterWare software package.  It provides a higher level set of APIs compared to the rCSL examples.  In addition, the examples are more complete (including McASP+EDMA example) than the ones you are referencing.

    You can find that package here for the OMAPL138:

    http://www.ti.com/tool/starterware-dsparm

    Regards
    Kyle