A 12c5xx must sample multiple input pins and branch to different code for different input values as fast as possible. Testing each bit separately will be too slow as every microsecond counts. One possible solution is to choose I/O pins so that the code address bits can match the input bits. If three inputs are required they could be connected to GP3-5 and the corresponding pieces of code spaced eight bytes apart. Assuming all three inputs are active low the code is x000000000: ... ;GP(5:3)=000 x000001000: ... ;GP(5:3)=001 x000010000: ... ;GP(5:3)=010 x000011000: ... ;GP(5:3)=011 x000100000: ... ;GP(5:3)=100 x000101000: ... ;GP(5:3)=101 x000110000: ... ;GP(5:3)=110 x000111000: movf gpio,w ;GP(5:3)=111 x000111001: andwf pcl,f x000111010: ... The loop starting at x000111000 is executed if GP(5:3) inputs are all inactive high. The sampling period and branch time on input change are both 3us with a 4Mhz clock. GP0 and GP2 can be inputs or outputs, high or low. GP1 can also be input or output, but must be low during the sampling loop. To avoid the program jumping to address 0 when GP(5:3) are all low a 12c5x9 device should be used (x=1 above). I am completely new to PICs and I apologize for any coding mistakes or misunderstanding of these devices. Any comments? Tony B. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics