Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Powered Multi language development system, is this possible, and.... — Parallax Forums

Propeller Powered Multi language development system, is this possible, and....

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-01-05 00:23 in Propeller 1
what is the easiest route to take.

So necessity is the mother of invention, they say, and that is definitely the case with this idea. Im always back and forth between two houses, so im not around my PC all the time, and when I take my development tools with me, I ALWAYS forget a cable or batteries or something. This idea is definitely inspired by OBC's PMIC, the C3, and the Hydra.

Basically I want a propeller with TV out, PS/2 KB/Mouse, and sound to use to plug in to any old TV and write code on. Ive actually had a really hard time sitting down and learning spin due to not being home, and limited screen real estate when I am, so a stand alone development system is exactly what I need.

Im not sure what the best way to go about the hardware is, either a single propeller chip, or two propeller systems, one used for the terminal the other is the target development chip (This could be a dual prop board, maybe two quick starts connected etc). With a single prop I figure one could just install the editor in obex use it to write your code. then put it on an SDCard and reboot the system from the file on SD. This causes some issues though, mainly pin sharing! If I need all 38 pins for a project it would be no good to have the hardware im developing share the same pins as sound or video....

The better way may be to install the set of tools to get this done on an eeprom connected to a prop with terminal functionality i.e video/input etc, then have tat propeller save the code to SD and program the second propeller chip or eeprom. This would be super cool basically you plug in your keyboard and TV then you connect whatever your working on to the I/O pins of prop #2 and you can test your code/work without ever leaving the programming screen like a real PC. This also allows room to upgrade the chip running the programming environment with ram and other goodies. Does this sound like the more feasible idea?

What im unsure about is getting code compiled and if it is even possible is some circumstances. If one were to write SPIN and/or PASM then save the code, propeller one could easily open that code and use the programming/uart protocall to send it to the second propeller correct? Spin is an interpreted launguage so there is no compiling or anything like that right, the prop just knows what to do with the code when the chip is programmed? How about PASM? And the biggee here is would there be any way to compile and program propgcc code on a propeller?? Id really like to be able to use C, but it seems to me maybe this isnt trivial, the GCC compiler would have to be ported to the propeller right? Im hoping maybe theres an easier way thn that.

