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

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

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2009-10-15 19:14 in Propeller 1
I am programming a so-far successful SPIN compiler that runs on a Propeller. My original plan was to have it send all code but the comments to a second Propeller that simulates itself. This, however, could be un-needed since the Propeller has a built-in SPIN interpeter. The question is: How do I compile the code so that it can be read by the SPIN interpeter? I know that I would have to drive the RESn line low and do serial communication to P31 and P30 like the PC does, but how would I send the code? Can you please tell me how this would be accomplished? I do not know PASM, so this may make explaining more difficult. Thank you in advance.

· Micro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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·


«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-12 22:48
    There were some descriptions of the format of the Spin binary file posted on this forum. I don't have the links handy, but it was fairly complete. There's a tree of control blocks pointing to the compiled byte codes for each method in an object plus a pointer to the allocated memory space for the object's globals and the object's DAT area. Also, Chip posted a downloader written in Spin as a documentation of the downloading process
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-12 23:04
    (I got a pro for sure smile.gif)

    Do you have any idea what thread this was in? What the title was for example?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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·


  • BradCBradC Posts: 2,601
    edited 2009-10-13 01:10
    microcontrolled said...
    I am programming a so-far successful SPIN compiler that runs on a Propeller.

    The question is: How do I compile the code so that it can be read by the SPIN interpeter?

    These two lines confuse me. First off you tell us you have a successful SPIN compiler, but then you ask how to compile the code?

    I know you are trying to do this for the Propeller design contest, and I know because of this you are being rather secretive, but you need to give us more information. Really!

    The *very* simplified process runs something like this :

    Take RAW source code text (SPIN & PASM).
    Parse the OBJ block(s) allocating space for any sub-objects and enter their names into the symbol table.
    Parse the VAR block(s) allocating symbols and relative sizes for every variable, re-ordered from LONG->BYTE to pack tighter.
    Assemble the DAT blocks into a single binary BLOB representing all the DAT sections in the file.
    Parse the SPIN PUB blocks into raw SPIN bytecode instructions and assemble them into a block. Write block pointer and local variable size into OBJ header at start of object.
    Parse the SPIN PRI blocks into raw SPIN bytecode instructions and assemble them into a block. Write block pointer and local variable size into OBJ header at start of object.
    Write OBJ pointers into OBJ header at start of object.

    Apply shampoo, lather, rinse, repeat for all sub objects.

    Lets say you have a single SPIN source file with no other objects in use.
    You have a binary block with this structure :
    OBJ header / DAT Section / PUB routines / PRI routines / Variables / Stack.
    You now need to write the clock speed long, the clock mode byte, the checksum, PBASE, VBASE, DBASE, PCURR, DCURR to the start of the image, then place the object code block immediately after that ($10 for the first spin block).
    The header words are these :
    PBASE - This points to the start of the object the interpreter runs out of the blocks. It points to the start of the object header.
    VBASE - This points to the location of the VAR block variables. It's long aligned and immediately follows the last SPIN object block
    DBASE - This points to the location of the STACK. It's long aligned and immediately follows the variables. (which is why if you overflow a VAR array you trample the stack and your program crashes)
    PCURR - This points to the current program counter (Initially it should point to the first byte of the first SPIN routine that is to be run after boot)
    DCURR - This points to the current stack pointer. (Initially it should point to the third long of the available stack space. The first two are set to $FFF9FFFF. This halts the interpreter if the stack underflows).

    Now you have a binary blob the Propeller will be able to do something with, you'd use Chip's Proploader object in the obex to load it into another propeller using /res and P31/P30.

    Now, which bit are you having problems with?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-13 01:30
    Thanks, BradC! This is more what I am looking for!

    What I ment, was, I wrote a complicated text editor with New, Open, Save, Export, Delete, etc. functions. I then hooked up the EEPROM (64k) lines of a second prop to the first 2 pins of the first one. I write a program into the upper 32k with Prop 1 and boot the other prop to read it and simulate itself. Well after getting a couple of commands simulated, I thought, "How useless! It has a built in SPIN interpeter that I can use with no programming to the second prop if I can just learn how to communicate with it!" Here I am now, asking questions. tongue.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·


  • BradCBradC Posts: 2,601
    edited 2009-10-13 01:54
    microcontrolled said...
    I then hooked up the EEPROM (64k) lines of a second prop to the first 2 pins of the first one.

    So what you want is the first Prop to emulate an EEPROM so the second prop can load itself from the RAM of the first? That is an interesting approach, but needlessly complicated.
    Just leave the eeprom off the second prop altogether and load it over the serial port using Chip's Proploader object.
    microcontrolled said...

    I write a program into the upper 32k with Prop 1 and boot the other prop to read it and simulate itself.

    Inconceivable! "You keep using that word. I do not think it means what you think it means".

    Let me try and get this straight.

    - You have two propellers.
    - One has a text editor on it.
    - You plan to use the text editor to develop propeller software on the first propeller, and run it on the second propeller.

    Here are my current assumptions. Please feel free to correct me if I'm out of line. :
    It's dark. Your current assets include 2 Propellers, A text editor. Your magic lantern only holds approximately 6 weeks of remaining fuel.

    Assets remaining on this level :
    A 5.25" floppy disk on which resides a compiler
    A small jewelery bag containing an external file system to hold data as you compile and link the objects.
    An ancient scroll on which is written a means to get any resultant compiled binary from Propeller A to Propeller B.

    I'm still a little shady on your phrase "simulate itself". I had the impression you were looking to generate native propeller code, squirt it into a propeller and run it.

    Did you know you can load an unmodified propeller binary, perform some simple fixups on the header and run it anywhere in Propeller ram? You could have Propeller B run a little program that accepts a propeller binary over the serial port and then runs it natively. You don't get the full 32k of ram to play with of course, but you can do it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • AribaAriba Posts: 2,690
    edited 2009-10-13 03:19
    microcontrolled

    The built in SPIN interpreter does not interprete a textual source file. This "Interpreter" is a virtual CPU which executes Bytecode from the HubRAM. This Bytecode must be generated by a Spin compiler (PropTool, BST, Homespun, Sphinx) and this is a very complex process (as BradC has shown you). You can see this Bytecode as another Assembly language optimized for Spin.

    Doing the compilation on a Propeller is a big challenge, you need enough memory (SD card, Flash) and must do it in several passes.
    But it has be done already by MPark with his Sphinx (see www.sphinxcompiler.com), and he also provides the source code!

    What Sphinx misses is a comfortable Editor / IDE, perhaps with syntax highlighting, block copy and so on, that can edit also big files. So if you have written a good Editor, why not adapt it to Sphinx ?

    Andy
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-13 11:24
    You can actully EDIT code in Sphinx? I thought that you could just load code into it to be executed later. If I simply edited Sphinx, I wouldn't have a right to put my program in the Design Contest, would I?

    @BradC: I AM designing it to "simulate itself" BUT I WANT to have it ACTULLY PROGRAM THE SECOND PROPELLER. I just didn't know how to compile a binary file with my editor. Now I think I know, but the descritption that you gave me is very hard to follow if I were to actully apply it to my program. (P.S. What does "parse" mean in the context that you are putting it in?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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·


  • MagIO2MagIO2 Posts: 2,243
    edited 2009-10-13 11:52
    Just watched the Expo vid about Sphinx a few days ago. Sphinx is a compiler/linker running on the propeller itself to compile/link SPIN code.

    Parse means to read the source file and try to understand what all those statements mean. For example, find out what variable names are used, what function names are there and what instructions ... and convert the string $ffff to a word sized number ... and so on.

    As BradC already said: The SPIN interpreter which runs in the propeller does not directly read SPIN-files and can't deal with the text-representation of SPIN. The SPIN which runs in the SPIN interpreter is compiled and linked bytecode. So, they call it interpreter but in fact it is

    Have a look at the Sphinx vid ... it'll explain all of that ... hmmm ... - can't find it at parallax homepage ... anyone who has a link?
    You can also have a look at http://propeller.wikispaces.com/Spin+Byte+Code·to see what the bytecode that is interpreted looks like.

    Post Edited (MagIO2) : 10/13/2009 12:21:17 PM GMT
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-13 12:01
    I was at UPENE and I saw the Sphinx demonstration and talked to the programmer of it!

    I know already that it must be compiled into bytecode, I just DON'T KNOW HOW TO DO IT!!! I am starting to get the picture, though. Thanks for the defineing of "parse" by the way.



    Now that you have told me the prosess, can you please give me an example of the header of the code? What the clock long long should look like, etc.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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·



    Post Edited (microcontrolled) : 10/13/2009 12:07:30 PM GMT
  • heaterheater Posts: 3,370
    edited 2009-10-13 13:00
    microcontrolled: "I know already that it must be compiled into bytecode, I just DON'T KNOW HOW TO DO IT!!!"

    I don't mean to be discouraging but that question tells me you are at the beginning of a very long, but fascinating road.

    On the one hand we have the human readable plain text of a program, in Spin in this case. On the other we want to have the binary numbers, or byte codes, that represent the program in such a way that the computer, or in this case the Spin interpreter in the Propeller can execute.

    How to get from the text to the byte codes is the process of compilation. A process that has occupied the minds of a great many brilliant people for a long time.

    It will require an intimate understanding of the input language, Spin, and an intimate understanding of what the byte codes do. Then you can start on the compiler.

    I would recommend reading Jack Crenshaw's series "Let's Build A Compiler" compilers.iecc.com/crenshaw/ for an introduction to the problems and solutions in writing a compiler.

    Over the years I have tried to understand various texts on compiler writing, most (all) of them go totally over my head but Jack states the problems in a way I can relate to and shows solutions that can be implemented quite easily.

    One of the writers of a Spin compiler here, mpark or BradC I forget who, said he wished he had read Crenshaw before starting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-10-13 13:21
    Isn't this enthusiasm cute?

    You don't know PASM, so are you planning a SPIN compiler without PASM support? You want to program your own SPIN compiler without an idea on what a compiler is doing in detail? And you want this to run on a propeller. Ask BradC. I'd bet that writing a compiler is hard enough without memory limits (running on a PC).
    As Sphinx shows it can be done, but to be honest: You should plan your project to be finished for the competition next year if you want to write your own compiler.

    Maybe you can focus on the editor you did and the hardware part. Even if you use Sphinx to do the compile/link job you have a lot to do, to put all the pieces together. And my guess is that nobody will blame on you if you create something new and useful this way. That's how this community works. Everybody puts some pieces in and everybody can use those pieces to create something new.
  • trodosstrodoss Posts: 577
    edited 2009-10-13 14:37
    As heater said, starting with Crenshaw's "let's Build a Compiler" is a good place to start.

    Hippy had posted information a long time ago about the Spin bytecode/object structure. I haven't been able to find the thread again or I would post a link. BradC above also gave a good explanation of the process of compiling (he knows!· He's 'da Man!).

    Also, you might want to download HomeSpun and compile a few "known" objects with the -d option to get a listing file and see what it generates.
    [noparse][[/noparse]Edit:] See what BradC posted above...his explanation was much more complete.· I missed it the first time I read it [noparse]:([/noparse]
    Based on the information I have, the 16 byte header for the entire image would be something like:

    long - Frequency
    byte - XTAL mode
    byte - checksum
    word - Pointer to the start of the object
    word - Pointer to the start of variables
    word - Pointer to the start of the stack
    word - Pointer to start of methods(?)
    word - Inital stack pointer
    (apologies to those more versed in the header than I. Just working off my limited knowledge/best guesses)


    Objects themselves have a structure. Again, wish I could find Hippy's documents, as he explains that. Maybe someone else has a link.

    Looking at the Sphinx code it may/may not answer questions you have. Certianly I have been looking at that source a lot lately.·

    [noparse][[/noparse]Edit:] Also, you might look at Gear, or programs running in Gear.· That is also a good resource.

    Post Edited (trodoss) : 10/13/2009 3:23:31 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-13 14:57
    You might look at FemtoBasic. It's an interpreter, but it's very similar to pretty much any recursive descent compiler. Instead of generating code, it directly performs the operations needed.
  • mparkmpark Posts: 1,305
    edited 2009-10-13 15:46
    Micro,

    Here's hippy's post with bytecode.txt and mainspec.txt, the two documents that really helped me understand Spin bytecode:

    http://forums.parallax.com/showthread.php?p=665019

    Good luck with your project!


    m
  • trodosstrodoss Posts: 577
    edited 2009-10-13 16:34
    mpark said...
    Micro,

    Here's hippy's post with bytecode.txt and mainspec.txt, the two documents that really helped me understand Spin bytecode:

    http://forums.parallax.com/showthread.php?p=665019

    Good luck with your project!


    m
    That would be· the link I couldn't find!· Thanks!
  • mparkmpark Posts: 1,305
    edited 2009-10-13 18:01
    One more thing...
    microcontrolled said...
    ...If I simply edited Sphinx, I wouldn't have a right to put my program in the Design Contest, would I?
    Micro,

    I'm not sure what you mean by "simply editing Sphinx," but if you want to combine your text editor with Sphinx and enter it in the contest, you have my blessing. Although Sphinx is not in the OBEX, it is MIT-licensed so you can use it just like any object from the Exchange.


    m

    ·
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-13 18:08
    I mean, mpark, that if I designed an editor for Sphinx that had block highlighting, code auto-capitlizing, and some special editing features, then WOULD I be able to enter it?

    Whoever said that I should just take a year to perfect the project and enter it into next years competition, they are forgetting that I cannot. Ken said that this is the last year (due to liability reasons) that anyone under 18 would be allowed to enter the contest. Therefore this is my LAST CHANCE to enter the competition for a long time.....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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·


  • Bill HenningBill Henning Posts: 6,445
    edited 2009-10-13 18:15
    I agree with mpark and the others... I think doing a nice IDE for Sphinx is a very good project for you, and worthy of the contest.
    microcontrolled said...
    I mean, mpark, that if I designed an editor for Sphinx that had block highlighting, code auto-capitlizing, and some special editing features, then WOULD I be able to enter it?

    Whoever said that I should just take a year to perfect the project and enter it into next years competition, they are forgetting that I cannot. Ken said that this is the last year (due to liability reasons) that anyone under 18 would be allowed to enter the contest. Therefore this is my LAST CHANCE to enter the competition for a long time.....
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • heaterheater Posts: 3,370
    edited 2009-10-13 18:33
    "the last year (due to liability reasons) that anyone under 18 would be allowed to enter the contest"

    What? Is that for real? What liability reasons? Has the world gone mad?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-13 18:41
    Agreed, and I think excessive liability concerns would have eliminated most of my productive and meaningful childhood. The world has gone mad! I grew up a "free range" kid. Today, large numbers of parents and kids see that as bad form. Ugh...

    Good luck Microcontrolled!

    ...and consider befriending a proxy for next year. I would.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-13 18:44
    I don't remember what Ken originally wrote about an age limitation, but, as is true for most contests, you are agreeing to a contract by entering a contest and someone under 18 (in most jurisdictions) can't be held to a contract. That doesn't mean you can't enter. It just means that you would need an adult sponsor who would "officially" enter for you. Typically this would be a parent or teacher. It could also be an older (adult) sibling or minister or an adult neighbor or friend who you would trust to let you have the prize if you won.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-13 19:26
    I don't really see the "liability reasons" but I respect Parallax and there desision to prevent lawsuits. Ken said that last year Parallax recieved 3 parental phone calls and one from a famly lawer! Everybody these days will do anything for some money....

    I am installing Sphinx now, Windows (Vista) says file system is "FAT" but dosn't say 32 or 16. Allocation unit size is 32k, but this is the clusters, not reguarding the format. How do you get FAT16?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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·


  • jazzedjazzed Posts: 11,803
    edited 2009-10-13 19:40
    Doesn't Sphinx run on the propeller? Can't you just put it in the Propeller Tool and hit F10? I think the demo I saw in Rocklin had a "line editor" ... did I dream that? Pinch me.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-13 20:01
    Most of the support forums say that Vista treats FAT as FAT16. I've not tried it myself since I don't have Vista.

    Sphinx does run on the propeller. It also has a simple line editor. As microcontrolled is trying to do, there are lots of files and they need to get copied to an SD card for execution.
  • mparkmpark Posts: 1,305
    edited 2009-10-13 20:11
    Sphinx also has some bugs. Micro, if you can fix the intermittent bug in the file system, I will give you a prize myself.
  • heaterheater Posts: 3,370
    edited 2009-10-13 20:41
    "Parallax recieved 3 parental phone calls and one from a famly lawer! "

    This is very sad. What, little Johnny burned his finger with a soldering iron or, worse still, burned a hole in the lounge carpet?

    When I was kid we were left alone during lunch breaks at school to use industrial sized lathes and mills in the metal shop. We were casting molten aluminium for fun. Bear in mind that at that time one could leave school on becoming 15.

    I'm not suggesting that metalwork is the be all and end all of education but how times have changed. No wonder the western world is struggling to actually make anything.

    As my hero Fred Dibnah said "Teaching boys to bake cakes? That's no way to maintain an industrial empire."

    en.wikipedia.org/wiki/Fred_Dibnah

    So, Micro, I don't know how old you are but for Gods sake don't let all this get to you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-13 23:46
    I was thrown across the floor (about 9 yrs old) when I held 240Vac wires onto a neon light from a washing machine. Does that mean my parents could sue - don't think so ! But I bet these days someone may try and that cost money. Anyway, fortunately I did not tell my parents until a few years ago (I am 57) ! Otherwise, I would not have had a career in electronics/computers !!!

    Anyway, back to the real topic. If you want to find out more about the Spin Interpreter, look for my faster interpreter thread. Go from back to front looking for the specs attachment. It includes all of hippy's details and updates based on Chip's published interpreter and some extras I found. You can find a link to the thread in the Tools link in my signature below. PS: My latest version has a bug and does not work (got distracted).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 00:42
    Ok, I have examined SPHINX (and have found the bug smile.gif) but also have desided how to modify it. I am going to replace the TV_Text program on the SPHINX memory with Mike Green's tv_wtext object that he uses in his femtoBASIC object. This will allow for text coloring allong with backspace, some thing that TV_Text and TV_Terminal lack together. I also like the black background. smile.gif
    I'm going to modify the start of the program to use a more Windows Explorer type search, instead of using commands it will give a list of files on the SD and when you click on one it goes to an options screen asking what you want to do. Hopefully this will encourage more people to use this wonderful object that can allow for portable programming without the need for a netbook purchase!

    @mpark: You have a custom TV text object for the command line part of this program. I cannot figure out how to switch it to normal TV_Text so I can work with it. With what I tried the program crashed when you pushed ENTER, for some reason. What is causing this and what is the point of the variable called at the TV start line?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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 01:20
    microcontrolled said...

    @mpark: You have a custom TV text object for the command line part of this program. I cannot figure out how to switch it to normal TV_Text so I can work with it. With what I tried the program crashed when you pushed ENTER, for some reason. What is causing this and what is the point of the variable called at the TV start line?

    The sxtv object and tv_text are quite different. I don't think it's possible to swap them, at least not easily. I don't know exactly why it crashed because I don't know what you tried, but whatever it was, it was probably doomed from the get-go [noparse]:)[/noparse]

    As for the variable at the TV start line, do you mean this line in sphinx.spin: "if term.start( tvPins, SXTVRENDEZVOUS )"? SXTVRENDEZVOUS is not a variable, it is the address of a hub memory location through which the main Sphinx program communicates with the sxtv object.

    You might look at the source for ed, the current much-maligned (deservedly so!) Sphinx editor. Ed disables sxtv and uses tvtexted (which is mostly compatible with tv_text) for its display.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-10-14 02:04
    How do I turn a spin program to a spn program and vice-versa? I have edited the tvtexted and the ed and I cannot figure out how to get a new object to use in them into the Sphinx software. I put it on the SD card by pasting code in notebook and saveing it with the .spn extention however Sphinx declared there was an error in the program even though it compiled fine on the computer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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.