I have trouble with the pin stimulus file in MPSIM. I want to change the PORTB status at a certain time in my program. I have something like this: MOVF PORTB,0 ; place portB-status in W XORLW k0 ; button 0? BTFSC STATUS,Z GOTO KNAPP0 ; Yes, CALL SUBRUTINE ...No, continue... How do I make the stimulus to happen just before the MOVF PORTB,0 instruction executes? I know it has something to do with the STEP number in the stimulus file. What is step? Is it number of steps (with for example F7 in MPLAB) until the PC reaches the specific code? Another question when I'm writing: I write a program that scans a 0-9 keyboard. When 0 is pressed the PORTA:0 gets low and when you press the 1 the PORTA:0 goes high. The strange phenomen is that if you press the 1 the PORTA:0 goes high, but just for ca 2 seconds and then it goes back low to be low. I have tried to take away the code for the 0 button, thats clear the PORTA:0 bit but newertheless the PORTA:0 goes low. I can't find anything in the code that sets the PORTA:0 low after this change but still it goes low. Every interrupt is cleared, I think. /Niclas Olsson