Shop OBEX P1 Docs P2 Docs Learn Events
SX-key IDE basics — Parallax Forums

SX-key IDE basics

RsadeikaRsadeika Posts: 3,837
edited 2005-11-29 22:39 in General Discussion
Maybe the documentation is to subtle for me. In the docs it states the main difference between Program and Run, is that Run generates a clock signal. My perceived problem:
I have my handy-dandy LED on/off SX/B program. When I use Run the program runs as expected. When I use Program, the program does not run. Is Prorgam to be used, and only functions,·in stand-alone configuration, with a tech board, in this case,·the SX-key is removed.

Thanks

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-29 15:12
    Yes, program is used when you simply want to program a chip for stand-alone application. For example, we use SX chips on the EFX products and they already have resonators in place. The resonator will tolerate the programming cycle so we use Program to dump the code into the SX. After it's verified, we cycle power on the board and we're good to go.

    Use Run during development when you don't have a resonator/clock source connected but you need an accurate clock (as required by serial comms, etc.).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-11-29 15:30
    You used "... cycle power", is that because the way the program is written. On my test program, one time when I plugged·in the power, the program ran as soon as it got power, another time I had to hit the reset button, after the power was plugged in.

    Now, for the SXxx proto boards, it has a 0,1,2 switch (off/on), can I expect the program to run imediately, after the switch selection (ultimately I will leave the switch on either the 1 or 2 selection)·, or do I have to hit the reset all the time. I am looking for an imediate program execution after the power source is provided.

    Thanks
  • pjvpjv Posts: 1,903
    edited 2005-11-29 19:44
    Rsadeika;

    The differences are as follows:

    PROGRAM does just that; it puts your assembled hex code into the chip, and then waits for a next command.

    RUN also programs the chip as in PROGRAM above, but when that is done, the SX-Key supplies a clock to the chip at the speed set in the software with the FREQ directive, and the software starts operating at the point specified by the RESET directive in your code. The clock speed supplied by the SX-Key can subsequently be altered with the CLOCK command in the pull-down.

    DEBUG is the same as PROGRAM, but adds a little (137 bytes as I recall) debug code to the end of YOUR code to incorporate the debug fucntionality. After loading your code plus the debug code, the device waits for debug commands, but when told to proceed, it does so with the clock supplied by the SX-Key, again at a speed set by the FREQ directive of your software.

    DEBUG (reenter) allows you to restart the debug process without re-programming the your software into the chip.

    Hope this explanation is what you need.

    Cheers from Maui, Hawaii,

    Peter (pjv)
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-11-29 22:02
    Peter,

    Thanks, we are getting close. I can see how it would be applied in asm, the RESET directive that is, but is it really applicable in SX/B. I would think that when the SX/B gets compiled that stuff would be taken care of by the compiler.

    I think it is finally starting to sink in.
  • BeanBean Posts: 8,129
    edited 2005-11-29 22:22
    The RESET directive is generated by the SX/B "PROGRAM label" directive.

    If you use the template in the help file, you will save alot of agravation.

    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

    Those that would give up freedom for security will have neither.
    ·
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-11-29 22:39
    Thanks Bean,

    I am starting to think that for beginners like myself, maybe a comparison chart, of some general stuff,·in the FAQ,·would be applicable. For example, RESET in assembly is Program Start in SX/B. I am sure that after awhile it will become obvious, but in the beggining it could be usefull, unless it is·already available, in a quick glance format.
Sign In or Register to comment.