Controlling GPIO pins
-
Using GPIO1 on the Duex5. I can't figure out how to make the pin go low as soon as the printer turns on.
-
Thanks for the schematic, very useful. I see the GPIOs are pulled up to 5V. As described earlier, when I use them without connected to anything, they go from 0 to 5V using M42. But when connected to my load, it goes from 0 to 2.3V instead of the desired 5V.
If I remove the pull-up resistors, will this fix the problem (so it will go up to 5V)? Alternatively I can replace them with larger resistors, but thats harder.
-
Depending on how it works, maybe reducing the pull-up resistance values would work better. What do you recommend I try?
-
Reducing the values of the pullup resistors - or adding your own additional pullup resistors external to the board - will increase the output voltage to nearer 5V with your load connected. But the output will still be high when the Duet boot up, before you send the first M42 command. This is unavoidable when using pins that can be configured as as either inputs or open-drain outputs.
One solution would be to use an external gate, mosfet or BJT to invert the output from the pin.
-
Thanks for the suggestions, I will try them later.
Are there other pins that I could use that are not able to be configured as either inputs or open-drain outputs?
-
Easy enough to add my own external pullups to reduce the effective pullup resistance, thanks, I'll do that!
-
@jml:
Thanks for the suggestions, I will try them later.
Are there other pins that I could use that are not able to be configured as either inputs or open-drain outputs?
If you are not using all the heater outputs on the DueX5, you could use the associated servo outputs.
-
@dc42 The servo outputs and the fan pwm pins all seem to become active twice for a very split second during bootup. I can see that this happens because the heater LEDs on the DUEX light up for a split second, and my RGB LEDs on the fan light up for a very short period of time. Can I change this behavior in the firmware?
-
@jml How high are the servo pins bouncing to voltage-wise? That sounds more like the e0/e1 diodes draining from initial capacitance when power is connected... any chance you could check the servo pins on start with a meter or scope and report the results?
-
I will take a look with a scope when I can. By eye, the first blip makes the LEDs go on very briefly and dim. The second blip is brighter.