Shop OBEX P1 Docs P2 Docs Learn Events
starting to work with the SX's....what's better to program in ASM or SX/B?? — Parallax Forums

starting to work with the SX's....what's better to program in ASM or SX/B??

steve_bsteve_b Posts: 1,563
edited 2006-02-14 07:39 in General Discussion
Hi guys,

I've had my SX lite kit a couple weeks and just cracked it this week to play.
I'm getting a wee bit confused as to how I 'should' be trying to learn this thing!

Almost all the examples I download are in SRC files (assembler).· The neumonics don't quite make sense to me yet, but it's like learning linux...they'll eventually make sense!
The help file seems to all be in SX/B with PBasic-like instructions.· These seems like the obviously way to transition to the SX.· Similar instructions that should make it somewhat transparent to switch over.
Am I right with this?

The SX's are no doubt, more for the advanced user....but I do love taking babysteps to get in to the groove and, maybe my patience isn't what it used to be but, I haven't been able to find as much of the basic 'handholding' docs that the stamps have.
Does someone have a surefire resource to get me going (a 2x4 maybe? haha).

My initial plan is to strip out the time from a GPS 'RMC stream....but I notice there's no WAIT modifier for the SERIN (SX/B?) command.
Do I then just build an array and scan through it?

Thanks guys

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·

Steve

"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-08 16:24
    SX/B·will get you building things right away, but I personally think that ASM is really the way to go.

    In the long run, it empowers you to do much more.
    Fortunately, the SX-Parallax Chips only come in two formats. So it is a great place to start out with Assembly.

    If you become frustrated, you can always fall back to SX/B and even mix bits of Assembly code within.

    Guenther wrote a very good tutorial. In fact, I keep finding all the Parallax manuals are full of clear, concise examples. Other companies documentation can tend to ramble on.· {It seems that everything Microchip PIC writes is no less than 100 pages long.}

    I feel·Parallax really understands how to write to beginners as an audience, whereas others believe that engineers love a mess of sophistication.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/8/2006 4:27:03 PM GMT
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-02-08 16:37
    "My initial plan is to strip out the time from a GPS 'RMC stream....", since this is your stated goal, I probably would go with ASM. DO NOT waste your time with SX/B, you can always go back at some point and do some small stuff with SX/B. This is strickly my opinion, I am sure that their will be other opinions.

    ASM has long learning curve, so you may want to take that into consideration. Also, their are quite a few asm experts here that could help sort things out when you get in bind. You may want to sit down and make a more specific list of what you want to accomplish, and then see what ASM or SX/B has to offer in terms of getting your job done.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-08 16:38
    The idea behind SX/B is to help you make the move -- you can start in BASIC, get your project working, then migrate to ASM. For a simple (and FREE!) compiler, SX/B is pretty capable -- we actually use it in some of our EFX products (RC-4, AP-8, DC-16).

    For the ASM stuff we do have a manual, and our friend Guenther Daubach has written a wonderful book that you'll want in your library if you're serious about going down the ASM path.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • les_blueles_blue Posts: 15
    edited 2006-02-08 16:41
    Hi Steve,
    I'm also fairly new to the SX chips, about a month into it. I found that the SX/B, and SXSim are great for getting up and running. Some tasks are well suited to SX/B coding. It is when you start to push the chip towards it's limits, custom VP's, precision timing, etc. that the asm is sometimes required. - I'm sure some of the coders on this board can push the limits in SX/B, but I found it easier to take total control with the asm.

    In any case, the debugging is at the asm level, so you will need to learn the opcodes, unless You write Bug Free code!

    I would also suggest Gunther's book, "Programming the SX Microcontroller" It is worth ever penny, and will walk you through asm code from simple to advanced. The sections on software UART VP, and FIFO would drop right into you project.

    My 10 cents worth.
    Larry
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-08 16:44
    To your point, Larry, I used SX/B to create a MIDI receiver and used ASM to create a UART VP (I didn't actually create it, I pulled this from examples that have been around a long time).·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • les_blueles_blue Posts: 15
    edited 2006-02-08 16:53
    Very cool Jon, I downloaded this to play with when work is done.
  • steve_bsteve_b Posts: 1,563
    edited 2006-02-08 16:56
    Thanks guys....
    I think I got a little confused because I had downloaded some of Ubicom's doc's which, as Kramer pointed out, are somewhat over-worded...at least for me!! haha

    My first task for the SX is this:
    I have a couple of precip gauges (hot plate evap-type sensors) that time stamp their data.
    Their clocks drift a little and for precise comparisons to radar data and other precip data, they need to have their fairly accurate.
    You set the time on the 2 separate instruments with a proprietary Windows program via a serial port.
    This works fine, but since you have to program them one at a time, the time is off.
    So, if I could have an SX read the time from a GPS and then set the time on both instruments in 'near' dual realtime....I'd be a champ! haha

    Well that's the goal.
    A stamp would probably work fine....but it seemed like a good opportunity to learn the SX!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • PJMontyPJMonty Posts: 983
    edited 2006-02-13 05:18
    Steve,

    I find it's always a good idea to use a specific project to learn a new platform, as long as the task isn't too huge. I think you've chosen a good project for a first time SX learning experience. I always find that having a real task to accomplish forces me to learn so much more than just dreaming up some "toy" project to test things out with.
      Thanks, PeterM
  • steve_bsteve_b Posts: 1,563
    edited 2006-02-13 18:57
    Hi PJ,

    I found myself trying to skip steps and go straight to what I needed to know to do what I wanted....but that left out so many pieces that I couldn't get it done....so I've gone back and am going through the manual front/back and also ordered Guenthars book...

    Hope this gets me closer to be successful!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • BebopALotBebopALot Posts: 79
    edited 2006-02-13 21:16
    Hi Steve_b. I give Assembly two thumbs up. I guess I am kind of an outliar on the curve but SX/B confused the heck out of me. I found that I always wanted to know what the SX/B was doing and naturally assembly told me, so I dropped SX/B in the first week of learning these chips and have been doing great since. I also found that in addition to Geunther's book reading the SX-28 datasheet (or the SX-48) had very nice concise summaries and even example code to get you going. The SXSim tool in invaluable to me. Also Assembly for the SX Microcontroller is a great reference. And certainly posting code here has been very helpful. Other forum members are stellar at this stuff.

    Don't forget all this stuff is in the documentation section on the site as well as SAMPLE CODE TEMPLATES. Loadem up and watch the command execution through SXSim and you will learn loads in no time at all about Assembly.

    Good luck,

    BBAL
  • StarManStarMan Posts: 306
    edited 2006-02-13 23:20
    BBAL,

    Do you have a link to the asm code samples?· All I seem to find are the SX/B samples.

    Chris I.
  • BeanBean Posts: 8,129
    edited 2006-02-13 23:25
    Chris,
    I think he might mean to look at the code generated by the SX/B examples. And even if he didn't, that is a great way to learn assembly.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    "Ability may get you to the top, but it takes character to keep you there."
    ·
  • StarManStarMan Posts: 306
    edited 2006-02-14 07:39
    OK.· Thanks for clarifying.

    Chris I.
Sign In or Register to comment.