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.

Interrupt doubt

0638.i2s_Int.pdf

Hi everybody,

 

I am having difficult in interruption use when I mix two examples of CSL (CSL_I2S_INTCExample_Out and  CSL_MMCSD_SdCardFSExample_Out).

 

My final application will acquire sound by codec and record its values on a SD card. To improve performance of ATA_write function the buffer that stores codec values is big, so, during a record on SD some new samples of sound could be lost. To ensure that no sample is lost I will fill the buffer using interrupt.

 

I did the follow:

  1. Create a file called i2s_Int.c (attached) using the file supply at example CSL_I2S_INTCExample_Out
  2. Declared the prototype extern Int16 i2s_Int() on the file where is my main function.
  3. Before the function ATA_write I called i2s_Int() according follow.

IRQ_globalDisable();

i2s_Int();

     

/* Write data to the file */

ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);

 

What happen is that the interrupt void i2s_rxIsr() is calling correctly but after about 20 seconds the console returns:

 

ATA_write Failed

 

MMCSD-ATAFS DMA MODE TEST FAILED!!

 

MMCSD-ATAFS TESTS FAILED!!

 

After more 20 seconds the console returns:

 

ATA_write Failed

 

MMCSD-ATAFS DMA MODE TEST FAILED!!

 

MMCSD-ATAFS TESTS FAILED!!

 

When I put breakpoints on i2s_rxIsr (line 29) and on csl_mmcsd (line 4591) the program stops only on the first. When I leave only the second breakpoint active the program stops on line 4591 where MMCST0 is always zero, so, the program still there until the timeout generate the error.

 

Please, could anybody help me understand what I am doing wrong?

 

I am using the new CSL (2.10) with C5515 ezDsp and CCS 4.1.3.

 

Regards,

 

Andrea

  • Hi everybody,

    My problems still, after study and tries follow are more observations/details.

    I watch the registers IER0 = 0x0080 confirm the i2s rx interrupt but the register IFR0 = 0x00A0 seems not ok because show i2s rx and tx interrupts but the last is not configured.

    I read the document SWPU073E but in my opinion it is not sufficient.

    The flag never is cleaned (why?) but the document SWPU073E recommend “Clear corresponding IFR flag”. I tried use IRQ_clear and IRQ_clearAll functions but did not work and the flags still set.

    Studding the file csl_intc.c I noted that two functions (IRQ_init and IRQ_config) were not used in, so I included, but without success.

    When the program reach the MMC_write function, the IER0 = 0x0080 and IFR0 = 0x00A0. The IRQ_globalDisable() function placed before some functions always return zero. Please what exactly do and why this function?

    I measured the time elapsed on the i2s_rxIsr function, it is about 6 microseconds, maybe this time is critical to correct work of MMC_write function?

    Please, could anybody help me?

    Thanks,

  • Hi,

    I'll take a look it and get back to you.

    Regards,

    Hyun

  • Hi Andrea,

    Hope you are aware that there are no dedicated interrupt lines for MMC/SD on the C5505/15 DSP. There are four programmable interrupt lines which will be shared by I2S and MMCSD. PROG0 and PROG1 will be shared by MMCSD0 and I2S0. PROG2 and PROG3 will be shared by MMCSD1 and I2S1. If you are using MMCSD0 for your SD card access, you use I2S ports other than I2S0 for the audio transfer. Configure the proper interrupt lines for that I2S port. Refer to DSP system user guide for more details on the interrupt lines. 

    Pratap.

  • Dear Pratap, thank you for attention.

    I would like to give more informations about the issue:

    First, the kit C5515 eZDSP uses I2S0 and MMC/SD1, so, the interrupts are independent.

    Second, despite the routine MMC_write() calls MMC_intEnable(0xF9), none interrupt function is write/associated of it. I changed MMC_intEnable(0x00) and still not working.

    Third, the register IFR0 shows interrupts not enabled. The CPU will be requested in these cases?

    Fourth, The function IRQ_clearAll() clear IFR0 only on the function i2s_Int(). In the interrupt function IRQ_clear() and IRQ_clearAll() does not clear the flags on IFR0. The document SWPU073E recommends it. Will be possible keep CPU busy because the bit is indefinitely set?

    I should use Debug Interrupt Enable Registers (DBIER0, DBIER1)? Please, anybody knows how and why use it? In my opinion the document SWPU073E is very superficial.

    Sincerely, I do not know other way to receive sound via I2S and keep sampling during the SD writing without the use of interrupt.

    Please, help me!!!

    Regards,

    Andrea

  • Hi Hyun,

    Please, do you could take a look at this issue?

    Regards,

    Andrea

  • Hi,

    It's been a while ago. Is this still an issue?

    Regards,

    Hyun

  • Hi Hyun, sorry for the delayed answer.

    Actually I am trying use DMA to receive data from Codec, but I am having some troubles, below link:

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/84703/292251.aspx#292251

    If you can help me, I'll be very grateful.

    Thanks,

    Andrea