#127 The INT in pic12F675 (12F629) dosen't work

closed-fixed
Robert Pearce
None
5
2011-04-07
2011-04-06
Anonymous
No

The edge trigger interrupt is not working for pic12F675.
-The setting logic of the edge is inverse and it shouldn't be.
-The triggering is looking for another bit in portG implementation.
-The deriving of portG from portB is flawed.
Here is the patch that should fix all of the above.

Discussion

  • Robert Pearce
    Robert Pearce
    2011-04-06

    Hmm.... yes. The patch looks good and applies OK to latest SVN. I notice the OPTION register bit polarity issue is also present on the 16F88x but not on 16F631.
    It's also a little ironic that the only supported device that actually has a port G does not use the PortG class, and all the PortG instances are called GPIO, PORTA or PORTB. Suboptimal naming there.

     
  • Robert Pearce
    Robert Pearce
    2011-04-06

    So I applied the patch and went looking for a regression test, and find that it's done on a 16F84, which as far as I can tell pays no heed whatever to the INTEDG bit. And the test itself suffers from making no effort whatever to check which edge actually caused the interrupt. This was sounding familiar - see bug #3120903

     
  • Robert Pearce
    Robert Pearce
    2011-04-07

    OK, the 16F84 does handle the INTEDG bit right by inheriting from Pic14Bit rather than _14bit_processor. Possibly there's a case for some refactoring, or at least renaming, but that's not urgent.
    I've extended the p12f675 regression test to check the INTEDG behaviour, but I've found another bug in the process. Will deal with that separately.

     


Anonymous


Cancel   Add attachments