jmgelba, Yes it could... You understand why the counter = 6 dont you?

while A <= 5 'follow status of i/p turn off fets if i/p goes away
PORTB = %00001100
A = A + 1
IF (PORTA.5 = 1) THen
PORTB = %00000111
WEND

Because if A = 5 you still increment A. Right? So when you drop out of the loop A = 6..

Dave Purola,
N8NTA