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
How can I to set general I / O ports as an interrupt source? (SOLVED!)
Moderator: Benj
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
How can I to set general I / O ports as an interrupt source? (SOLVED!)
- Attachments
-
- Interrupt.jpg (118.41 KiB) Viewed 4484 times
Last edited by Lagoda on Wed Oct 18, 2017 11:04 pm, edited 1 time in total.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: How can I to set general I / O ports as an interrupt source?
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: How can I to set general I / O ports as an interrupt source?
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: How can I to set general I / O ports as an interrupt source?
Hi Lagoda,
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.
The PIC32MZ device only supports both edges as part of the IOC interrupt, it is a limitation of the silicon not Flowcode.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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: How can I to set general I / O ports as an interrupt source?
Oops!The PIC32MZ device only supports both edges as part of the IOC interrupt, it is a limitation of the silicon not Flowcode.
This avoided my attention. I'm sorry.
I hope this MCU isn't will cause more surprises for me.
Thank you very much.
Best Regards,
Lagoda
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: How can I to set general I / O ports as an interrupt source? (SOLVED!)
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?
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?