RB0 Interrupt on a PIC16f887

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
sptcarl
Flowcode V4 User
Posts: 36
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times

RB0 Interrupt on a PIC16f887

Post by sptcarl »

I am working on a project that reads the status of 6 inputs, performs mathematical calculations based on the number of high inputs and data stored in EEPROM, and displays the result on 3, 7 segment displays. A signal on RB0 then decreases the value by one with each rising edge pulse. This is set up as the RB0 interrupt.
I am using the internal RC clock.

All worked well, until I made a few adjustments (to remove leading zeros from the displays). When I came to re program the new code to the chip, I got the message that the device hadn't been erased, I ok'd this and the chip programmed ok.
Now when in circuit, the program stops when it gets to the RB0 INT stage.

I have moved the RB0 interrupt to various parts of my program but it still doesn't work.

I have tried erasing the chip manually prior to programming it, it still doesn't work.

Could the 2 problems be actually related?

Is it possible that my chip has developed a fault? (Unfortunately I do not have any spares to confirm this at the moment.)

Thanks in advance for any advice.
Carl.

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

Re: RB0 Interrupt on a PIC16f887

Post by medelec35 »

Hiya sptcarl
Are you using the internal oscillator and master clear enable is set for digital input ?
If so take a look at:
http://www.matrixmultimedia.com/mmforum ... 37&p=20028
Since your device is related to 16F883, it could affect you. But I can't say that is a 100% fact.
sptcarl wrote: I got the message that the device hadn't been erased
When I get that message, I always assume it means: Since target not erased when it should have been, then there is a problem with the communication between programmer and the target device.
Therefore you can assume it has not been programmed.
sptcarl wrote: Could the 2 problems be actually related?
Yes I do believe so
Martin

sptcarl
Flowcode V4 User
Posts: 36
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times

Re: RB0 Interrupt on a PIC16f887

Post by sptcarl »

Hey medelec35,
thanks for the suggestions,( and taking the time to reply) but I'm using master clear set as external. So I guess that wont apply to me? I will give it a go though just in case.
What I don't get though, is that I wasn't getting the erase message this morning when all was working ok.

I really need to get into the habit of saving each revision of my program with a new name, then I could have simply gone back to this mornings version to see if that still works!!!

medelec35 wrote:Hiya sptcarl
Are you using the internal oscillator and master clear enable is set for digital input ?
If so take a look at:
http://www.matrixmultimedia.com/mmforum ... 37&p=20028
Since your device is related to 16F883, it could affect you. But I can't say that is a 100% fact.
sptcarl wrote: I got the message that the device hadn't been erased
When I get that message, I always assume it means: Since target not erased when it should have been, then there is a problem with the communication between programmer and the target device.
Therefore you can assume it has not been programmed.
sptcarl wrote: Could the 2 problems be actually related?
Yes I do believe so

sptcarl
Flowcode V4 User
Posts: 36
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times

Re: RB0 Interrupt on a PIC16f887

Post by sptcarl »

Problem solved!

It was a faulty RB0 pin!

I was so adamant that it was due to a change I made in the program, I completely overlooked the obvious solution of writing a simple program to test the device!
I feel rather stupid now! I guess thats what 21 years of designing, making, and fault finding anusement game electronics does to you! :roll:

Post Reply