laser TTL
marcmcpherson
Posts: 2
my new laser Module has TTL input that needs a square wave with a frequency from 0 to 20000 hertz. Can this be done using freq out at the servo pins and if the answer is yes what would the freq out parameters be 0 to ? for the 20000 hertz.
Comments
Are you using a Basic Stamp?
I'm pretty sure the above just means the fastest you should turn it off and on is 20,000 times a second. You should be able to just set the pin high or low to turn the laser on or off. You don't have to keep sending it pulses.
Does this TTL line power the laser? If so, it might not be safe to power the laser from an I/O pin. Depending one how much current the laser uses, you might need to use a transistor or relay to turn the laser on and off.
The Stamp's PWM doesn't behave as one would initially suspect. The PWM is very high (I don't recall how high) and one has pretty limited options on what one can do with it. I'm not sure, but I think there was also something kind of strange about the way freq out command worked. Hopefully someone more knowledgeable about the Stamp will add detail.
My guess is the Stamp isn't going to be very useful in sending a constant pulse train to the laser. You might need to add some sort of 555 circuit. I'm just spouting stuff I've read here on the forum. I don't have much experience with this sort of stuff with the Stamp.
Do you have any experience with other microcontrollers? I think just about any other microcontroller would be able to send a constant pulse train to the laser.
I'm a Propeller fan myself but I've recently started using some of the many inexpensive mini Arduino clones from ebay. These mini Arduino boards make useful slave processors to other microcontrollers.
How about 500 Hz, 50%?
(You can do that with HIGH/LOW and PAUSE in a LOOP)
http://www.pololu.com/blog/17/servo-control-interface-in-detail