Shop OBEX P1 Docs P2 Docs Learn Events
Baudmode for connecting to a Romba's SCI — Parallax Forums

Baudmode for connecting to a Romba's SCI

FrohmanFrohman Posts: 10
edited 2010-07-31 03:45 in BASIC Stamp
HELP I can't figure our how to calculate the proper baudmode...

The device is an IROBOT Roomba, and I am trying to connect to it through it's SCI (Serial Command Interface).
the documentation for connecting is here: www.irobot.com/images/consumer/hacker/Roomba_SCI_Spec_Manual.pdf

The roomba I am connecting to is 57600 baud, 8-bit with no parity and I dont know if it is inverted or not... they don't say... so I am guessing it is not inverted... (because you need to make a special cable with a protoboard to control the roomba from a pc)
confused.gif

need some help here.

P.S. I am using a BS2

Comments

  • SSteveSSteve Posts: 808
    edited 2010-07-12 20:53
    According to the SERIN documentation in the Basic Stamp Command Reference, the BS2 can only go up to 50k baud. To get to 57600 you need a BS2sx or BS2p.

    Edit: The baud mode for 57600 on the BS2sx or BS2p is 23. That's int(2500000 / 57600) - 20.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our first album on the iTunes Store
    Our second album...
  • FrohmanFrohman Posts: 10
    edited 2010-07-12 20:59
    nono.gif your wrong this is not hopeless... the Roomba can be forced to switch to 19200 baudrate! smile.gif

    edit: darnit i Forgot how to set pins to low and high cause I need to do that to turn it to 19200 baudrate sad.gif

    Post Edited (Frohman) : 7/12/2010 9:13:29 PM GMT
  • SSteveSSteve Posts: 808
    edited 2010-07-12 21:18
    Sorry, I didn't look at the Roomba doc so I didn't realize it could be switched to 19200. Doesn't look like you need to set any pins high or low, just hold the power button for five seconds.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our first album on the iTunes Store
    Our second album...
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-07-12 21:42
    YAY A roomba hack! . I have done this a few times in past years . [noparse]:)[/noparse] It was one of the reasones I got HWB BS2 many years ago .
    On the DIN plug If you pull PIN 5 DD/wake low 3 times it will also do a Baud change .. Its on page 2 of the PDF .
    Peter KG6LSE

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Carpe Ducktum" "seize the tape!!"
    peterthethinker.com/tesla/Venom/Venom.html
    Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S.
    LOL
  • FrohmanFrohman Posts: 10
    edited 2010-07-12 22:45
    [noparse][[/noparse]sarcasm] shocked.gif NO WAY! shocked.gif [noparse][[/noparse]/sarcasm]

    what the heck is the proper baudmode...
    INT(1,000,000/19200)-20 = 32?
    so it's this?
    HIGH 
    SEROUT 3, 32, 128 'stop normal opperation - "start" command
    SEROUT 3, 32, 130 'put Roomba in SafeMode - "control" command
    SEROUT 3, 32, 135 'make the roomba clean and then wait for more instructions - "clean" command
    
    


    and later on...
    SEROUT 3, 32, 133 'turn roomba off
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MAGGOTS!

    Post Edited (Frohman) : 7/13/2010 2:16:25 AM GMT
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-07-13 00:28
    tie the din 5 pin to BS2 pin 2
    Rough code ..mod to your Pin liking i nomaly make 1 IN and 0 Out and 2 DD



    
    
    Gosub  intbuad
    
    YOUR   CODE  HERE
    
    'GOSUBS
    
    intbaud:'  sets    pin 2 on BS2  low  3   times 
    High 2 
    pause  300
    low  2          ' X1
    pause 250 
    high  2
    pause 300
    low  2           'X2 
    pause 250 
    high  2 
    pause 300
    low 2           'X3 
    pause 250 
    high  2 
    pause 300
    return '  returns    to  MAIN prog 
    
    
    
    


    Peter KG6LSE smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Carpe Ducktum" "seize the tape!!"
    peterthethinker.com/tesla/Venom/Venom.html
    Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S.
    LOL
  • FrohmanFrohman Posts: 10
    edited 2010-07-31 03:45
    this... is odd... I dont understand why you would use a subroutine. confused.gif Because this would be the first thing you do in your code...
    Peter KG6LSE said...


    
    
    Gosub  intbuad
    
    YOUR   CODE  HERE
    
    'GOSUBS
    
    intbaud:'  sets    pin 2 on BS2  low  3   times 
    High 2 
    pause  300
    low  2          ' X1
    pause 250 
    high  2
    pause 300
    low  2           'X2 
    pause 250 
    high  2 
    pause 300
    low 2           'X3 
    pause 250 
    high  2 
    pause 300
    return '  returns    to  MAIN prog 
    
    
    
    


    Peter KG6LSE smile.gif
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MAGGOTS!

    Post Edited (Frohman) : 7/31/2010 3:53:07 AM GMT
Sign In or Register to comment.