Comments

  • Mike GMike G Posts: 2,702
    edited 2013-01-04 12:26
    What about a laptop?
  • MagIO2MagIO2 Posts: 2,243
    edited 2013-01-04 13:37
    The Propeller Tool is not that resource hungry! I used it on a small netbook for years. I always have a quickstart in an altoids tin with a small USB cable that rolls up itself packed together with this netbook.

    If you really want a self-containing development platform, then search for SPINX. It is or contains a compiler which runs on a Propeller. Don't remember which hardware is needed to run it.

    You're wrong when thinking that SPIN does not have to be compiled. The SPIN-interpreter actually does not interpret the plain sources, it interprets something very similar to java bytecode. So, the compiler is reading the SPIN sourcecode and compiles it to SPIN bytecode which is then interpreted.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-04 13:39
    1) Raspberry Pi with the SimpleIDE version that Heater has ported to it. (or just PropGCC and use your favorite Linux editor)
    2) used (or new) Netbook

    Anything less will be unable to do what you want or will be disappointing to use.

    Or try Tacyon or PropForth where you can develop with just a serial connection but you will still want a place to store your source and go web browsing. So we're back to 1 and 2 above.
  • Dave HeinDave Hein Posts: 6,347
    edited 2013-01-04 14:00
    Mike G wrote: »
    What about a laptop?
    Like Mike G said, what about a laptop? You can put all the development tools you need on a laptop. Another solution is to have a computer at each location, and just carry your source files around on a USB drive.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-01-04 14:24
    Here's one that runs in basic

    http://propellerpowered.com/shop/?page_id=234

    The same thing is also possible in forth (if you want to code in forth and assembler), but the new version of propforth has not brought this forward yet.

    I don't recall a spin implementation of a spin compiler yet
  • jazzedjazzed Posts: 11,803
    edited 2013-01-04 14:38
    As mindrobots implied, a good way to go is with Rasberry PI and Propeller with PropellerGCC ... one of those firsts that are conveniently forgotten.
    And the biggee here is would there be any way to compile and program propgcc code on a propeller?? Id really like to be able to use C, but it seems to me maybe this isnt trivial, the GCC compiler would have to be ported to the propeller right? Im hoping maybe theres an easier way thn that.

    There is no way to use PropellerGCC on the Propeller itself to compile code.

    You could try using David Betz's ebasic language which runs on Propeller and has a built-in interpreter with SDCARD support. It requires some external memory like 128KB EEPROM or Flash though. Martin's Propeller-DNA board or OBC's board would work with single bit flash.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-04 14:48
    Here's a link for SPHINX. It includes a primitive but mostly usable editor, the Spin compiler / assembler, a linker, and some utilities. I've run it on a variety of boards and there's a version that runs on the C3 board with its "different" SPI selection scheme. I've played with a combination of Parallax's PS/2 keyboard, a 7" TV monitor, and the C3 board (with a battery pack). It wouldn't replace my laptop, but it's usable for doing small things.

    Here's a FemtoBasic that runs on the C3 using SPHINX I/O.

    C3 SPHINX is here in the Apps folder / Mike_Green subfolder.
  • Heater.Heater. Posts: 21,230
    edited 2013-01-04 15:30
    rwgast_logicdesign,
    If one were to write SPIN and/or PASM then save the code, propeller one could easily open that code and use the programming/uart protocall to send it to the second propeller correct?
    No. The Propeller contains a bytecode interpreter in ROM that loads and executes bytecodes. You need to compile Spin to bytecodes with the Propeller Tool. Of course Spin also contains PASM code which the Prop Tool assembles to raw Prop instructions for execution in COGs directly. This is all somewhat like compiling Java to byte codes on your PC that are then executed by the Java run time system.
    Spin is an interpreted launguage so there is no compiling or anything like that right,
    No, See above.
    And the biggee here is would there be any way to compile and program propgcc code on a propeller??
    That is clearly impossible. The GCC compiler is huge.

    Frankly, I'm a aghast that you have been around the Propeller so long and can still ask these questions.

    On the positive side, Chip hmself has expressed a wish to see a Propeller system support it's own software development environment. Perhaps such self-hosting will come about for the Prop II.

    Also I'm sure the Forth guys will pop up and tell you that you only need to install Forth on your prop system and you can develop code in Forth directly on that.

    In the mean time, using SimpleIDE on the tiny Rasperry PI board may be what you are looking for.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-04 16:38
    [FONT=arial, sans-serif]I had definitely considered sphinx for the software side of this. It is probably the direction i will go along with a driver to program the second propeller. The set up im envisioning is basically a retro computer. You have a prompt to manage files and configure things, then you have an Editor like Qbasic or boardland turbo whatever. Basically just an ms edit clone with options to run your code and program an eeprom plugged in to a 25 inch tube tv, this is no more unusable than any micro from the 80s. I don't need any more than file management and an editor which can compile code and push it to another prop via the standard serial protocall. I will definately read through the sphinx stuff Ive browsed over it before and had a few concerns but I think it is probably the best choice here.

    If it cant do c, that sucks but its not a deal breaker. I think I may have phrased my C question the wrong way... I know that the z80 emulator has a C compiler that works, I was not talking about porting a full blown version of Prop GCC to the prop, I guess what I really was wondering is if there would be a way to get a tiny ISO c compiler working that could access the props registers and write fairly progcc compatible code. I guess my thinking is if it can be done in z80 emulation it should be able to be done natively a lot faster, and my hope was there may be a way to get this functionality with out writing a compiler from the ground up.
    [/FONT]


    My main computer is a desktop, at my girlfriends there is a laptop. Right now i usually take whatever board im working on over there along with a flash drive and whatever cables/hardware i need. As i said about 9 out of 10 times i forget a usb to serial cable or something small but crucial. the laptop is also usually in use for netflix or something, which is the biggest issue.
    [FONT=arial, sans-serif]I cant afford a second laptop right now.. maybe next time I have some extra cash Ill go on the hunt for an old p4 with serial ports or something. A pie is probably the best option, but every time i have money for one i either go on a waiting list and receive an email when im broke, or more lately now that the upgraded version has settled in, there is a 2 month lead time to get a Pi. There just hard to get and I already have major plans for a Pi when I can get one, so i would need two, I think you can order more than one again, now that the upgrades been out for a few months :)

    As far as the whole byte code thing goes I actually knew that... my mind was kind of blank this morning, ive been having a rough day dealing with the passing of a friends so im a bit off the ball.

    And as far as fourth goes I have no interest in it, there's to much other stuff to learn, I know it can do some pretty cool stuff, and maybe if I took time to learn it Id enjoy it, but I just have a few other languages on my list above fourth.
    [/FONT]
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-04 18:18
    You're going to have to write your own C compiler for the Propeller if that's what you want. There are some models to start with. Tiny-C comes to mind. ISO C is much harder although you could use something like Tiny-C for bootstrapping, but you can't just take a desktop / laptop C compiler design and just recompile it for the Propeller. You could use XMM mode with the GCC compiler, but it still might not fit and would run glacially slowly if at all.

    If you really want to work mostly with C, try using the Z80 emulator. It's faster than a real Z80 and the various compilers that are available are reasonably fast. There's C, Basic, Pascal, Fortran, Lisp, and others. You should think in terms of a dual-Prop, one for handling the display and keyboard, and the other doing everything else. A lot of Z80 software assumes something like a VT220 terminal and that (I think) can handle some graphics stuff. The keyboard / display Prop can certainly manage a VT220 interpreter and a graphics TV display.
  • Heater.Heater. Posts: 21,230
    edited 2013-01-05 00:23
    I hesitate to suggest using the compilers from CP/M because as it stands such programs would not have access to any Prop features, counters, video, even I/O pins. One would have to add the "hooks" into the Z80 emulation to provide those. It's doable though.

    A major advantage of using Z80 emulation and CP/M is that you have lots of nice editors to use for you source code and a file system. The ccode compiled under CP/M need not run under CP/M of course, one could arrange that the system boots directly into your program instead of CP/M.

    One could imagine a multi-prop system with:
    a) A Prop dedicated to VT100 terminal display.
    b) A Prop running CP/M that is used for editing compiling using a) as the console
    c) A Prop that runs the code produced in b)

    But at that point you have quite a complex unit on your hands and a Raspberry Pi starts to look attractive.
Sign In or Register to comment.