Shop OBEX P1 Docs P2 Docs Learn Events
SXB to Spin — Parallax Forums

SXB to Spin

mnemonicsmnemonics Posts: 23
edited 2014-01-09 18:56 in Propeller 1
I am new to spin and I am having a hard time with it. What are my options to getting a SXB code translated to spin. Can prop basic do it . I don't see a section on here for prop basic. Thanks..

Comments

  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-12-25 18:24
    As PropBASIC and SX/B have the same author, PropBASIC may be the better choice for the moment. When time permits, learn Spin as-is, without being constrained to the past. I made the switch from SX/B (I was part of that team when I worked for Parallax, and used it in a lot of EFX-TEK products after) to Spin. Spin is a little unique and it's best to accept it as is -- don't try to force it to be something you're used to.

    The good news for you is you have choices. And if C is your fancy, you can go that route, too.
  • mnemonicsmnemonics Posts: 23
    edited 2013-12-29 09:39
    Jon thank you for the reply. and yes I do know you very well . i got a membership to nuts and volts because of you and Bean wrote me some code too.I have been looking at spin and finally it starting to sink in. at least a little at a time. It's hard to throw away everything learned from SXB and start over . If i go to spin I will have to use the prop chip if I go to C i can expand to other systems but spin was made for the propeller so I think I will start there. Thanks again ..
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-12-29 13:18
    It's hard to throw away everything learned from SXB and start over.

    If I may, I think that line of thinking is flawed and can say so with some authority. Twenty years ago I started with the BASIC Stamp 1 (I already knew BASIC and was pretty good with electronic so it was easy). Then I migrated to the BS2. While working for Parallax I started using the SX and was part of the SX/B team. All three of those processors use a flavor of BASIC, but all are different from the others -- you cannot compile a BS1 or BS2 program with SX/B. Still, SX/B was a very big success, mostly because it allowed programmers to move beyond the restrictions imposed by the BS1 and BS2. Terry and Ken and I worked hard to make it the best product we could, and had Ubicom not been such a bunch of morons, the SX might still be alive today (okay, I'll stop editorializing).

    Spin is another programming language, and it will allow you to move beyond the restrictions of the SX chip by using the Propeller. If you have mastered the fundamentals of programming, making the move from SX/B to Spin will hardly cause you to break out in a sweat. I know because I've done it. We were using the SX (programmed in SX/B) in EFX-TEK products until the writing was clearly on the wall about the SX going away. We jumped onto the Propeller with a vengeance and our first commercial product was the AP-16+. It's one of our most popular products and in the last month a MAJOR amusement company (with parks across the globe) has adopted it (along with the HC-8+ that is also Propeller powered and programmed in Spin). They have already purchased nearly a 100 sets of boards for small-scale animations and have put us on notice that they will be ordering several hundred more (sets) in the New Year of new parks and attractions. Their staff knew and liked the BS2, but needed something more. The Propeller was the answer and we happened to have products that fit their needs perfectly.

    To cite a very practical example, I recently ported the SX/B code for the EZ-8 to Spin for the EZ-8+. What was really very difficult to accomplish in SX/B I was able to port in about an afternoon while sitting in a Starbucks with a prototype circuit assembled on a Propeller PDB. And I have loads of memory left for more features should customers ask. This was not the case with the EZ-8; when done I had about 20 bytes of program space left.

    Yes, Spin in devoted to the Propeller -- just as SX/B was devoted to the SX. Programming is programming. If you give five programmers, each using a different language, a flowchart they will solve the problem, and the programs will have more similarities than differences.

    Finally... you have this incredible resource in the Propeller forums. There are a lot of very smart people here that I learn from every day. If you're sincere with your questions you'll find lots of them will jump in and help.

    Forgive me if this sounded like a bit of a rant. I get a tad impatient when I see the "Woe is me, I have to learn Spin..." comments in posts. Again, programming is programming. Just do it! :)

    Happy New Year!
  • WurlitzerWurlitzer Posts: 237
    edited 2013-12-30 08:38
    JonnyMac wrote: »
    Forgive me if this sounded like a bit of a rant. I get a tad impatient when I see the "Woe is me, I have to learn Spin..." comments in posts. Again, programming is programming. Just do it! :)
    !

    Yes the programming food fight can get tiresome and the language I would have preferred never existed for the Prop but you are right Spin works well, PropBasic was a real help (if only it were VB6) and I find myself spending 99% of my time in PASM as all my requirements are high speed. In fact outside of the occasional Serial Communication Spin would only be used to launch PASM.

    Your programming tips in N&V help immensely and some of the tricks I would never have though of. Thanks for sharing.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-12-30 08:43
    Wurlitzer wrote: »
    the language I would have preferred never existed for the Prop
    Dare I ask what that language was?
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-12-30 10:06
    I'm kind of curious myself. With Spin, BASIC, C, and Forth all running very nicely, what other mainstream choice is there for embedded apps? I'm not be facetious, I'm genuinely curious.
  • WurlitzerWurlitzer Posts: 237
    edited 2013-12-30 10:25
    David Betz wrote: »
    Dare I ask what that language was?

    ==========================================
    Sure, but I don't want to start a language food fight as depending upon what is the sharpest tool you have on your tool belt that ends up being the best (for you).

    As Director of Engineering for what at one time was the worlds largest commercial printer (70+ plants world wide), I did a ton of SCADA systems and VB6.0 saved me and the many engineers and programmers who worked for me and those I collaborated with more times then I can remember.

    The prepackaged SCADA programs always left something which could only be done in another language so I spent the vast majority of time moving all my SCADA systems to VB (never let me down) and various flavors of assembly. It was quick, the IntelliSense was immensely helpful when the fat fingers typed the wrong variable name...

    Iconics, WonderWare, AB $$$$$$, etc., all worked but usually needed a program or two or more usually written in VB to make the entire system work well. Eventually I gave up patching holes in the SCADA packages using VB I just switched everything over.

    I got so used to the VB IDE I find the things missing in just about everything else annoying but that is why they call it work and not play. Seems to me there was also a MicroContoller which used VB. BasicX I believe, but the Propeller just so much more powerful, I'd program it in Vulcan if that is what it took.

    My current project involves high speed scanning of over 500 inputs and setting 1200 outputs (2 props and glue hardware involved) and reading/writing to an Access database. VB sits between the props and the database stuff.

    And at the end of the day ANY language would be good provided there was a Compiler for it.
  • WurlitzerWurlitzer Posts: 237
    edited 2013-12-30 10:34
    In addition, I found it very easy to hire VB programmers and teach them the guts of the BasicX (NetMedia) as there are virtual ton of VB programmers available.

    Anyway, SPIN, PropBasic and PASM for me. C & Forth must be some sharp tools in somebody elses tool belt and certainly not mine.
  • jazzedjazzed Posts: 11,803
    edited 2013-12-30 10:38
    Well, I really liked VB6.0 ....

    I tried getting David to make xbasic to be more like that :)
  • David BetzDavid Betz Posts: 14,516
    edited 2013-12-30 11:02
    jazzed wrote: »
    Well, I really liked VB6.0 ....

    I tried getting David to make xbasic to be more like that :)
    I guess xbasic kind of died of lack of interest once you switched its IDE over to C to make SimpleIDE. Up until then I think I was updating it at a fairly fast clip.
  • jazzedjazzed Posts: 11,803
    edited 2013-12-30 12:44
    David Betz wrote: »
    I guess xbasic kind of died of lack of interest once you switched its IDE over to C to make SimpleIDE. Up until then I think I was updating it at a fairly fast clip.

    The xbasic IDE is still there without all the C and Spin stuff. It could use a few enhancements though.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-12-30 13:25
    The xbasic IDE is still there without all the C and Spin stuff. It could use a few enhancements though.

    I know you're squeezed for time but I think the Propeller world would be a better place with xBASIC. Looking through the original thread I see that I played with it and right now I don't know why I stopped. I have customers that are very comfortable with BASIC, and having a a nice, cross-platform VB-like BASIC for the Propeller is excellent.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-12-30 14:04
    JonnyMac wrote: »
    I know you're squeezed for time but I think the Propeller world would be a better place with xBASIC. Looking through the original thread I see that I played with it and right now I don't know why I stopped. I have customers that are very comfortable with BASIC, and having a a nice, cross-platform VB-like BASIC for the Propeller is excellent.
    I only stopped working on it because I thought no one was interested. I'd be happy to resurrect it if there is some demand for that sort of language. I figured that PropBasic was likely to become the standard Basic for the Propeller.
  • WurlitzerWurlitzer Posts: 237
    edited 2013-12-30 17:29
    David Betz wrote: »
    I only stopped working on it because I thought no one was interested. I'd be happy to resurrect it if there is some demand for that sort of language. I figured that PropBasic was likely to become the standard Basic for the Propeller.
    ========================================
    I am sure anything you do would be better than I could develop.

    I had toyed with writing my own modules in VB to behave like the BasicX software but for the Prop and obviously that never happened. As a module/form in VB is a simple text file, I thought a compiler could be written without a great degree of difficulty but with so many tools available for the prop it does not make a lot of sense to reinvent the wheel with just a different number of spokes.

    Obviously for someone like me who spends 90% of their time in the VB6 IDE using it for the prop would be fantastic and again there are a virtual ton of programmers still using it.
    IMO it was one of the best things to come out of Microsoft in a long, long time but true to form they threw a wrench into it in VB.Net and subsequent versions.
  • mnemonicsmnemonics Posts: 23
    edited 2014-01-09 18:56
    Will some of the Code from SXB compile in Pbasic. I am learning spin at a snail speed and saw some demo code in Pbasic that looked like some BS2 code. I ran and complied it to spin and maybe some parts of a code that I have trouble with in spin can be done in Pbasic then finish it in spin. Some parameters have to be set up or I will get an error like I did in a BS2 code test. It looks like Pbasic works pretty good to me but I am also not writing anything super complicated.
Sign In or Register to comment.