Use two MCU in Bridge Mode

Hello, I’m working in a CORE XY Idex printer which main goal is to use a mechanism that I can automatic or manually switch the tools, like Direct Drive Hot End, Bowden Hot End, Fast Flow Hot End, Laser Engraving and so on.

The idea is pretty much like this:

[Klipper Host] ← USB → [ 24V usb-c injector] ← USB → [Head 0/1 - ATMega ] ← Magnet Contact → [ Cartridge - ATMega]

1 - Connection between Klipper Host and Head will be made by USB-C cable that supports 140W (28v x 5A)
2 - Head will use a ATMega MCU with ADXL accelerometer. This chip will connect direct throu USB to Klipper Host
3 - Cartridge will use a ATMega (or other) chip to provide other resources according to the type of cartridge in use like, temperature sensors, PWM, etc…

This solution will provide a simple connection between Klipper Host and Headers while add a ADXL accelerometer for each Header.
Swap Cartridges can be very easily and Head can bypass or bridge the Klipper Host to this MCU while identify it and autoconfigure for use it.
Ex: if I plug a Direct Drive Hi Flow Cartridge, Klipper can automatic detect by quering the Cartridge and auto configure for use it.

I was thinking in implement only ADXL commands in the Head MCU and a serial bridge to the Cartridge MCU.

Do you think it should work?

thanks,

If you want to introduce Bridge only because of ADXL - then that is not wise, better to eliminate it and connect ADXL to Cartridge and keep single MCU.

Another option is to use CanBus which can be shared by multiple MCUs.

1 Like

Thanks for the suggestion approach but I want to add some points here:

First solution would require four additional connections between Head and Cartridge to allow SPI communication between MCU and ADXL sensor.

Second solution would require one CAN transceiver for each MCU while maintain the target 4 wire connection.

As far as I know Klipper currently supports CAN on stm32, SAME5x, and rp2040 chips, so there is no support on ATMega MCU.

Yes, points are valid.

But if you think about real actual usage of ADXL345 you should understand that it will be very rare.
So rare that it’s fine not to have permanent connection with it.
I would just use some USB based ADXL module permanently attached to Head and when I need it - then I would connect it manually with independent USB cable.

I see much bigger issue with MCU disconnection - It’s dead end, currently you can’t do that in runtime - so forget about switching hot end in runtime with this approach.

1 Like

I completely agree with you, perhaps the best solution for ADXL is actually a separate PCB that we connect when necessary, since it is a solution that already exists.
Now I was not aware that I could not connect a new MCU or disconnect it during printing (Hot Plug). It would be great if Klipper supported something like this!

Hello!

For electrical connection (and USB-C) I did exactly what you want to do :slight_smile:

However it’s not Hot-swappable. You can Change toolheads between prints if you desire :slightly_smiling_face:

  • cad435

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.