Programming very short delays (BS2)
JohnnyB
Posts: 13
I have a project where I need to delay an incoming signal by as little as 30us. The signal frequency ranges up to 200 hz.·
For now I've written this little program:
INPUT 3
DO
IF (IN3 = 0) THEN OUT7 = 0
IF (IN3 = 1) THEN PULSOUT 7, 1000
LOOP
This replicates the signal input on pin 3 to an output on pin 7 but does not delay the signal....at least not by a means controllable by the program.....there is some delay for processing time.
I can't use the pause command because having a minimum 1ms value it's a way larger delay than I need. Is there a good way to do this? Is it even possible at the speed of a BS2.
Could I insert a nested loop with a variable that changed the loop count to achieve various delays below 1ms?
I'm new at this so be kind [noparse]:)[/noparse]
Thanks,
JohnnyB
For now I've written this little program:
INPUT 3
DO
IF (IN3 = 0) THEN OUT7 = 0
IF (IN3 = 1) THEN PULSOUT 7, 1000
LOOP
This replicates the signal input on pin 3 to an output on pin 7 but does not delay the signal....at least not by a means controllable by the program.....there is some delay for processing time.
I can't use the pause command because having a minimum 1ms value it's a way larger delay than I need. Is there a good way to do this? Is it even possible at the speed of a BS2.
Could I insert a nested loop with a variable that changed the loop count to achieve various delays below 1ms?
I'm new at this so be kind [noparse]:)[/noparse]
Thanks,
JohnnyB
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax