Rambo's onboard serial pins

The RAMBo board is finally here, and here's a place to talk about it!
Post Reply
User avatar
Kitecraft
Printmaster!
Posts: 80
Joined: Wed Oct 29, 2014 8:57 pm

Rambo's onboard serial pins

Post by Kitecraft »

Hello
I'm trying to find documentation on using the extra serial pins on the Rambo.
I'm hoping they can be used to query for things like temps and when the print is complete and maybe a few other things.

Anyone know if this exists and where I might find it?


Thanks
T.
User avatar
Eaglezsoar
ULTIMATE 3D JEDI
Posts: 7185
Joined: Sun Apr 01, 2012 5:26 pm

Re: Rambo's onboard serial pins

Post by Eaglezsoar »

Kitecraft wrote:Hello
I'm trying to find documentation on using the extra serial pins on the Rambo.
I'm hoping they can be used to query for things like temps and when the print is complete and maybe a few other things.

Anyone know if this exists and where I might find it?


Thanks
T.
Here are a couple of links that may be of some use to you, if not I am sorry to waste your time.

http://reprap.org/wiki/Rambo_development" onclick="window.open(this.href);return false;

http://reprapelectro.com/wp-content/upl ... Manual.pdf" onclick="window.open(this.href);return false;
User avatar
Kitecraft
Printmaster!
Posts: 80
Joined: Wed Oct 29, 2014 8:57 pm

Re: Rambo's onboard serial pins

Post by Kitecraft »

What I'm looking for are things like: Is there a handshake when connecting to USART1 and what is the protocol used?
The 'repetier communication protocol.txt' (from the firmware source) is useful, but I could really use a bit more.

Thanks
User avatar
Captain Starfish
Printmaster!
Posts: 962
Joined: Tue Dec 10, 2013 5:24 am

Re: Rambo's onboard serial pins

Post by Captain Starfish »

Ignore the comms protocol document - it only describes what flies over the USB and USART0 between the host and the RAMBo.

USART 1 is, as far as I can see, unused - just broken out to the serial expansion header.

Which means you can do whatever the heck you want with it. Fortunately, because the Repetier firmware is an Arduino build, you get the Serial1 object for free. So you don't have to stuff the USART1 µP registers and set up your buffer management yourself. Rather, you can initialise Serial1 with a baudrate in your source. Then just use its print, write, read etc methods to do your comms and its event handler hook to be able to deal with unsolicited inbound stuff (ie make it a 'server').

Be careful if you intend hooking up to your computer, it's an easy one to forget but the line levels are only 3.3V. You might get away with TTL on the other end, might not (I can't remember whether the Megas are 5V tolerant, if not, then you're looking at a chip latchup and self destructed RAMBo). You definitely won't get away with the ±12V for RS-232 though, without jamming a MAX232 in between the RAMBo and the host.

It's probably worth creating a new Arduino 2560 project that just does a bit of serial comms and programming that onto the RAMBo to test first, then when it's all working go back and thread it through the Repetier source to where you need it. Better yet, drop twenty bucks on a baby arduino board and play with that to get it all sussed first.

Hope this helps.
User avatar
Kitecraft
Printmaster!
Posts: 80
Joined: Wed Oct 29, 2014 8:57 pm

Re: Rambo's onboard serial pins

Post by Kitecraft »

Thank you for the clarification and confirmation. That's what I was starting to figure out.
I have an idea about adding an Arduino Pro Mini 3.3v and an RN-XV WiFi module to allow me to run a REST server that can then be used to serve up information about the current print job. :D I also want to put some 7-Segment displays into one of the top vertical supports to make for a LARGE data display that can be seen across the room (and down the hallway)
And, I already happen to have quite a few different Arduino's laying around already :ugeek: I've just never had to hack an Arduino to attach another Ardunio before. Fun stuff!

Cheers,
User avatar
Captain Starfish
Printmaster!
Posts: 962
Joined: Tue Dec 10, 2013 5:24 am

Re: Rambo's onboard serial pins

Post by Captain Starfish »

Cool.

Running USART to USART between two arduinos doesn't need any level conversion although a couple of protection diodes wouldn't hurt.

