Shop OBEX P1 Docs P2 Docs Learn Events
A couple of questions on Open Spin, and Fonts. — Parallax Forums

A couple of questions on Open Spin, and Fonts.

davidsaundersdavidsaunders Posts: 1,559
edited 2015-03-30 18:15 in Propeller 1
Ok I have been away from programming for the Prop for a while, and thus away from these forums. This is do to the fact that when I switched to the Raspberry Pi for my desktop computers, there was no software available to assemble PASM, or load the propeller.

Now that OpenSpin is available there is a good option. I do have few questions. These have likely been covered before, so sorry about that.

How do you load the final object to the Propeller, when using OpenSpin as a compiler?

Are there any syntax diferences from the Propeller Tool that I should be aware of (it has been long enough that only the Propeller Tool, and BST were good for combined Spin and PASM at the time I switched)?

Is there an easy way to use the RPi version of SimpleIDE with SPIN+PASM? Every time I try to save a spin file from there it says can not find 'simple project'. Why it needs a preexisting SPIN project to save a new one I do not know.

And all of this is running on a Raspberry Pi Model B under Raspbian.

Heater helped point me to SimpleIDE and OpenSpin over on the Raspberry Pi forums. So thank you Heater.

Comments

  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-29 17:10
    And I forgot to ask above:
    Also where to get the Propeller font for Linux, and how to install it for use in a text editor.
  • Mike GreenMike Green Posts: 23,101
    edited 2015-03-29 17:17
    SimpleIDE uses a .side file to store some information about the program / project and, as you've noticed, requires this. If I just have a .spin file from somewhere else, I just create a new Spin project with the same name which gets me a folder / directory with that name containing a .side file and a minimal .spin file. If you replace that .spin file with the real one, you're all set.

    I believe there's an RPi version of PropellerIDE which is a Spin / PASM compiler that works much like the Propeller Tool without a .side file.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-29 17:41
    Mike Green wrote: »
    SimpleIDE uses a .side file to store some information about the program / project and, as you've noticed, requires this. If I just have a .spin file from somewhere else, I just create a new Spin project with the same name which gets me a folder / directory with that name containing a .side file and a minimal .spin file. If you replace that .spin file with the real one, you're all set.

    I believe there's an RPi version of PropellerIDE which is a Spin / PASM compiler that works much like the Propeller Tool without a .side file.
    Thank you.
    Though I already tried that, when attempting to create a new project, even if the .spin file already exists it says something like missing simple side project. So I have yet to figure out how to successfully create a SPIN/PASM project in simpleIDE. It will create a C or C++ project with no trouble at all, though not a SPIN project (and yes I make sure to select SPIN as the language).

    PropellerIDE will not run on Raspbian with out adding qt5, I have PropellerIDE installed on my RPi, and I have no intention of adding qt5-dev and all of its dependencies to get it to work.

    I can always use a different text editor and use the command line tools. Hence the question about OpenSpin syntax and what tool to use to load the Propeller using a standard FTDI USB serial interface (like the Prop Plug or the on board FTDI on the Propeller Proto Board USB).

    I am still learning the command line on OpenSpin (this is the first day I have had it).

    Though what command line tool is installed with SimpleIDE for loading the Prop after compiling with OpenSpin?
  • Heater.Heater. Posts: 21,230
    edited 2015-03-29 17:51
    If you have SimpleIDE installed all the Propeller tools should be in /opt/parallax/bin. You can run the propeller loader without any arguments and it will print out some useful help:
    $ /opt/parallax/bin/propeller-load 
    usage: propeller-load
             [ -b <type> ]     select target board (default is 'default:default')
             [ -p <port> ]     serial port (default is to auto-detect the port)
             [ -P ]            list serial ports with Propeller chips
             [ -Q ]            list available serial ports
             [ -I <path> ]     add a directory to the include path
             [ -D var=value ]  define a board configuration variable
             [ -e ]            write the program into EEPROM
             [ -r ]            run the program after loading
             [ -g ]            set up the program for debugging after loading
             [ -s ]            write a spin .binary file for use with the Propeller Tool
             [ -x ]            write a .pex binary file for use with the SD loader or SD cache
             [ -l ]            write a program to the sd card and use the SD loader
             [ -z ]            write a program to the sd card and use the SD cache
             [ -f ]            write a file to the SD card
             [ -t ]            enter terminal mode after running the program
             [ -t<baud> ]      enter terminal mode with a different baud rate
             [ -T ]            enter pst terminal mode after running the program
             [ -T<baud> ]      enter pst terminal mode with a different baud rate
             [ -q ]            quit on the exit sequence (0xff, 0x00, status)
             [ -v ]            verbose output
             [ -S ]            slow down the loader by adding 5 microseconds delay
             [ -S<n> ]         slow down the loader by adding <n> microseconds delay
             [ -? ]            display a usage message and exit
             <name>            elf or spin binary file to load
    
    Target board type can be either a single identifier like 'propboe' in which case the subtype
    defaults to 'default' or it can be of the form <type>:<subtype> like 'c3:ram'.
    
    Variables that can be set with -D are:
      clkfreq clkmode baudrate reset rxpin txpin tvpin
      cache-driver cache-size cache-param1 cache-param2
      sd-driver sdspi-do sdspi-clk sdspi-di sdspi-cs
      sdspi-clr sdspi-inc sdspi-start sdspi-width spdspi-addr
      sdspi-config1 sdspi-config2 eeprom-first
    
    Value expressions for -D can include:
      rcfast rcslow xinput xtal1 xtal2 xtal3 pll1x pll2x pll4x pll8x pll16x k m mhz true false
      an integer or two operands with a binary operator + - * / % & | or unary + or -
      all operators have the same precedence
    
    The -b option defaults to the value of the environment variable PROPELLER_LOAD_BOARD.
    The -p option defaults to the value of the environment variable PROPELLER_LOAD_PORT
    if it is set. If not the port will be auto-detected.
    
    The 'sd loader' loads AUTORUN.PEX from an SD card into external memory.
    It requires a board with either external RAM or ROM.
    
    The 'sd cache' arranges to run AUTORUN.PEX directly from the SD card.
    It can be used on any board with an SD card slot.
    
    Most of those options you can ignore when using Spin. -p, -e should be enough I think.
  • Heater.Heater. Posts: 21,230
    edited 2015-03-29 17:53
    OpenSpin will compile anything that the Propeller Tool would. The OpenSpin compiler is a reverse engineer of the Prop Tool compiler's source code.

    I think I heard that OpenSpin recently got some preprocessor support "#define" etc like BST.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-29 18:04
    @Heater:
    Thank you very much. Now I guess I will have to make a symlink in the /usr/bin directory to allow for execution with out the path to the executable.

    Thank you for that.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-29 18:06
    Heater. wrote: »
    OpenSpin will compile anything that the Propeller Tool would. The OpenSpin compiler is a reverse engineer of the Prop Tool compiler's source code.

    I think I heard that OpenSpin recently got some preprocessor support "#define" etc like BST.
    Ok thank you. I did not realize that the source code for the Prop Tool had ever been released, I thought Chip had said that he did not see use in that do to it being mostly in assembly. I guess I must have remembered incorrectly.

    I am glad to know that there is a good open source Spin and PASM compiler that is sure to be 100% compatible with the Prop Tool.
  • Heater.Heater. Posts: 21,230
    edited 2015-03-29 18:11
    The source to the original Prop Tool compiler was never open sourced. Roy Eltham was given it to derive OpenSpin from. Which is open sourced.

    I don't normally set sym links. Rather just add /opt/parallax/bin to your PATH. Then all the programs in there are available.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-29 18:12
    That only leaves the question of the Propeller Font for Linux and how to install.

    So where can I find the font, and how do I install it into my Raspbian system?
  • Heater.Heater. Posts: 21,230
    edited 2015-03-30 04:26
    Make life simple for yourself. Install Qt5 and PropellerIDE, I'm betting it has the font in there somewhere.

    Else a site:parallax.com google search will probably find it.

    Personally I find other fonts less ugly on my machines.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-30 04:36
    Heater. wrote: »
    The source to the original Prop Tool compiler was never open sourced. Roy Eltham was given it to derive OpenSpin from. Which is open sourced.
    Ah OK, I see.
    I don't normally set sym links. Rather just add /opt/parallax/bin to your PATH. Then all the programs in there are available.
    I can understand that.

    Though when it comes to longer commands I do set symlinks, because it saves typing and fits more on the 80 column screen. Like I made that symlink named proploader, and openspin is symlinked to ospinc.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-30 04:40
    Heater. wrote: »
    Make life simple for yourself. Install Qt5 and PropellerIDE, I'm betting it has the font in there somewhere.

    Else a site:parallax.com google search will probably find it.
    Ok will do a search. Thank you.
    Personally I find other fonts less ugly on my machines.
    Yes it is a rather ugly font, though it is useful for writing SPIN that will use the built in font in the Propeller (almost all of my Prop projects use a NTSC display to output information). As another complete font would take 2KB of hub RAM using the built in font makes since, and the schematic drawing characters help a lot.
  • Heater.Heater. Posts: 21,230
    edited 2015-03-30 05:26
    Oh yeah, forgot to say, I have a real downer on embedding schematics into source code like that.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-03-30 10:59
    http://www.linfo.org/alias.html

    You can put these into your logon script, and can move it from machine to machine easily.

    Symlinks into your path won't always work properly due to things changing / updating. In the case of something like gcc, you may also find you need a lot of links for the other programs, and or a path to insure it can see data it needs to.

    Path additions can go into your logon script too. If you use more than one user account, adding them somewhere else may make sense.

    Between those two, you can largely ignore the work done behind the scenes. This makes adding new software and dependencies much easier as the OS and maintainer will preserve the basics, to which you then add on for your personal preferences / needs.

    Depending on how you are getting to your terminal, you might want more than 80 columns!

    http://elinux.org/RPi_Defining_Default_Terminal_Size

    Get a nice, clear, 10 point monospace font, widen up that terminal, whittle down your commands to little nubs with aliases, and you may find it a much improved, lower hassle experience.:)
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-03-30 18:10
    potatohead wrote: »
    http://www.linfo.org/alias.html

    You can put these into your logon script, and can move it from machine to machine easily.

    Symlinks into your path won't always work properly due to things changing / updating. In the case of something like gcc, you may also find you need a lot of links for the other programs, and or a path to insure it can see data it needs to.

    Path additions can go into your logon script too. If you use more than one user account, adding them somewhere else may make sense.

    Between those two, you can largely ignore the work done behind the scenes. This makes adding new software and dependencies much easier as the OS and maintainer will preserve the basics, to which you then add on for your personal preferences / needs.

    Depending on how you are getting to your terminal, you might want more than 80 columns!

    http://elinux.org/RPi_Defining_Default_Terminal_Size

    Get a nice, clear, 10 point monospace font, widen up that terminal, whittle down your commands to little nubs with aliases, and you may find it a much improved, lower hassle experience.:)
    I do not like Linux, and if I did not need it I would not use it. I liked Linux as it was in the mid 1990's, not as it is now.

    If I could port everything to RISC OS with out issue I would, though much of it has so many dependencies that it is impractical.

    And if I use a Unix like system (like Linux, or BSD), I do not rely on a known shell, not all shells are compatible, thus breaking compatibility of scripts (including the login script, that some Unixons do not even support).

    I do thank you for your input though. Thank you.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-03-30 18:15
    No worries. It's good for passers by all the same.
Sign In or Register to comment.