Page 1 of 1

Port B6 & B7 Interrupt on 16F887, not resetting

Posted: Sun Aug 14, 2011 8:45 pm
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.

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

Posted: Sun Aug 14, 2011 10:15 pm
by medelec35
Hi Mark,

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

Martin

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

Posted: Sun Aug 14, 2011 10:40 pm
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

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

Posted: Sun Aug 14, 2011 10:51 pm
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

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

Posted: Mon Aug 15, 2011 6:36 pm
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,

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

Posted: Mon Aug 15, 2011 11:24 pm
by medelec35
No probs,
So long as your up and running, that's what counts.

Martin