GithubHelp home page GithubHelp logo

Comments (12)

KevinOConnor avatar KevinOConnor commented on May 6, 2024

from klipper.

MortenGuldager avatar MortenGuldager commented on May 6, 2024

Very easy. Hacked the serial.c as you suggested, made a section pointing to uart2 and bingo, it works. Seems a bit hackish to redefine the registers, but hey..

I might try to clean up the code and make you pull request, still not quite sure I fully understand whats going on there.

And yes, level shifters are indeed needed between RPi and ramps stack.

from klipper.

KevinOConnor avatar KevinOConnor commented on May 6, 2024

from klipper.

cfelicio avatar cfelicio commented on May 6, 2024

That sounds pretty cool. Does it provide better speed or just better stability?

@MortenGuldager If you can get a tutorial on how to do this, that would be highly appreciated! :)

Thanks!

from klipper.

dragonnn avatar dragonnn commented on May 6, 2024

@MortenGuldager can you post you hacked serial.c? I am trying to do the same but I got errors:
INFO:root:Starting serial connect
WARNING:root:got {'count': 40, '#receive_time': 1203.450843292, '#name': 'identify', '#sent_time': 0.0, 'offset': 0}
WARNING:root:Timeout on serial connect

from klipper.

MortenGuldager avatar MortenGuldager commented on May 6, 2024

For those of you asking for my crude hack, here is what my git diff tells me about it:

pi@octopi014:~/klipper $ git diff src/avr/serial.c
diff --git a/src/avr/serial.c b/src/avr/serial.c
index 10b9599..432dd50 100644
--- a/src/avr/serial.c
+++ b/src/avr/serial.c
@@ -24,9 +24,44 @@ static uint8_t transmit_pos, transmit_max;
  * Serial hardware
  ****************************************************************/
 
+
+#undef UCSR0A
+#undef UCSR0B
+#undef UCSR0C
+#undef UBRR0
+#undef UDR0
+#undef UCSZ01
+#undef UCSZ00
+#undef U2X0
+#undef RXEN0
+#undef TXEN0
+#undef RXCIE0
+#undef UDRIE0
+#undef USART0_RX_vect
+#undef USART0_UDRE_vect
+
+#define UCSR0A UCSR2A
+#define UCSR0B UCSR2B
+#define UCSR0C UCSR2C
+#define UBRR0 UBRR2
+#define UDR0 UDR2
+
+#define UCSZ01 UCSZ21
+#define UCSZ00 UCSZ20
+#define U2X0 U2X2
+#define RXEN0 RXEN2
+#define TXEN0 TXEN2
+
+#define RXCIE0 RXCIE2
+#define UDRIE0 UDRIE2
+#define USART0_RX_vect USART2_RX_vect
+#define USART0_UDRE_vect USART2_UDRE_vect
+
+
 DECL_CONSTANT(SERIAL_BAUD, CONFIG_SERIAL_BAUD);
 
 // Define serial port registers on AT90USB1286
+/*
 #if !defined(UCSR0A) && defined(UCSR1A)
 #define UCSR0A UCSR1A
 #define UCSR0B UCSR1B
@@ -49,6 +84,7 @@ DECL_CONSTANT(SERIAL_BAUD, CONFIG_SERIAL_BAUD);
 #define USART0_RX_vect USART_RX_vect
 #define USART0_UDRE_vect USART_UDRE_vect
 #endif
+*/
 
 void
 serial_init(void)

I would appreciate if someone a bit more structured than me cleaned it up so it could enter the official klipper codebase.

from klipper.

dragonnn avatar dragonnn commented on May 6, 2024

Thanks it works but I find out that you can use direct UART0 from AUX0, so for my it isn't necessary.

from klipper.

mikedahlgren avatar mikedahlgren commented on May 6, 2024

Does anyone know if anyone is building the hardware required for this? Best I can tell this would be ideal but is not being produced. https://github.com/j-laird/Printrboard-Pi-Link

from klipper.

 avatar commented on May 6, 2024

@mikedahlgren checkout RAMBO Einsy 1.1 (used in prusa mk3) I think it has rpi zero link underneath.

from klipper.

KevinOConnor avatar KevinOConnor commented on May 6, 2024

I'm going to close this issue as it doesn't appear anyone is actively working on implementing it.

from klipper.

ETE-Design avatar ETE-Design commented on May 6, 2024

@KevinOConnor Will this give any performance, or just free up an USB? And what connection do I need to get fastest possible speed between Raspberry PI4 and the 3D Printer board?

from klipper.

KevinOConnor avatar KevinOConnor commented on May 6, 2024

Selecting the UART on the AVR platform was added long ago. It's not at all related to performance.

-Kevin

from klipper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.