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.

TMS320F28388D: ADC interrupts not working without modifying f2838x_adc.h

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello,

I'm encountering a surprising problem with the ADC_REGS structure defined in the header file f2838x_adc.h.

The size of this structure is 124 words. However in the header file F2837xD_Adc.h the definition was different as it had an additional field of size 4, bringing the total size to 128 words.

Now my problem is the following: 

  • If I leave the header file f2838x_adc.h as is, the ADC interrupts don't seem to work
  • If I add the last 4-word field just like the header file F2837xD_Adc.h the ADC interrupts seem to work fine.

What is going on? Maybe it has something to do with the migration from COFF to EABI?

Regards,

Pierre

  • Do the interrupts in the C2000Ware examples not work or is it just an application of your own that has this issue?

    That doesn't seem like something that should make a difference. If you put AdcaRegs (or whichever ADC you're using) in the expressions window in CCS, can you see any difference in the way the way the registers get configured between the two scenarios? Any unexpected changes between the .map files aside from the change in length of the AdcxRegsFiles?

    Whitney

  • Hello Whitney,

    Thank you for your answer.

    I found the cause of my problem. It was a bug in the code I wrote, where I used a pointer of that structure type to loop over the 4 ADCs, which only works if the size of the structure is equal to the number of addresses between the starts of two consecutive register groups in the memory space.

    I have now implemented a different method where instead of iterating with a variable of type volatile struct ADC_REGS * I iterate with an integer index over an array like this:

    volatile struct ADC_REGS * const ADC_REGISTER_FILES[] = {
        &AdcaRegs, &AdcbRegs, &AdccRegs, &AdcdRegs
    };

    Regards,