I am tring to run a chunk of code over and over as long as the portb.0 input pin is toggling from low to high. here my code i need to continuosly cycle as long as portb.0 is toggling at least 1 per 100 miliseconds, but i cant have a 100 ms pause in th cycling chunk f code below.

"while portb.0 is toggling atleast 1/100ms then"<-main idea, not actual code

for x = 1 to 10 + D '<----here
PULSOUT portc.2,50 '
next '

pause T '<----to here

"wend" <- not actual code


i need something similar to the COUNT command but doesnt pause while taking its readings

this is the same pcb ive been working on. i have a solenoid on portc.2. it has to be controlled a really strange way but it works just fine 100% good. you can think the the 3 line, FOR..NEXT statement as the equivilent of HIGH portc.2. then there is the pause command which holds portc.2 low for a specified amount of time. the solenoid is turning on and off repeatedly. i need this 4 line chunk of code to run while portb.0 is going low to high to low to high..etc. this wouldnt be so hard if the input was faster then the out put, in my mind at least.