Driving two tools from the same PWM pin

I’ve done some searching through the forum but I can’t find a solid answer on this issue. I’m switching over my Marlin-based RepRap controller over to Smoothieware (through an Azteeg X5 v1.1) and I’d like to integrate my small engraving laser diode (J-Tech Photonics) using Smoothie’s awesome laser module. However, to my knowledge, the old version of the Azteeg X5 only has three hardware PWM pins, which precludes the ability to simultaneously connect two heaters (hotend + bed), a print fan and a laser diode.

Unless I’m wrong about the number of PWM outputs, is there a way for two different PWM outputs to share the same pin? Assuming that I’m manually switching the tools for each type of job (i.e. disconnecting the fan from 2.4 and replacing it with the laser during engraving jobs), and that my G-Code generators are producing the correct outputs depending on the job (i.e. “S0” appended to the end of G1 commands when 3D printing), is there any way use a common pin for both tools? Or would I have to reupload the configuration file every time I need to switch?

Thanks in advance for any advice!

P.S. I know that a 3D printer gantry isn’t ideal for precision laser operations, but this is more of an experiment than anything else :slight_smile:

Imported from wikidot

Hey.

Heaters do “software PWM”, which can be done on any pin. Only laser requires a “hardware PWM”-capable pin.

Cheers.

That’s great! Just to clarify: I could use any digital pin to control a heater (through a separate MOSFET, connected outside the board), and then use the unoccupied PWM heater pin for the laser, right? (I’m still a bit green when it comes to microcontrollers, so I have to check before frying my board :P)

Thanks again Arthur, you’re the best!

Just use the mosfets on-board for heating things, and use a non-mosfet but pwm-capable pin to control the laser ( like P1.23 )

See http://smoothieware.org/pinout