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.

RM44L520: Interrupt from Output N2Het Signal

Part Number: RM44L520
Other Parts Discussed in Thread: HALCOGEN

Hello, 

I am working on a project where I will be toggling a PWM N2HET for a period of time and toggling it off. I would like to be able to interrupt on the rising edge of the PWM signal that is being output so I can count the number of times the pulse has been sent. I was wondering if its possible to configure this interrupt on without having to tie another pin to the pin that will be sending out the PWM signal.

Thanks,

  • Hi Andrew,

    Yes, you can generate interrupt at rising edge or falling edge. 

    In HAL generated code, the PWM is generated using PWCNT and DJZ instructions. Both instructions support interrupt which are called end of duty interrupt and end of period interrupt.

    Unlike GPIO interrupt, the N2HET interrupt is generated by the instruction for example PWCNT and DJZ that has an interrupt enable bit in its instruction format:

    When the interrupt condition in an instruction is true and the interrupt enable bit of that instruction is set, an interrupt flag is then set in the N2HET Interrupt Flag Register (HETFLG). The address code for this flag is determined by the five LSBs of the current timer program address.

  • Unlike GPIO interrupt, the N2HET interrupt is generated by the instruction for example PWCNT and DJZ that has an interrupt enable bit in its instruction format:

    I'm not really sure that you mean by this. I know with configuring interrupts for the GIO pins the gionotificationenable() function is called and passed the port and pin that will be used for the interrupt. Code can then be added to the gionotification() function to perform whatever task needs to be done upon an interrupt. I don't see any end of duty interrupt or end of period interrupt enables within the het.c file. I have tried configuring the edgenotification() function to raise a flag on edge0 (which I have configured to be the same pin my PWM signal is output from) with no luck. I see there is HET level 1, HET TU level 1, HET level 0,  HET TU level 0 in the VIM window of Halcogen as well as interrupt enable toggles within the HET window. Do any/all of these need to be toggled on?

    Thanks

  • Hi Andrew,

    Yes, you need to enable the channel 10 (HET High):

    and channel 24 (HET LOW)

    The interrupt Eof Duty 0 is configured as "High Level", but the Eof Period 0 is configured as "Low Level"