Instead of using IOC on PortB, why not multiplex the four inputs to either one or both CCP modules? You could use a cheap CMOS multiplexer (4051/4052) or roll your own with a few logic gates. The CCP interrupt could take care of switching the multiplexer to the correct channel and store the previous result in an appropriate variable, so it would be essentialy invisible to your main loop code. Mike > -----Original Message----- > From: Claudio Tagliola [SMTP:cptagliola@CHELLO.NL] > Sent: Wednesday, April 10, 2002 6:15 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC] Interrupt on change > > Hello all, > > > I know this issue has passed the revue a dozen times already, however, I > can't find any usefull things from the archives. > > I have two motion sensors which put out two PWM signals each. I want to > measure the length of those four PWM signals (this is the action > anglular data of the sensors). Now, with the PIC16F874 I use, I have two > options: use a capture register or use interrupt on change. Problem with > the capture is, I only have two. From the IOC ports RB7:RB4, there are > four. However, I remember a lot of words of caution when using the IOC > feature. If I have those four digital input signals only on those ports, > can I use this safely? And what were the all-too-familiar problems with > Interrupt on Change again? > > > Best Regards, > > Claudio > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu