While outside the WHILE/WEND loop the portA.6 change will not exit the WHILE/WEND.

Al.