external delay reference PIC10F202

Thread Starter

praondevou

Joined Jul 9, 2011
2,942
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
 

Markd77

Joined Sep 7, 2009
2,806
If you upgraded to a PIC10F222 you could put a potentiometer on an analog input to adjust the time.
There is also some code sample that lets you use a digital pin to measure a resistance by how fast it charges a capacitor, however code space is pretty low on PIC10s. I'll see if I can find it if you want.
 

Thread Starter

praondevou

Joined Jul 9, 2011
2,942
Nice idea, that means it needs to be schmitt trigger input right? Would be nice if you find more details about that method.

I want to use what I have at hand, and right now that's the 202.
 
Top