PORT INTERRUPT in flowcode v5.4

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
asbase
Posts: 20
Joined: Sun Jun 03, 2012 12:53 pm
Location: Malaysia
Has thanked: 13 times
Contact:

PORT INTERRUPT in flowcode v5.4

Post by asbase »

When I using the port int macro on portb.4 and output a led on port b.0, 1, 2, 3 or other portb pin beside portb.4, the int portb.4 will become not function. My software need to using two pin for interrupt, portb.0 (int0 int) and portb.4(port int). Previously I be using ccs to done this project and working but failed using flowcode v5 even the 5.4 version. Please advice.

User avatar
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: PORT INTERRUPT in flowcode v5.4

Post by Benj »

Hello,

How are you outputting the value to PortB?

If it's using an output icon then are you using masking or single pin mode to make sure you are not converting RB4 to be an output?

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: PORT INTERRUPT in flowcode v5.4

Post by Enamul »

Hi,
Which pic you are using? Can you please post the program What you are using for testing this?
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

asbase
Posts: 20
Joined: Sun Jun 03, 2012 12:53 pm
Location: Malaysia
Has thanked: 13 times
Contact:

Re: PORT INTERRUPT in flowcode v5.4

Post by asbase »

proteus and real pic simulator and also real hardware.
Simulator in flowcode work, other failed.

asbase
Posts: 20
Joined: Sun Jun 03, 2012 12:53 pm
Location: Malaysia
Has thanked: 13 times
Contact:

Re: PORT INTERRUPT in flowcode v5.4

Post by asbase »

i use single pin mode, 16f682a, 16f887....failed...

User avatar
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: PORT INTERRUPT in flowcode v5.4

Post by Benj »

Are you coming out of the interrupt macro before the interrupt is being triggered again?

If you can provide a minimum flowchart that exhibits the problem then I will have a look and see if I can spot the issue.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: PORT INTERRUPT in flowcode v5.4

Post by Enamul »

Hi,
I have just tried in PIC 16f887 in FCV5.4 and it seems that there is some issue in PORTB int. I am using PORTB<4> as input although FC simulation shows it responds on both edge as it should but in Real PIC I can see only PGT response..
Attachments
RB4_INT.fcf
(11 KiB) Downloaded 320 times
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
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: PORT INTERRUPT in flowcode v5.4

Post by Benj »

Ok thanks for confirming, I will investigate here. Think I have a 16F887 lying around somewhere.

User avatar
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: PORT INTERRUPT in flowcode v5.4

Post by Benj »

Right sorry about the delay.

I have tested the 16F887 with Enamul's program and the hardware is correctly responding to both the rising and falling edges. If I click the switch in a certain way it looks like the interrupt has not fired but it has actually fired twice due to the bouncing on the switch contacts.

I then modified the program so it output on port B pins 0-3 rather then Port C. This is also worked as expected on the hardware and in simulation.
RB4_INT.fcf
(11 KiB) Downloaded 279 times

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: PORT INTERRUPT in flowcode v5.4

Post by Enamul »

Hi Ben,
Thanks for the confirmation. I can't test it on hardware as I don't have that IC in hand. So it clarifies me one thing that Real PIC has a bug in PORT interrupt. I have just tested your program but the response is same as earlier.
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply