Shop OBEX P1 Docs P2 Docs Learn Events
SXB Editor & Compiler — Parallax Forums

SXB Editor & Compiler

Roy CarlsonRoy Carlson Posts: 46
edited 2007-11-15 01:04 in General Discussion
Does anyone know how to set a default directory within the editor so that when you go to OPEN a file it defaults to the SXB director where the files are stored?

I also wanted to know if there is a simple way to show on the PC Monitor the status of your pins or do we have to use the debug editor?

Last questions - what is the best resonator to use for general purposes?· If you have the SX set for 4 mhz clock as in some of the examples, can you use a 50 mhz resonator and still only have the 4 mhz speed as defined in the set up of the program?

As you can tell,·I am new and more familar with the Basic Stamp than the SX chips.· I like the idea of saving money for hobby purpose designs and am trying to learn to program the SX using SXB.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


·

Comments

  • BeanBean Posts: 8,129
    edited 2007-11-03 13:50
    Roy Carlson said...
    Does anyone know how to set a default directory within the editor so that when you go to OPEN a file it defaults to the SXB director where the files are stored?
    I think the IDE defaults to·where you last loaded a file from.

    I also wanted to know if there is a simple way to show on the PC Monitor the status of your pins or do we have to use the debug editor?
    Not that I know of...

    Last questions - what is the best resonator to use for general purposes?· If you have the SX set for 4 mhz clock as in some of the examples, can you use a 50 mhz resonator and still only have the 4 mhz speed as defined in the set up of the program?
    For general purpose I recommend the 20MHz resonator. It's fast enough to do almost anything, but does use alot of current like the 50MHz. If you have your program setup for the 4MHz and install a 50MHz, the time will be WAY off (if it even runs at all).

    As you can tell,·I am new and more familar with the Basic Stamp than the SX chips.· I like the idea of saving money for hobby purpose designs and am trying to learn to program the SX using SXB.
    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • ZootZoot Posts: 2,227
    edited 2007-11-03 14:09
    Somebody said...
    I think the IDE defaults to where you last loaded a file from.

    I've actually wondered about this too -- my experience when starting up the application is that the IDE always starts from the SX-Key folder, not from where you last opened a file. If you don't exit the app, it will remember where you were last working, but it forgets upon exit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • PJMontyPJMonty Posts: 983
    edited 2007-11-04 19:44
    Go to the Run->Configure menu and open the configuration dialog. Under the IDE options, makes sure "Restore Workspace" is selected. Whenever you open the IDE, it will re-load all the files you had open when it was last shut down. In addition, under the File menu is the "Reopen" menu which shows the last five files that were opened. Between these two, you should be able to get back to where you were quickly. As long as you have an open file that is in your SX/B directory, then that will be the default directory when you use File->open the next time.

    Thanks,
    PeterM
  • ZootZoot Posts: 2,227
    edited 2007-11-04 20:10
    COOLNESS.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Roy CarlsonRoy Carlson Posts: 46
    edited 2007-11-05 17:17
    Thanks for the information - I am sure others will benefit.

    Regarding a means to display data on the computer screen similar to Debug use in BS2 programs: Does anyone have a way to do this?

    I guess you could use the SX Sim and/or watchdog & breaks. I figure you guys are pretty smart when it comes to programming - could we have a simply method of detecting the port pinouts as High or Low and a means to display variable properties. Maybe something that could be desinged using the PLX-DAQ for Excel or Stampl Plot controls. The problem would be to get the info out the USB into the computer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    ·
  • ZootZoot Posts: 2,227
    edited 2007-11-05 17:32
    Since DEBUG on the Stamp essentially transmits serial text strings, this can be emulated pretty easily on the SX using SERIN/SEROUT in SX/B, or more compactly, the serial ISR functions published by Al Williams and applied within SX/B by Jon Williams (see the last few issues of Nuts n Volts for examples).

    The big difference is that without the luxury of the RS-232 circuitry on the Stamp, you will need to do one of two things to see the SX serial text strings on your PC:

    - build an RS-232 level shifter for Tx pin from the SX (see Stamp schematics for examples)
    or
    - run your SX serial pin to a TTL level device like .... a Stamp. E.g., without having to build any circuits, use your Stamp as the RS-232 level shifter:

    1. serial out from SX pin --> serial in to Stamp PIN
    2. SEROUT 16 or DEBUG on the Stamp --> serial port and debug window / hyperterminal on your PC

    The problem with using the Stamp is that you'll have lag time between when the SX sends serial data, when the Stamp receives it, and when it's retransmitted by the Stamp to your PC. The advantage is no parts and nothing to build (if you have a Stamp lying around).

    P.S. If you need USB there are adapters available from Parallax for serial to USB communication.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Roy CarlsonRoy Carlson Posts: 46
    edited 2007-11-05 19:53
    Thanks Zoot...

    This certainly gets the mind moving in the right direction. Now if there was an easy to read graphic of the pinouts and variables used within the SX Code. I wonder if the SX Sim could be used to pull this data and display via the computer screen. It could be a simple task if the SXSIM and/or debug screen could add a graphically representative of the SX Chips pinouts with H=Highm L=Low, NA=not used and a list of defined variables and there current states.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    ·
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-11-05 19:57
    I've attached a program (from my nearly-finished book) that gives the SX/B user several useful functions that can be used like the DEBUG statement with BASIC Stamps.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-11-06 21:13
    Roy Carlson said...
    Now if there was an easy to read graphic of the pinouts and variables used within the SX Code.
    I would like this too. However, the functionality is nearly there already when running the debugger with an SX-Key. The states of the pins are reflected in their associated register locations every time the BREAK statement is encountered. And by using the WATCH statement you can see the value of select variables in a variety of formats. So aside from a separate graphic for the chip pins most of the functionality is already there.

    - Sparks
  • Roy CarlsonRoy Carlson Posts: 46
    edited 2007-11-08 01:49
    Does anyone know why I can't open the example codes from the forum with the .sxb extensions?

    I get an error message even thought I have the SXB Compiler loaded on my desktop and if I save target I can then click and open from my drive.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    ·
  • PJMontyPJMonty Posts: 983
    edited 2007-11-08 03:25
    Roy,

    Your message is confusing and incomplete.

    First, whenever you get an error message, you need to post the exact text of the error message for folks to provide help. "I got an error" is like saying "There's something wrong with my car." Great, are we talking engine? Tires? Well, in your case are we talking "File Can't be Found"? A Windows error? What did it say exactly?

    Second, you say you have SX/B loaded on your desktop. Huh? That sentence implies you downloaded the SX/B compiler and put it on your desktop. The SX-Key IDE needs to have the SX/B compiler installed in a specific directory for it to be able to invoke. Are you using the phrase "SX/B Compiler" when you mean SX-Key IDE? The difference is night and day. The compiler just turns SX/B source code into SX assembly. It is invoked by the IDE and runs invisibly in the background. The SX-Key IDE is what you see when you run the SXKey.exe program.

    Third, how are you trying to open the files? Double clicking on them in Explorer? Using the File->Open dialog within the IDE?

    Fourth, what exactly are you referring to when you mention "Save Target" ? To the best of my knowledge, that's a menu item you get in Internet Explorer when you right click on a link. Are you trying to use Internet Explorer to load a file? I'm a bit lost here.

    Help me to help you by providing clear, accurate posts when requesting help.

    Thanks,
    PeterM
  • Roy CarlsonRoy Carlson Posts: 46
    edited 2007-11-08 16:00
    PeterM,

    Let me try and rephrase the question this way.

    I have the SX Software to compile and run SXB code installed and running on my desktop computer at home.

    While looking through the Forum messages I often find example code with the .sxb extension as an attachment to the forum post.

    When I double click on the forum link at home I get a MS Windows error message that the file type is not found.· But if I click on the link and save as a target to my hard drive I can use Windows Explorer or the SXB Compiler to open the file without errors.

    The confusion is that at my work desktop without any of the SX Compiler or IDE software installed, I can double click on the attached file name and it opens as text without any errors.

    The sample file listed above TX_Formatting.SXB (2-3 posts) is just one example of this - I can view the file by clicking on it at work but at my home desktop I get the Windows XP error message.

    Roy

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    ·
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-11-08 16:17
    I think the issue you're having is with your browser -- it happens to me, too. Explorer seems to work fine with Parallax forum attachments, but Firefox (which I prefer) doesn't so I have to download anything I want to look at to my local drive. Firefox is especially problematic if there is spaces in the name, hence I always use underscores (as in TX_Formatting.SXB).
  • T'SaavikT'Saavik Posts: 60
    edited 2007-11-15 01:04
    firefox:

    tools->options->content->manage (under file_types)
    change the option to whatever you want (open in wordpad/SXB, whatever).

    The first time you downloaded a .sxb file you choose the wrong option [noparse]:D[/noparse]
Sign In or Register to comment.