Port B6 & B7 Interrupt on 16F887, not resetting

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Port B6 & B7 Interrupt on 16F887, not resetting

Post by Mark »

Port B6 & B7 Interrupt on 16F887, not resetting

Hi,

Attached is a simple test programme for Port B6 & B7 Interrupt on 16F887. It was tested on a HP488 board.

It simulates fine. Press B7 or B6 and the Port A LED goes out.

However, in the chip it works - BUT reset the chip and it does not work again.

Only a power on/off gets it to work, once. Then it does not work again.

There is something relevant in the PIC 16F887 data sheet page 47:

"A mismatch condition will continue to set flag bit RBIF.
Reading or writing PORTB will end the mismatch
condition and allow flag bit RBIF to be cleared. The latch
holding the last read value is not affected by a MCLR nor
Brown-out Reset. After these Resets, the RBIF flag will
continue to be set if a mismatch is present."

Looking through the other posts on Port B interrupt suggests that Flowcode should work with a Port B interrupt without additional C-Code? Am I missing something.

.
16F887 Interrupt in B Test.fcf
Core Test Routine
(7 KiB) Downloaded 250 times
Thanks in advance.
Go with the Flow.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Port B6 & B7 Interrupt on 16F887, not resetting

Post by medelec35 »

Hi Mark,

Try changing Background debug from Enabled to disabled.
See if that makes any difference.

Martin
Martin

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: Port B6 & B7 Interrupt on 16F887, not resetting

Post by fotios »

Hi Mark (and Martin :mrgreen: )
Just now i tried your fcf and i changed configuration. Now is working as you want. Please select from the task bar "Chip"--> "Configure" and press "Switch to Expert Config Screen" button. Then read carefully, line by line the changes that i did in configuration. I don't know if you want to use an external XTAL, i changed oscillator in "Internal RC No Clock". From the "View" --> "Project Options" i changed the clock speed at 4MHz.
Save the attached fcf in your HDD, open it with FlowCode, and open your original file with another FlowCode. Then, open the menus in both FlowCodes and make line by line a comparisson of settings between the two fcf.
Regards
Fotis
Attachments
16F887 Interrupt in B Test_v1.fcf
(7 KiB) Downloaded 234 times
Best Regards FOTIS ANAGNOSTOU

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Port B6 & B7 Interrupt on 16F887, not resetting

Post by medelec35 »

fotios wrote:Please select from the task bar "Chip"--> "Configure" and press "Switch to Expert Config Screen" button.
I have the expert screen permanently enabled
To do this if simple configuration screen loads:
On simple configuration screen, select options, then un-tick 'Use simple config screen'


Martin
Martin

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Re: Port B6 & B7 Interrupt on 16F887, not resetting

Post by Mark »

Hi Martin / Fotios,

Thanks, yes Background debug was the issue.

Thanks also for the tip on configuring the config screen, the other options on that screen are also useful.

Best Regards,
Go with the Flow.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Port B6 & B7 Interrupt on 16F887, not resetting

Post by medelec35 »

No probs,
So long as your up and running, that's what counts.

Martin
Martin

Post Reply