Interrupt calling from HEW

Hello All,


My problem statement = How to call ISR function automatically when interrupt will get generated ( in HEW) ?

As per knowledge, In HEW, there is "intprg.c". This .c contains all the functions with interrupt name. 

and in "vecttbl.c" , there is a function pointer named "void (*INT_Vectors[])(void)". and this function body contains address of all the functions which are present in "intprg.c".


So, I have called my "CAN_Ch_1_TX_ISR()" in interrupt function present in ""intprg.c".


So I enabled all interrupts in code. but when interrupt is generated, "CAN_Ch_1_TX_ISR()" not gets called automatically?


Is there any HEW setting needed to do for this?

  • In reply to apu:

    there is Interrupt priority set register where all bits are 0 during power on reset. but if priority is 0, then all interrupt like ADC,timer,CAN etc are masked (even if you have configured peripheral interrupt mask register to unmask that interrupt).
    So, as per datasheet of sh72531, we can give priority between 0 to 15(15 is highest pri.)So I have given 15th priority to CAN, but still its not calling ISR.
  • In reply to apu:

    OK, in SH72531 manual it is called only SR (Status Register) instead of PSR (Processor Status Register). It is a CPU control register.

  • Please need help regarding Interrupt calling.
  • In reply to FrankL:

    when I run code on hardware and debug it, then its observed that "Interrupt flag" keeps updating as per code, but based on value change in "interrupt flag",interrupt is not generated(even if interrupt is unmaksed.). I applied breakpoint to my ISR function, but its not get called.

    Can transmission interrupt related things from sh72531 =

    1) IRR8 bit from IRR register = it becomes 1 when data from mailbox is transmitted.
    2) IMR8 bit from IMR register = used to mask / unmask interrupt generation from IMR8 (0 = unmask; 1 = mask)
    3) MBIMR1 = enable/disable updation of IRR8 bit for MB31 to 16.
    4) IPR28 (from INTC chapter of sh72531) = it sets priority of IRR8 interrupt for CAN channel A. I have selected highest pri = 1111.
  • In reply to apu:

    Is any #pragma setting need to do for interrupt handler?

    My code setting = (Setting regarding interrupt)

    IMR = 0xFEFD = tx/rx inetrrupt enable
    MBIMR1 = 0x7FFF = tx interrupt enabled
    IPR28 = 0xF000;(priority for CAN Ch-A
  • Hello All,

    Please need a help regarding sh72531 CAN channel A interrupt.

    Hardware debugging observation =

    1) Interrupt flag (IRR8)becomes 1 when transmission is completed
    2) this IRR8 is also unmasked using IMR8(IMR8 = 0)
    3) MBIMR for MB31 is also unmasked.

    Hardware output =
    Data transmission over CAN is running, but interrupt is not generated after transmission.
  • HEW is an IDE. you can only specify to the compiler by using the HEW setting to avoid optiization of interrupt functions during compiling. since these fuctions are not called from any where.
    If interrupt function is not generated asynchronously then try clearing mailbox data buffer after updating data in mailbox and making TXPR bit to 1. Hope this thing might work... :-)