Shop OBEX P1 Docs P2 Docs Learn Events
Translating a BS2 program to a BS1 program — Parallax Forums

Translating a BS2 program to a BS1 program

ArchiverArchiver Posts: 46,084
edited 2004-07-21 15:55 in General Discussion
Hello from Gregg C Levine
I am contemplating obtaining a TI Graphing calculator, so as to be
able to explore the principles behind how it can communicate with
things. That being stated, I have downloaded the code that the fellow
who created the site that facilitates having the calculator to talk to
a BS2, and have examined it. I have here BS1s, can the code be
translated to something that the BS1 can execute?
Gregg C Levine hansolofalcon@w...
"The Force will be with you...Always." Obi-Wan Kenobi
"Use the Force, Luke."· Obi-Wan Kenobi

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-07-20 22:33
    Probably -- but it will depend on what BS2 functions are used. If, for example, the connection is serial and above 2400 baud, then no-go. If it's synchronous serial (SHIFTIN/SHIFTOUT) you'll have to write subroutines.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Gregg C Levine [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=EptQs7gamGNWG4x9NcL3OpDkGu48K35rmBdUZLigA_QTAqSZRsYoIYQwB0Ra5WCnYNuUj_Hw9V3LFrGJ7lvKws8qJq8BEA]hansolofalcon@w...[/url
    Sent: Tuesday, July 20, 2004 4:10 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1 program


    Hello from Gregg C Levine
    I am contemplating obtaining a TI Graphing calculator, so as to be able to explore the principles behind how it can communicate with things. That being stated, I have downloaded the code that the fellow who created the site that facilitates having the calculator to talk to a BS2, and have examined it. I have here BS1s, can the code be translated to something that the BS1 can execute?
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-20 23:44
    Hello from Gregg C Levine
    Jack, yes please do send me the code, and yes I am interested.

    Jon, I'll find, and probably post here, the code, and remember to give
    credit where credit is do. And thank you for your advice.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi

    >
    Original Message
    > From: goflo@p... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=vt8Y7sf5uQ6XqWV1vmGhcjHgLxq3oSWnUYi_TEuz_1wPcOVuvHqyi0qauieD6c1dTqkYRZ05ARrQ]goflo@p...[/url
    > Sent: Tuesday, July 20, 2004 7:09 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1
    program
    >
    > I've gotten a TI83 to talk to a BS1. I can probably find
    > the code if you're interested.
    >
    > IIRC,
    >
    > TI protocol is high inactive: High = 0, Low = 1
    > TI pulls tip low for bit = 0, ring low for bit = 1
    > Rx then pulls inactive line low
    > TI then releases active line and waits for Rx to
    > release it's line
    >
    > regards, Jack
    >
    > Gregg C Levine wrote:
    >
    > > I am contemplating obtaining a TI Graphing calculator, so as to be
    > > able to explore the principles behind how it can communicate with
    > > things. That being stated, I have downloaded the code that the
    fellow
    > > who created the site that facilitates having the calculator to
    talk to
    > > a BS2, and have examined it. I have here BS1s, can the code be
    > > translated to something that the BS1 can execute?
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-21 00:08
    I've gotten a TI83 to talk to a BS1. I can probably find
    the code if you're interested.

    IIRC,

    TI protocol is high inactive: High = 0, Low = 1
    TI pulls tip low for bit = 0, ring low for bit = 1
    Rx then pulls inactive line low
    TI then releases active line and waits for Rx to
    release it's line

    regards, Jack

    Gregg C Levine wrote:

    > I am contemplating obtaining a TI Graphing calculator, so as to be
    > able to explore the principles behind how it can communicate with
    > things. That being stated, I have downloaded the code that the fellow
    > who created the site that facilitates having the calculator to talk to
    > a BS2, and have examined it. I have here BS1s, can the code be
    > translated to something that the BS1 can execute?
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-21 01:11
    Hello from Gregg C Levine
    And here is the code that I described:
    calcstamp.bs2

    serdata var byte

    again:
    '*****this will wait for serial from calculator
    serin 15,396,[noparse][[/noparse]serdata]

    '***this will send it to the pc debug screen
    debug dec serdata, cr


    '***this will send the same data plus 1 back to the calculator
    serdata=serdata + 1
    serout 15,396,[noparse][[/noparse]serdata]

    goto again

    That's the BS2 program from the page
    http://smallrobot.bizland.com/bs2ti.html
    And its courtesy Rick of Norland Research. Rick if your available,
    please contact me.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi

    >
    Original Message
    > From: Jon Williams [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=yik0Zv1yv2PPGQf4YNi-Z9VWwx4rEbuDXAnLuF6Mi5XIb54fupYmHhf2VCAjGXAtB7KOSAKzo6qZMwRqZzFK]jwilliams@p...[/url
    > Sent: Tuesday, July 20, 2004 5:34 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1
    program
    >
    > Probably -- but it will depend on what BS2 functions are used. If,
    for example, the
    > connection is serial and above 2400 baud, then no-go. If it's
    synchronous serial
    > (SHIFTIN/SHIFTOUT) you'll have to write subroutines.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Gregg C Levine [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=SW1HvOJGaM1xu4EhaqRRp4D3G1N7Lj8vEnB1pSYxaxbmPjxk62foXZOWID0yvtkUtr0EsxOQhM9ca55GefF0O6BL5y4k4g]hansolofalcon@w...[/url
    > Sent: Tuesday, July 20, 2004 4:10 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1 program
    >
    >
    > Hello from Gregg C Levine
    > I am contemplating obtaining a TI Graphing calculator, so as to be
    able to explore
    > the principles behind how it can communicate with things. That being
    stated, I have
    > downloaded the code that the fellow who created the site that
    facilitates having the
    > calculator to talk to a BS2, and have examined it. I have here BS1s,
    can the code be
    > translated to something that the BS1 can execute?
    >
    > Gregg C Levine hansolofalcon@w...
    >
    > "The Force will be with you...Always." Obi-Wan Kenobi
    > "Use the Force, Luke."· Obi-Wan Kenobi
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-21 08:03
    At 08:11 PM 7/20/04 -0400, Gregg C Levine wrote:
    >Hello from Gregg C Levine
    >And here is the code that I described:
    >calcstamp.bs2
    >
    >serdata var byte
    >
    >again:
    >'*****this will wait for serial from calculator
    >serin 15,396,[noparse][[/noparse]serdata]
    >
    >'***this will send it to the pc debug screen
    >debug dec serdata, cr
    >
    >
    >'***this will send the same data plus 1 back to the calculator
    >serdata=serdata + 1
    >serout 15,396,[noparse][[/noparse]serdata]
    >
    >goto again
    >
    >That's the BS2 program from the page
    >http://smallrobot.bizland.com/bs2ti.html
    >And its courtesy Rick of Norland Research. Rick if your available,
    >please contact me.

    Gregg -

    Try this modified program for the BS-1

    calcstamp.bs1
    '{$STAMP BS1}
    symbol serdata = b1

    again:
    '*****this will wait for serial from calculator
    serin 15,0,#serdata

    '***this will send it to the pc debug screen
    debug #serdata, cr

    '***this will send the same data plus 1 back to the calculator
    serdata=serdata + 1
    serout 15,0,#serdata

    goto again
    END

    The modifications were to add the SYMBOL statement and remove the VAR statement,
    reformat the SERIN/SEROUT commands and change the baudmode parameter, change the decimal formatter from DEC to # and add the END statement. Although this is untested, I suspect it may work.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-21 13:07
    Simple -- everything you need is right in the help file:


    ' {$STAMP BS1}
    ' {$PBASIC 1.0}

    SYMBOL serData = B2

    Main:
    SERIN 7, T2400, serData
    DEBUG serData
    serData = serData + 1
    SEROUT 7, T2400, (serData)
    GOTO Main


    My only concern would be the use of driven SEROUT mode using the same pin as SERIN. I would be inclined to put a 1K resistor in the serial line to prevent any conflicts.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: Gregg C Levine [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=nCEZLy1SBzIDQ1LCRqfWz3g8ZsdfBAY4vjuEwvarkdtzTbG3_x53rirN0y5DlrKQP3fcp0z6iXutL91OJ49PVPKjg_U]hansolofalcon@w...[/url
    Sent: Tuesday, July 20, 2004 7:11 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1 program


    Hello from Gregg C Levine
    And here is the code that I described:
    calcstamp.bs2

    serdata var byte

    again:
    '*****this will wait for serial from calculator
    serin 15,396,[noparse][[/noparse]serdata]

    '***this will send it to the pc debug screen
    debug dec serdata, cr


    '***this will send the same data plus 1 back to the calculator serdata=serdata + 1 serout 15,396,[noparse][[/noparse]serdata]

    goto again

    That's the BS2 program from the page http://smallrobot.bizland.com/bs2ti.html
    And its courtesy Rick of Norland Research. Rick if your available, please contact me.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi

    >
    Original Message
    > From: Jon Williams [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=MMi8cOy1aKleGBQKlFI34WVee3npgsJwNUxsqXYD8JHbA6xSAOTu_vURUsAsD878FfPJOHRGa3bmCJErJg]jwilliams@p...[/url
    > Sent: Tuesday, July 20, 2004 5:34 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1
    program
    >
    > Probably -- but it will depend on what BS2 functions are used. If,
    for example, the
    > connection is serial and above 2400 baud, then no-go. If it's
    synchronous serial
    > (SHIFTIN/SHIFTOUT) you'll have to write subroutines.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Gregg C Levine [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=nCEZLy1SBzIDQ1LCRqfWz3g8ZsdfBAY4vjuEwvarkdtzTbG3_x53rirN0y5DlrKQP3fcp0z6iXutL91OJ49PVPKjg_U]hansolofalcon@w...[/url
    > Sent: Tuesday, July 20, 2004 4:10 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Translating a BS2 program to a BS1 program
    >
    >
    > Hello from Gregg C Levine
    > I am contemplating obtaining a TI Graphing calculator, so as to be
    able to explore
    > the principles behind how it can communicate with things. That being
    stated, I have
    > downloaded the code that the fellow who created the site that
    facilitates having the
    > calculator to talk to a BS2, and have examined it. I have here BS1s,
    can the code be
    > translated to something that the BS1 can execute?
    >
    > Gregg C Levine hansolofalcon@w...
    >
    > "The Force will be with you...Always." Obi-Wan Kenobi
    > "Use the Force, Luke."· Obi-Wan Kenobi
  • ArchiverArchiver Posts: 46,084
    edited 2004-07-21 15:55
    Gregg C Levine wrote:

    > And here is the code that I described: ... calcstamp.bs2

    AFAIK native TI83 I/O does not support 2400 baud serial data,
    so the guy must've written such a routine for the 83 - Not much
    to stop you from doing the same; There's enough information at
    http://www.ticalc.org/ to get you started.
Sign In or Register to comment.