Results 1 to 10 of 10

Thread: Anyone got Sabertooth packetized mode to work?

  1. Anyone got Sabertooth packetized mode to work?

    Has anyone here managed to get packetized serial to work with an Arduino (or any other mc)?

    I just tried, and although the bauding character goes through OK, I can't get the Sabertooth to respond to commands. Simple serial seems to work Ok.

    If anyone here has ever managed to get this to work, I'd love to take a look at some scope traces of successful packets...

    I can't seem to get this to work from a PC either...

    Strange.

  2. #2
    Join Date
    Nov 2007
    Location
    Sunnyvale
    Posts
    65
    Rep Power
    47

    Re: Anyone got Sabertooth packetized mode to work?

    Yes, I've used Sabertooth packetized mode before on an Atmel SAM7 and I just followed the directions exactly as written in the documentation and got working motors. This was on the Sabertooth 2x5. Unfortunately I've dismantled that project, but here's what the code looked like:

    uart0Send(128);
    uart0Send(1);
    uart0Send(lspeed);
    uart0Send((128 + 1 + lspeed) & 0x7f);
    uart0Send(128);
    uart0Send(5);
    uart0Send(rspeed);
    uart0Send((128 + 5 + rspeed) & 0x7f);

    I called this code whenever either the left or right motor speed needed to be updated.

    - Nathan

  3. Re: Anyone got Sabertooth packetized mode to work?

    Hmmm...

    That looks a lot like what I'm doing. I read somewhere that the initialization stage can upset the Sabertooth. Maybe I have a faulty controller.

  4. Re: Anyone got Sabertooth packetized mode to work?

    I managed to get the Sabertooth running with the Roborealm software. Looking at the scope traces the output does not look the same as when I use the Arduino. The bauding character '0xAA' is very clean with roborealm, but with the Arduino in both software and hardware serial modes, it looks quite wrong.

    Does anyone know if there is a primer on TTL level serial transmission somewhere? I need to delve into this a bit deeper...

  5. Re: Anyone got Sabertooth packetized mode to work?

    Here's an update -

    This is the output from the FTDI chip when the Roborealm app sends the bauding character:

    www.stephenhobley.com/arduino/st_128_bauding_bits.gif

    With a start bit, and stop bit and 8 data bits this looks like how you would expect 0xAA (10101010) to look with the LSB coming through first.

    Now this is the Arduino, same baud rate, and just calling Serial.print(0xAA) :

    http://www.stephenhobley.com/arduino...no_bauding.gif

    What a mess!

    Does anyone have *any* idea why all this comes out when just printing a single char? The serial interface to the Arduino must work, as the PC can talk to it, but this makes no sense to me...

    Steve

  6. #6
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    178

    Re: Anyone got Sabertooth packetized mode to work?

    It's sending two bytes instead of the one.

    Errr - [edit]:

    Try Serial.print(170,BYTE); [Just checked my LCD Serial code]
    I Void Warranties�

  7. #7
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    178

    Re: Anyone got Sabertooth packetized mode to work?

    I edited, want to bump this back to new.
    I Void Warranties�

  8. #8
    Join Date
    May 2008
    Location
    TN
    Posts
    853
    Images
    99
    Rep Power
    75

    Re: Anyone got Sabertooth packetized mode to work?

    Quote Originally Posted by Adrenalynn View Post
    It's sending two bytes instead of the one.

    Errr - [edit]:

    Try Serial.print(170,BYTE); [Just checked my LCD Serial code]
    Yep that looks exactly like what is happening. This may be helpful:
    http://www.arduino.cc/en/Serial/Print

    Keep in mind that the Arduino wants to print ASCII unless you explicitly tell it otherwise. Also beware of the BIN switch. It doesn't actually print the binary bytes of a number. It prints the ASCII representation of the bytes.
    "If A is a success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut."
    -
    Einstein

    Don't be a HelpVampire

  9. #9
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    178

    Re: Anyone got Sabertooth packetized mode to work?

    Yup! I screwed-up the first time and wrote "print(170, HEX)" without thinking/checking. Something tickled my memory that I fell down there myself with the LCD driver I wrote, and I went and checked (and edited my post). Specifying "BYTE" gets it to send the byte instead of the ascii representation.
    I Void Warranties�

  10. Re: Anyone got Sabertooth packetized mode to work?

    Yep, that was it! Thanks for all the help!

    Here's a quick movie of the progress made...

    [ame="http://www.youtube.com/watch?v=Hwt_z5qBR9o"]YouTube - Making a robotic Dalek[/ame]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. "ALMower" [was: Robotic Lawn Mower]
    By revoltage in forum Robotics General Discussion
    Replies: 363
    Last Post: 07-19-2009, 08:06 AM
  2. Replies: 6
    Last Post: 01-07-2009, 08:10 AM
  3. Sabertooth 2x5 R/C issue
    By wireframewolf in forum Arbotix, Microcontrollers, Arduino
    Replies: 6
    Last Post: 10-13-2008, 04:39 AM
  4. SSC-32 and Sabertooth 2x5
    By ZeeGee in forum Arbotix, Microcontrollers, Arduino
    Replies: 6
    Last Post: 03-13-2008, 11:20 AM
  5. Kondo web page translated.
    By Droid Works in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-06-2007, 05:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •