Notifications
Clear all

XBuddy board GPIO?  

Page 3 / 5
  RSS
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

Taking a break for the night, but it looks like M42, without a pin number, allows you to write to the front RGB LEDs ("M42 S0" should turn them off, I think?)

Posted : 28/08/2023 11:08 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?
Posted by: @jseyfert3

So no inputs that you saw?

I had the thought to try to map the pins to the microcontroller pins, but poking around with any sort of voltage on the microcontroller pins on a brand new, not even tested board put me off…plus I wanted to build the printer, not test the board. If by winter nobody else has mapped them, and Prusa hasn’t released the schematic, then that would be a great winter project for the days of being trapped inside. But summer just has too many projects and things to do to be spending a lot of time reverse engineering a PCB.

Just FYI, those *could* be inputs, if you activate an internal pullup resistor, and selectively ground the pin for the input. The diode will protect the board from overvoltage, and the resistors will protect it from excessive current.

I'm trying to filter through the firmware, and figure out which port letter/number combinations are mapped to which marlin pin numbers, but it's a bit of a challenge. My C++ is rusty, and this is VERY high level, to me.

Posted : 29/08/2023 4:40 pm
pyrho // 25.wf
(@pyrho-25-wf)
Active Member
RE: XBuddy board GPIO?

Not sure if this was mentioned in this thread, the pins seem to be defined here: https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/bfb0ffc745ee6546e7efdba618d0e7c0f4c909cd/src/common/hwio_pindef.h#L435 .

Another thought, looking at the buddy board it does not seems like there's any dedicated "user usable" pins; but there are 4 unused ports I can see.

1. is for the MMU

4. is labeled ACCEL (maybe for a future accelerometer powered input shaping?)

2. is labeled "A_TEMP", can't find any references to that in the codebase

3. I can't read the PCB under the cables and I'm too lazy to

 

That's it, I don't have any solution to provide, just thought I'd add what I found out about.

 

Cheers.

Posted : 22/09/2023 6:17 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

@pyrho This post has given us the most insight into  the possible GPIO header, which you missed:

https://forum.prusa3d.com/forum/postid/665868/

The more people who ping the developers for the pinout and firmware pin numbers, the sooner we might actually get to use the GPIO, here.

Posted : 31/12/2023 3:54 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

If anyone wants to pile on to my question on github, feel free!

https://github.com/prusa3d/Prusa-Firmware-Buddy/issues/3649

Posted : 31/12/2023 5:14 pm
bkerler
(@bkerler)
Trusted Member
RE: XBuddy board GPIO?

Prusa has defined Ports that can be used for external accessories on this >>> page <<<. Extension header isn't supposed to be used but instead J29 (ACCELEROMETER), J23 (I2C), J15(A_TEMP) and J6 (MMU).

Regarding the extension header, here's what I have reversed so far (no warranty, for MK4 Board Revision 0.27 2021):

    - .. ?
    ? .. ?
  PE5 .. PE3
  PE4 .. PE2
 PA15 .. PF8
    - .. -
    + .. +
  EXPANSION 1
Posted : 07/01/2024 7:43 pm
me
 me
(@me-2)
Eminent Member
RE: XBuddy board GPIO?

sorry if this is a dumb question, but does anyone know the correct parameters for the m42 gcode command to switch the gpio pins in the J29 "accelerometer"

port?

Posted : 12/01/2024 4:54 am
Neolker
(@neolker)
Member
RE: XBuddy board GPIO?

Schematic has been released for MK4: https://www.prusa3d.com/page/open-source-at-prusa-research_236812/

Posted : 13/01/2024 7:23 pm
Fil4ment and YEAHroen liked
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

THANK YOU!

Interesting... J9 is labeled "Extension" on the schematic, but "Expansion" on the screen printing on my board, and others.

Looks like it's a bit different, compared to bkerler's reverse engineering.

  +24V .. +24V
   Gnd .. Gnd
   nAC .. PA15
   PE2 .. PE4
   PE3 .. PE6
   PE5 .. +5V
  PE12 .. +3.3V

Now, we just need those firmware pin numbers.

Posted : 13/01/2024 7:41 pm
bkerler
(@bkerler)
Trusted Member
RE:

The extension is SPI4 in fact. Fw source code says :

// SPI 4 is used for side leds, but only on specific HW revisions
 
Posted : 13/01/2024 8:03 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE:

That technically only covers PE2, PE4, PE5, & PE6, according to the schematic. The rest are still "up for grabs", I think?

Regardless, for those of us without the side LEDs, we should be able to use those pins.

Posted : 13/01/2024 8:09 pm
bkerler
(@bkerler)
Trusted Member
RE:

PE2 would be PIN 66.

Port E, Pin 2 => E=4, 2=2 =>

16*4 + 2 = 66 according to this:

#define MARLIN_PORT_E 4
#define MARLIN_PIN_NR_2 2
#define MARLIN_PORT_PIN(port, pin) ((16 * (port)) + (pin))
Posted : 13/01/2024 8:24 pm
Fil4ment liked
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE:

Ooooh. Thank you! THAT is what I was missing. Where was that?

Posted : 13/01/2024 8:29 pm
bkerler
(@bkerler)
Trusted Member
RE: XBuddy board GPIO?

"src/common/MarlinPin.h" (Global definitions)
and
"src/device/stm32f4/hal_msp.cpp" (SPI4 config and Port)

Posted : 13/01/2024 8:37 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

I marked this as "answered" because I won't be able to test this for a few months, but if any of you reading this would like to test it yourself, and post your results, it would be GREATLY appreciated!

Posted : 14/01/2024 1:38 am
me
 me
(@me-2)
Eminent Member
RE: XBuddy board GPIO?

Um, i tried printing a model with the following custom gcode (trying to switch pins pc3 and pc2) at the start of the 2nd layer

M42 P35 S0

M42 P34 S0

M300 S100 P1000

I got the following bluescreen of...    problems :

it won't let me upload the gcode here 🙁

 

Posted : 18/01/2024 4:46 am
miroslav.h4
(@miroslav-h4)
Honorable Member
RE: XBuddy board GPIO?

Just pack the gcode file into a *.zip file and the forum will accept it.

Posted : 18/01/2024 1:07 pm
me
 me
(@me-2)
Eminent Member
RE:

Thanks!

Bty, my printers firmware is version 5.1.2+13478

Here is the gcode file for anyone interested:

Part_Studio_2_0.4n_0.2mm_PETG_MK4IS_27m

 

Posted : 18/01/2024 6:02 pm
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE:

My first guess would be that you're trying to do an analog write to a pin that is earmarked for SPI communication. The only pin I'm seeing not earmarked for something is PE12. Give that one a try, just to see if you get BSOD?

Also, you uploaded a .bgcode file, not gcode, which is gonna make it... "fun" to open.

Posted : 19/01/2024 12:59 am
Fil4ment
(@fil4ment)
Trusted Member
Topic starter answered:
RE: XBuddy board GPIO?

Nevermind. Converted it to ASCII in prusaslicer's gcode viewer

Posted : 19/01/2024 1:12 am
Page 3 / 5
Share: