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.

RTOS: TMS320F28075 interrupt

Tool/software: TI-RTOS

Hi TI!

Help me please with my issue.

Why interrupt instruction is not available?

I have interrupt from my ADC A and B ? they have address of function HWI_ADC.

Can i define same function for ADC A and ADC B interrupt? And why i have problem with this interrupt.

Start of ADC convention selected by EPWM4 , it works like a timer.

  • The interrupt #19 mentioned in the error message is caused by an ITRAP (illegal instruction). Judging by your screenshot, I think you're getting into the Hwi just fine, but then getting an error when calling meas.RBcontrolFunc().

    Can you confirm that meas.RMcontrolFunc() is valid? Can you place a breakpoint and step into it? Is its address correct? If you look at it in the Memory Browser or Disassembly window, is the code there in memory?

    Whitney
  • Hi, i have fault after initialization adc,  meas.func is ok, name of function modify for screenshot.

    May be i have problem with interrupt epwm?

    If i set for start adc -epwm4a i have that problem.

    I think  problem because instruction interrupt is not valid , in examples werd interrupt have another colour.

    programm dont come to interrupt function hwi_adc, after set adc and epwm - fault

  • after set epwm4 i have foult

    EPwm4Regs.TBCTL.bit.CTRMODE = 0x3; // Disable the timer
    EPwm4Regs.TBCTL.all = 0xC033; // Configure timer control register
    /*
    bit 15-14 11: FREE/SOFT, 11 = ignore emulation suspend
    bit 13 0: PHSDIR, 0 = count down after sync event
    bit 12-10 000: CLKDIV, 000 => TBCLK = HSPCLK/1
    bit 9-7 000: HSPCLKDIV, 000 => HSPCLK = SYSCLKOUT/1
    bit 6 0: SWFSYNC, 0 = no software sync produced
    bit 5-4 11: SYNCOSEL, 11 = sync-out disabled
    bit 3 0: PRDLD, 0 = reload PRD on counter=0
    bit 2 0: PHSEN, 0 = phase control disabled
    bit 1-0 11: CTRMODE, 11 = timer stopped (disabled)
    */
    //**************************************************************************
    /*** Configure ePWM4 to trigger the ADC at a 37KHz rate ***///**************************************************************************
    EPwm4Regs.TBCTR = 0x0000; // Clear timer counter
    EPwm4Regs.TBPRD = TB3; 
    EPwm4Regs.TBPHS.bit.TBPHS = 0x0000; // Set timer phase

    EPwm4Regs.ETPS.all = 0x0100; // Configure SOCA
    /*
    bit 15-14 00: EPWMxSOCB, read-only
    bit 13-12 00: SOCBPRD, don't care
    bit 11-10 00: EPWMxSOCA, read-only
    bit 9-8 01: SOCAPRD, 01 = generate SOCA on first event
    bit 7-4 0000: reserved
    bit 3-2 00: INTCNT, don't care
    bit 1-0 00: INTPRD, don't care
    */

    EPwm4Regs.ETSEL.all = 0x0A00; // Enable SOCA to ADC
    /*
    bit 15 0: SOCBEN, 0 = disable SOCB
    bit 14-12 000: SOCBSEL, don't care
    bit 11 1: SOCAEN, 1 = enable SOCA
    bit 10-8 010: SOCASEL, 010 = SOCA on PRD event
    bit 7-4 0000: reserved
    bit 3 0: INTEN, 0 = disable interrupt
    bit 2-0 000: INTSEL, don't care
    */

    EPwm4Regs.TBCTL.bit.CTRMODE = 0x0; // Enable the timer in count up mode
    }
    //*****************************

  • I was right , all interrupt instructions are not available in all project , from ti drivers to my code.
    Because when i set declaretion interrupt instruction in c files from ti(drivers) it recconect me to my code where pragma hwi_adc - it really strage .
    Could you help me to set on that instruction.
  • Thanks for your patience. One thing I noted in your screenshot--you don't need to use the interrupt keyword on ISRs managed by the Hwi. The Hwi dispatcher will do the context save for your so it's unnecessary.

    Since you are putting your ISRs in ramfuncs, have you remembered to add code to copy the ramfuncs from flash to RAM at the start of the program?

    Whitney
  • Hi, yes i copy rumfunc to ram.

    I think i found problem, my iq math function mpy  have copy in rumfunc but when i call that function with argument 5000 mpy 0, i have not result  0 . Can you help me debug that problem.

  • Are you still having trouble with this issue? Do you have any updates from your debug?

    Whitney
  • Hi, i allready solve my problem. Thank you.