I use a PIC10F202 to generate a 10us pulse every 25ms (at GP0). This pulse is fed to a US-sensor (Ultrasonic). I get a pulse signal from the sensor whose width corresponds to the distance to an obstacle. (goes to GP1)
The response signal is positive logic. When the response signal is shorter than 5ms for a certain time (250ms) I set GP2, when it's longer than 5ms for a few seconds I reset GP2.
I wrote a code in Assembler that compares the response signal pulse width to a fixed time (about 5ms). This works as intended.
Now my question:
I would like to externally be able to adjust the 5ms reference from 1ms to 10ms. The only way I see is to trigger a monostable (e.g. 555) after each pulse of GP0, feed the output of the monostable to GP3 and check the state of the US-sensor (GP1) at the falling edge of GP3.
Is there another way? The 555 is already very simple but can it get simpler than that (less components)?
Thanks
The response signal is positive logic. When the response signal is shorter than 5ms for a certain time (250ms) I set GP2, when it's longer than 5ms for a few seconds I reset GP2.
I wrote a code in Assembler that compares the response signal pulse width to a fixed time (about 5ms). This works as intended.
Now my question:
I would like to externally be able to adjust the 5ms reference from 1ms to 10ms. The only way I see is to trigger a monostable (e.g. 555) after each pulse of GP0, feed the output of the monostable to GP3 and check the state of the US-sensor (GP1) at the falling edge of GP3.
Is there another way? The 555 is already very simple but can it get simpler than that (less components)?
Thanks