Page 1 of 1

How can I to set general I / O ports as an interrupt source? (SOLVED!)

Posted: Sat Oct 07, 2017 3:41 pm
by Lagoda
Hi All,

I would like to use a PIC32MZ Series MCU.
I wanted to use an external interrupt, but I could not to interpret what I see in the "Interrupt Proprties" window.
How can I to setup the masks?
I've also tried the "Select pin (s)" button, but every pin of this port is active at both edges by default.
If I click on an active pin seem I can to deactivate and vice versa, but I can not to select that have to work it on rising edge or falling edge only.

How to configure I/O interrupts through this interface?
Can somebody help me?

Best Regards,
Lagoda

Re: How can I to set general I / O ports as an interrupt source?

Posted: Mon Oct 09, 2017 11:43 am
by Benj
Hi Lagoda,

Looks to me like it's an all or nothing thing on the silicon. i.e. if you enable the pin then it will interrupt on rising and falling edges. Unless I'm missing something.

You can filter out one of the edges using software. Look at the counting multiple pulses example here.
https://www.matrixtsl.com/wikiv7/index. ... Interrupts

Re: How can I to set general I / O ports as an interrupt source?

Posted: Mon Oct 09, 2017 1:36 pm
by Lagoda
Hi Ben,

I checked what you recommended.
In this example, you can set any type of edge. (color of the pin may be green, red, gray or white)
And I opened a new project.
If I set the type of target MCU to PIC32MZ2048EFM144 then you can activate the interrupt on both edges only.
(The color of the pin may only be green or white.)
Please try it out.

Lagoda

Re: How can I to set general I / O ports as an interrupt source?

Posted: Mon Oct 09, 2017 3:16 pm
by Benj
Hi Lagoda,
In this example, you can set any type of edge. (color of the pin may be green, red, gray or white)
And I opened a new project.
If I set the type of target MCU to PIC32MZ2048EFM144 then you can activate the interrupt on both edges only.
The PIC32MZ device only supports both edges as part of the IOC interrupt, it is a limitation of the silicon not Flowcode.

You would have to interrupt on both edges and then take the current value of the port pin, if the bit is a logic 1 then the last edge was a rising edge.

Re: How can I to set general I / O ports as an interrupt source?

Posted: Mon Oct 09, 2017 4:17 pm
by Lagoda
The PIC32MZ device only supports both edges as part of the IOC interrupt, it is a limitation of the silicon not Flowcode.
Oops!

This avoided my attention. I'm sorry. :oops:

I hope this MCU isn't will cause more surprises for me.

Thank you very much.

Best Regards,

Lagoda

Re: How can I to set general I / O ports as an interrupt source? (SOLVED!)

Posted: Tue Nov 14, 2017 4:36 pm
by stefan.erni
Hi Lagoda

I have problem with the IRQ on the PIC32MZ. My program crash if the IRQ is on.....
Can I have a sample from your code?