For the REST perspective, unless you're really keen on rolling your own for some reason, I'd be just throwing down $50 for a Raspberry Pi and wifi USB dongle to run Octoprint and plug into the USB port on the RAMBo. LEDs etc off an arduino with the serial port, sure - but a lot less mucking around with gear straight off the shelf for the server.
User avatar
Kitecraft
Printmaster!
Posts: 80
Joined: Wed Oct 29, 2014 8:57 pm

Re: Rambo's onboard serial pins

Post by Kitecraft »

I actually already have a REST server written for Arduino/RN-XV :ugeek:
I'm a bit of a geek.

This runs of the same hardware I want to stick into the Rostock.
[youtube]http://www.youtube.com/watch?v=x_ZFOE7_yPI[/youtube]

[youtube]http://www.youtube.com/watch?v=CMfWpAdHSf8[/youtube]
User avatar
Captain Starfish
Printmaster!
Posts: 962
Joined: Tue Dec 10, 2013 5:24 am

Re: Rambo's onboard serial pins

Post by Captain Starfish »

Hah - that's cool as hell.

I could use something like that in our dev team for when someone checks in code that breaks the CI server :D

Project I'm working on at the moment uses the PIC18F97J60 which has onboard 10/100 PHY/MAC and a free Microchip TCP/IP stack to sit on it. And it's a mongrel of a thing. Crap compiler, crap IDE, crap documentation, crap code. It's put me off embedded ethernet forever, I think - from here on in I'm much more likely to slam an ethernet serial converter (Moxa, Axis etc) in the box for one-offs or look at the Pi coz, well, ain't nobody got time for that.

I should take the time to see if there's a tidy stack that sits on the Atmels at some point. Or give up on baby micros and start looking at ARM cores.
cfishy
Noob
Posts: 2
Joined: Sat Jun 06, 2015 8:24 am

Re: Rambo's onboard serial pins

Post by cfishy »

supdate: I think Serial1 *might* be working with this mega serial test sketch, although the behavior is still odd..It can send data just fine, but receiving data isn't working. (Serial1 read data shows up in Serial main read, same for Serial2, etc.) sketch here: https://www.arduino.cc/en/Tutorial/MultiSerialMega" onclick="window.open(this.href);return false;

Again, the same sketch works just fine with my Arduino Due. Seems like these ports don't really behave like a mega. anyone care to run this sketch and let me know if you get it working?


-----------------------------------------------------------------------------------
Has anyone found any solution to this topic?

I've been trying all sorts of test sketches and couldn't find any connection to those onboard pins - except I found the default Serial (RX0, TX0) are the pins second to the left. I am using a FTDI 232R reader.

I tried the same sketches on Arduiono Due (I don't have another Mega) and all the serial ports are sending data successfully with Serial1, Serial2, Serial3. But the same sketch doesn't work for the Rambo serial pins, no matter which pair I tried.

Here's Rambo schematic: http://reprap.org/wiki/File:Rambo1-1-schematic.png" onclick="window.open(this.href);return false;
Here's pin assignment documentation: http://reprap.org/wiki/Rambo_development" onclick="window.open(this.href);return false;
The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).

I'm not very good at reading schematics, but looking at Rambo's Serial Extension on the schematics, I figure Serial, Serial1, Serial2, Serial3 all seems to be straight forward to onboard Serial pins. Am I right? In my tests, only Serial (RX0, TX0) works.

My sketches are pretty simple, just writing numbers to all four Serial ports. In fact, I even tried a software serial on pin 12, 13 and I couldn't get any data on any of the onboard serial ports, either.

Any help would be appreciated. The purpose here is to send some monitoring data to alternative displays.

Code: Select all


//Software Serial doesn't work
//#include <SoftwareSerial.h>
//SoftwareSerial softSerial(12, 13); 

void setup(){
  Serial.begin(9600);
  Serial1.begin(9600);           // set up Serial library at 9600 bps
  Serial2.begin(9600);           // set up Serial library at 9600 bps
  Serial3.begin(9600);           // set up Serial library at 9600 bps
//  softSerial.begin(9600);
//  softSerial.println("soft serial started at 12,13 RX2, TX2");
}

void loop() {
  int output = 300;
  Serial.println("start");
  Serial1.println(500);  // I tried strings here doesn't work either
  delay(500);
  Serial2.println(500);
  delay(500);
  Serial3.println(500);
  delay(500);
  
//    softSerial.println(330);
//    softSerial.println("found RX2 TX2"); 

  Serial.println("end");
}

Post Reply

Return to “RAMBo”