At 04:39 PM 5/18/01 -0400, Bob Ammerman wrote: >I have seen Microchip documentation that indicates that the MOVWF >instruction is _not_ read-modify-write and thus should not mess up the >interrupt-on-change. > >I do not remember where I saw that, unfortunately. You are right - movfw is not R-M-W. Unfortunately, the basic architecture of the PIC is (apparently) that a read of the port still occurs. Movwf simply ignores that read. The main point is that the read DOES occur. That is what messes up int on port change. I recently had occasion to verify this behavior on a 12c671 (with internal RC osc). The application was replacing a 74c945 counter which has become obsolete. The problem was that the reset and clock pulses were not only quite narrow (< 2 us) but initially appeared to be non-synchronous. Two separate interrupt inputs would have made this a simple job. Output was shift registers to a piece of LCD glass. I could not make the thing work when I tried to use int on port change - I kept missing interrupts if I was in the process of shifting data out to the LCD. I tried and tried . . . I did have a happy ending though, by finding a time period where the clock pulses into the counter did not matter and by using that time period to send my LCD data to the shift registers. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 17 years of Engineering Innovation (1984 - 2001) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.