Minimum Time needed for Input on Board of Education?
cljenna
Posts: 10
I am using a Board of Education and have an input signal which goes low for 1/500 of a second; this is supposed to trigger a loop in my code, but it doesn't. Does anyone know the minimum amount of time a signal needs to be low for the Board of Education to recognize it as low?
Comments
·· How long it takes to execute each instruction within your loop will determine that for the most part.· Obviously there is a minimum possible time, and the following link will help you calculate that.· If you are unable to meet that timing and catch the pulse you will need to use a 555 timer as a pulse stretcher.· You can find circuits for this using Google.· I hope this helps.
http://www.emesystems.com/BS2speed.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
DO : LOOP WHILE in0
' stuff
will always catch a low level of duration of 700 microseconds. What code are you using to detect the level?
There are other tricks.
DO : RCTIME 0,1,wx : LOOP UNTIL wx
Can respond to a very brief pulse, microseconds long, but there is a fintie probablility (<1%) that the pulse will be missed (If it happens at the wrong place in the DO loop.).
You don't need a 555 necessarily to stretch a pulse. A capacitor or RC on the input in parallel with the switch can be sufficient to stretch the pulse.
Are you using a BS2? I ask because the BS2p has additional instructions available in the POLLWAIT group.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
camera·· PIN 0
shutter· PIN 15
INPUT camera
OUTPUT shutter
pause1· CON 33
pause2· CON 33
pause3· CON 33
pause4· CON 33
remainder CON 33
Main:
· IF (camera=0) THEN
··· PAUSE pause1
··· HIGH shutter
··· PAUSE pause2
··· LOW shutter
··· PAUSE pause3
··· HIGH shutter
··· PAUSE pause4
··· LOW shutter
··· PAUSE remainder
· ELSE
··· LOW shutter
· ENDIF
··· GOTO Main
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
http://members.aol.com/rjb0343/Z3801A/Accurate1PPS.htm
http://www.wiseguysynth.com/larry/users/mark1/trigger.htm
http://absolutesilence.blogspot.com/2006/06/555-timers.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
This loop spends most % of its time looking at the pin, and when the pin goes low, it returns a non-zero value and drops out of the loop. Like I mentioned in an earlier post, there is a small probablility (<1%) that the loop will miss a given pulse, but you indicated that that might be acceptable. You could alternatively use PULSIN instead of RCTIME.
An alternative is the following pulse stretcher, simpler than a 555:
The code must reset the stretcher as follows:
The purpose of the 1k resistor is to limit current into the camera switch. The diode is necessary if the level from the camera is 5 volts to zero volts, but the diode is not necessary if the switch is N.O. or a transistor open drain or open collector. The 100pf capacitor will hold its charge and reliably hold the pin high for several seconds, so long as there are no stray current paths.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
·· I should've known you'd have something simpler in your bag of tricks!· Thanks for the simpler (hopefully) solution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (PJ Allen) : 6/28/2006 7:36:24 PM GMT
The 7404 is a hex inverter, as is the 7405/7406 (open-collector version) and the 7414 is a Schmitt Trigger inverter.· Many gates such as the 7400 can be an inverter as well by tying the 2 inputs together.· Instant inverter.· Of course these are all for TTL level logic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (PJ Allen) : 6/28/2006 7:47:24 PM GMT
However, in a later post you say, "The camera signal is basically cycling high for 1/30 of a second, and somewhere in that cycle, it drops low for 1/500 of a second. We just want to be able to read that voltage drop.". I hadn't read that carefully. So, does that mean that the signal from the camera is normally low, and then at some point it goes high (for 1/30 second), and sometime during the 1/30 of a second, it blips low again for 1/500 second? And you have to sync your laser sequence with that 1/500 second blip? Is that a correct reading of what is going on.
That is a different situation, and harder to deal with, as there are a couple of independent events that have to be detected. When you say "somewhere in that cycle", can you pin it down more? For example, 1/30 second is 33 milliseconds. Within that frame of 33 milliseconds could you say for sure that the 1/500 second blip would not occur within the first 3 milliseconds?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com