Hello all, I have a problem that I thought Indirect Addressing would solve, but I don't think it will. Please read this over and throw any ideas you may have my way. I have three pins (say RB0, RB1 and RB2) that all receive the exact same format of serial data at different times. I want to use one section of code to receive data on any one pin at a time. Since I have to use BTFSx instructions to sample the pin, how can I make the code change which pin its reading? I can already determine which pin I need to be reading at any given time, but I just don't see how to transfer that information in a usable way. I have had it working up till now by copying the code three times and changing the literal in the BTFSx instruction, but now I am starting to run low on code space and want to shrink the amount of code. If there is some other way to read the pins (not usint BTFSx), then I am open to that. The data stream is very slow compared to the processor clock so I have lots of cycles to do things if need be. Any ideas? TIA, Shawn -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads