Access MINI GPIO via G-code
I was wondering if there is any information out there regarding the use of the set GPIO pin command (M42) on the Prusa MINI.
I have been using it to great success on the Mk3 to remote trigger cameras for timelapse photography and would really like to get the same system working on the MINI.
Taking a look at the layout of the Buddy control board I can see that there are some pins in the white expansion header (J23) are pinned out to PortE-0 and PortB-5 on the STM32 microcontroller. (and there is also the PortE-6 pin that's in the ESP header). I was wondering if you can access any of these pins via the GPIO commands in the G-Code processor (Marlin, I'm assuming).
I've had a quick search through the buddy firmware repo and I found the gpio.h header which seems to give logical numbers to each of physical port/pin combos. So I was thinking that these numbers might be the ones I can use as the pin number in the M42 command, something like:
M42 P64 S1 (Set pin 64 (mapped to PE0 in gpio.h) to high)
However when I run a command like this the printer crashes, and displays a error screen (picture attached)
Has anyone had any success with something like this? Am I going about it in the right way or am I missing something fundamental about the MINI's firmware?
Thanks in advance!
The source code You referred is old, the whole gpio have been rewritten so currently there is any association among pin and number.
You could try a previous firmware such as 4.2 which still has the previous code