Shop OBEX P1 Docs P2 Docs Learn Events
Questions on the Propeller PC compiler, the on chip interpeter, and the encodin - Page 2 — Parallax Forums

Questions on the Propeller PC compiler, the on chip interpeter, and the encodin

2»

Comments

  • mparkmpark Posts: 1,305
    edited 2009-10-14 04:49
    A .spn file is just a .spin file with a different extension. Saving from a PC onto SD card should work, but keep in mind that Sphinx only understands short filenames (max. 8 characters, a dot, and three characters).

    About the error, you'll have to be a little more specific. What error message did you see?
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 15:36
    I've gotten error -1 when I forget to put .spn at the end of a file, but I got (I think) error -156 or -157 when trying to compile tv_wtext. It gave a reason that involved the variable "err" that exists in the tv_wtext object, but I cannot remember the exact words.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • mparkmpark Posts: 1,305
    edited 2009-10-14 17:12
    Well, the exact error message would help. Have you been able to compile anything with Sphinx? I assume you compiled dir and del and the other utilities.

    As a little exercise, try this: launch your editor from Sphinx (using the run command), write a simple Spin program and save it to the SD card, exit back to Sphinx (reset the Propeller), compile, and run.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 19:04
    This is the error

    Underminded comment
    ***,*** ( 'EOL' )

    I will try your exercise, however my programming computer dosn't read SD cards, the downstairs one does. So I am constantly running back and forth with my flash drive and my memory card... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • mparkmpark Posts: 1,305
    edited 2009-10-14 20:15
    I thought you had an editor that runs on the Propeller. The exercise I suggested requires only a Propeller system, no PC.

    As for the error message, I hope it actually read "unterminated comment", meaning a } or }} is missing somewhere.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 21:25
    Yes, that is what the error actully said. smile.gif

    Say, does Sphinx program other propellers or just itself? what does the RUN command do? Does it program another propeller with the program? If so, how do you connect the other?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • AribaAriba Posts: 2,690
    edited 2009-10-14 22:00
    Sphinx produces a binary on the SD card, compatible to a binary produced by every Spin compiler. So you can send this binary to another propeller with Chips PropellerLoader.spin (either into the RAM or the EEPROM).
    The normal use is that you start this binary on the same propeller that has compiled it. So Sphinx includes no command to program another propeller. But the command set of the shell is easy expandable. All the commands like DIR COPY ... are single applications, you just need to program another one called LOAD or so. Then you can type LOAD <filename> in the Sphinx shell and the binary <filename> is sent to the other propeller.
    For this LOAD program you need to change Chips code so, that the binary is not included in the DAT section, but read from SD card. For an easy Sphinx interface look at ECHO.SPN.

    Andy
  • mparkmpark Posts: 1,305
    edited 2009-10-14 22:17
    Sphinx is basically two things: a compiler and a command shell.

    As a compiler, it reads a .spn (Spin source) file off the SD card, compiles it, and writes a .bin (binary) file to the SD card. (This is a highly simplified description.)

    As a command shell, it allows you to run a .bin or .eep (eeprom) file stored on the SD card by name.

    When Sphinx is running, it uses several cogs to perform SD card I/O, video output, and keyboard input. If you run a program by entering its name at the prompt, Sphinx will leave those working cogs running. This allows the program you are running to use the Sphinx I/O drivers (kind of like an operating system) if it wants to, but it has to be specially written to do so.

    Most Spin programs expect to run on a freshly-booted Propeller, with all cogs idle except cog 0. For those programs, you'll use the RUN <filename> command. This will halt all the Sphinx cogs. To the newly-loaded program it will feel like the Propeller has just come out of reset.

    Did you follow the installation instructions? They were intended to give you some familiarity with how Sphinx works.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 23:16
    Yes I did. However, the RUN command did not work for me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • mparkmpark Posts: 1,305
    edited 2009-10-14 23:36
    Again, you'll have to be more precise. "Did not work for me" does not really tell me anything. What exactly happened when you tried it?
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-15 00:22
    I mean that Sphinx rebooted and the test program did not load. The screen went blank and I had to hard reset it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • mparkmpark Posts: 1,305
    edited 2009-10-15 07:12
    Perhaps the problem was in the test program, not the run command. What was the test program? Were the clock settings and pin assignments correct for your system? Did you try running it from PropTool?
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-15 11:43
    It was the "hello1" program that you told me to run in your startup guide. I havn't been able to get it or any other program to run like that. Oh, also, if instead of saving a .spn file in notepad I simply change .spin to .spn, it doesn't work. It declares "Undefined Character" even though there is no unicode and when you edit it it will place each character on a different line.

    What????

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


  • mparkmpark Posts: 1,305
    edited 2009-10-15 15:26
    Let's take one step at a time and get hello1 working first! I wonder if Sphinx's file system bug is manifesting itself. Please examine hello1.spn and verify that the clock speed and video pin are correct, then recompile and run.

    Also, do a "dir hello1.*" and see if there are any duplicate filenames.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-15 19:14
    Found the problem! The program was set to the Hydra's pins! Well, I found that one earlyer, now I have been working on switching out your modifyed TV_Text for tv_wtext and that will allow me to do block highlighting. I am editing it with itself. smile.gif I have also discovered that if you are doing this far from a computer you might want to have a backup copy of the editor on the SD. If you make a codeing mistake, you wouldn't be able to fix it!!! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·


Sign In or Register to comment.