> > Actually I wish to monitor a change from 'low' to 'high' of > each RB4 ~ RB7. When this happen I would like to trigger some > jobs in sequence. As a preliminary study of RB change ISR, I > just output a string of character, say 'RB7 changed' to a LCD. > Then you want something a bit like this in your ISR movf PORTB,W ; which bits have changed? xorwf OLD_PORTB,F ; now inspect the bits of OLD_PORTB, ; a bit is high if it changed on portb since last time we ran ; or, f you only want to know which bits changed from 0 -> 1 ; ignoring which bits changed from 1 -> 0 ; do this as well movf PORTB,W andwf OLD_PORTB,F ; and check the bits of OLD_PORTB here: a high indicates a bit that was low before and is high now movf PORTB,W ; save this portb value for next change comparison movwf OLD_PORTB You need to maintain a copy of what *used* to be in PORTB, define OLD_PORTB as a global var. In your initialisation, you should read portb and write it to this var before you enable interupts, else your first ISR call will be junk Jon -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body