Author Topic: Interrupt Control  (Read 3323 times)

Offline Phil

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Interrupt Control
« on: September 18, 2018, 06:12:01 PM »
Mark, et al,

I am trying to read an incoming IR stream from a remote control.  From the IR receiver, I have an active-low GPIO inbound signal. All pretty straight-forward.

I was planning to create an initial interrupt upon the first active low pulse. After that, I create a periodic 1 ms timer interrupt to sample the inbound stream 68 times (68 ms total).

In this plan, I need to temporarily disable the initial interrupt so it doesn't keep triggering while I am reading the 1 ms pulses.

Just prior to restarting the initial interrupt, I need to clear the interrupt queue, if any.

It would be nice if I could SINGLE_SHOT a standard interrupt. Is that possible?

What do you recommend?

Thank you in advance.

Phil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Interrupt Control
« Reply #1 on: September 18, 2018, 06:58:03 PM »
Hi Phil

You can disable the interrupt the first time it is handled by using the macro:
_DIS_ARM_PORT_INTERRUPT(A, 19);
(change A and 19 to the port and pin in question).

If you want to re-enable it later (or change its interrupt polarity) you can use
_RE_ARM_PORT_INTERRUPT(A, 19, PORT_IRQC_RISING);

Also consider using port DMA to save the time stamp (from a HW timer) on each change, which could be used as a basis for such decoding (I have used this for IR).

Regards

Mark

Offline Phil

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Interrupt Control
« Reply #2 on: September 18, 2018, 07:53:41 PM »
Very interesting.

Thank you!

Phil