How SetPulse works?

I am not sure I understand this statement. If you are driving a digital to analog converter(DAC) then you need a digital signal (i2c, spi?) not an analog signal that varies in voltage(not power) from 0-3.3V. Is it really a analog to digital converter (adc) that is connected to the laser diode? Is it driven by PWM?

I have been monitoring this thread and the more I read the more I get confused. The requirements seems to be constantly changing.

As a .NET architect, the OP should be able to clearing define the requirements and interfaces. If he/she does not understand the electronics and interfaces involved, then local help should be obtained to assist in the requirements definition.

Once the forum members get a set of clear requirements then we can assist in defining what is required to support the the project.

Could be just me, but I think that beginning electronics hobbyists shouldn’t be turned loose on 30w lasers…

@ godefroi: indeed, this could be a deadly (or blindy as you want) combination!

Waaaaay back earlier I explained that PWM changes the “apparent” voltage at the output, and I think what you are proposing is simply to change the apparent voltage via PWM. If so, that is easy, as many people have shown you, but without more detail we can’t be sure what we’re helping you with will work.

Guys…thank you for your concerns. I am not doing the electronics part of the project. I am just writing the code. I am however interested in how it is done and hence the questions…i guess I got how it is done. Will keep you guys posted on the progress. Thanks to all for your help.

If you run your PWM waveform (0 & 3.3V levels) into a long RC filter you will get a smoothed “voltage” that can be varied from approx 0 to approx 3.3V. However, the downside is the long filter responds rather slowly, so a fast adjustment is awkward. In that case generate your voltages with a DAC & forget all about PWM…then you can get a fast response.

Laser diodes can not tolerate much overdrive…they will quickly be damaged if pushed beyond their limits. So your circuit should have some means to prevent overshoot/overdrive. Always use the proper safety precautions when using any laser diode!!

Just a heads up… I was studying the new PWM class in 4.2 last night. The syntax changes quite a bit. Primarily, the SetPulse() goes away. So, in case your code stops working in a few weeks this might save you some time.