Run into strange problem - setting GPIO.5 as input messes with GPIO.4 - it becomes high when GPIO.5 is read, so disrupts complete code routine. I'm using TRISIO=%00100000 to make GPIO.5 as input. If I disable it as input, then other code works fine.