1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Problem with MPLAB

Discussion in 'Microcontrollers' started by ljcox, Jun 26, 2017.

  1. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    I've successfully written many PIC programmes but this my first time with the 16F684.

    I have MPLAB 8.92.

    I cannot clear INTCON, 0. This instruction does not anything.
    bcf INTCON, 0 ;RBIF

    If I use this
    clrf INTCON the INTCON value changes from 0x09 to 0x01. I have tried various tricks but to no avail.

    I even uninstalled MPLAB & then re-installed it.

    This instruction does clear INTCON, 1

    bcf INTCON, 1 ;INTF

    I feel that there is a software problem with MPLAB as I can't see any reason why it does not clear INTCON, 0

    Any assistance will be appreciated.
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,304
    Likes:
    914
    Location:
    Rochdale UK
    It is in the datasheet.. The RBIF can only be cleared when PORTB has been read.
    Code (asm):

    ISR
       btfsc   INTCON.0
       goto   notpb
       movfw   PORTB
       bcf    INTCON.0
    blah blah
     
     
  3. ljcox

    ljcox Well-Known Member

    Joined:
    Dec 25, 2003
    Messages:
    3,226
    Likes:
    28
    Location:
    Melbourne Australia
    Thanks Ian,
    Yes I recall that now but had forgotten.
    Len
     

Share This Page