PWM output for LEDs?
-
I have a dimmable LED driver that I want to drive from the Duet if this is possible. It requires a 5V PWM signal of ideally 200Hz (but up to 1KHz if necessary).
Is it possible to drive this from the Duet? If so, I'd really appreciate some help on how to do it.
Thanks.
Richard
-
If you have a DueX2 or DueX5 in your system, use one of the servo outputs.
If you don't then use one of the inverters in a 74HCT04 hex inverter IC to level shift one of the heater pins on the expansion connector to 5V.
-
Unfortunately I don't have either a DueX2 or DueX5 so will look at the option you suggest on the expansion connector. Thanks, David.
-
It's also possible that your lighting driver will accept a 3.3V PWM signal.
-
It looks like it might - it seems that 2.9V is the threshold from 0 to 1. What is the best way to do it if 3.3.V is suitable, please?
-
Pick one of the heater pins on the expansion connector, use a M307 command to disable the corresponding heater, then you can use M42 to control the pin. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins.
-
Fantasic, thanks, David, I'll give that a go!
-
Am I reading it all correctly? Pin 31 on the expansion board header is Heater 7 and I could use that?
-
Yes, that looks correct.
-
Thanks, David, that works perfectly.