Shop OBEX P1 Docs P2 Docs Learn Events
Spin Tools IDE - Page 10 — Parallax Forums

Spin Tools IDE

1810121314

Comments

  • @DarkInsanePyro said:
    Though looks like it is resolved for PASM2 but the address isn't resolvable from Spin 2. Not sure why you'd need the address in that context but eh... some people do things... strange (like me).

    I did some comparison tests with Propeller Tools and I was sure that @CLK* returned errors in Spin code.
    Definitely too hot here to code...

    I've been keeping my issues simple and not responding unnecessarily, but thanks for helping out with the issues reported. I've really been enjoying the updates as of late, between all the IRL distractions.

    You are welcome.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-21 00:15

    Would you consider implementing File/Save To... as in Propeller Tool? In my perfect world, the flyout menu would have

    • the standard and custom library paths
    • the paths from File Browser Visible Paths
    • recent paths (not in either of the above lists)

    Thank you!

    From Propeller Tool:

  • Hi, I'm new to this forum. My interest in microprocessors and programming is at hobby level. Being retired, it keeps me active mentally. I've designed and built my own Parallax 1 boards, which was great fun, and am currently learning how to program the board using spin1.

    Many thanks @macca for your Spin Tools IDE (Win 0.30.2). I've been looking for a Visual Studio like IDE for a while and your IDE hits the spot (especially the indent lines)!

    I'll be following this thread - lots of useful tips and comments. I'm grateful to all contributors.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-18 15:31

    Welcome, @Thezen. The Propeller family is a lot of fun, and Marco's IDE is making it easier to be more productive.

    Since you're new, you may not know that Parallax holds online meetings nearly every month -- tomorrow is the day and I will be giving a small presentation on Spin Tools IDE. You can sign up for the meeting at this link:
    -- https://www.parallax.com/propeller-live-forum-spin-tools-and-vsc-with-jeff-jon-and-chip-july-19th-2023/

  • Thanks @JonnyMac !

    "Marco's IDE is making it easier to be more productive" - agreed!

    I'm in the UK so the meeting's 21:00 GMT (I think) for me.
    Looking forward to seeing your presentation on the Spin Tools IDE.
    Failing that, I'll certainly watch the YouTube upload of the session.

  • To those using MacOS... Could one of you grab a screenshot of Spin Tools IDE running on your system for me? Preferably HD (1920x1080) -- but I'll take anything. Load any code you want. I need by noon on Wednesday (tomorrow). Thank you!

  • dgatelydgately Posts: 1,621
    edited 2023-07-19 00:40

    @JonnyMac said:
    To those using MacOS... Could one of you grab a screenshot of Spin Tools IDE running on your system for me? Preferably HD (1920x1080) -- but I'll take anything. Load any code you want. I need by noon on Wednesday (tomorrow). Thank you!

    These are full screen screenshots. I can create windowed versions if needed...

    If running in DARK mode:

    Does this work for you?

    dgately

  • Thanks, folks. Greg LaPolla helped me out and I have my presentation updated for tomorrow's Zoom call.

  • At the last minute I was hoping to show off a colorful display using Spin Tools' terminal in ANSI mode. I have a program with an ANSI object. In PST, it looks like this:

    In ANSI mode using PuTTY, it looks like this:

    I was hoping that using the Spin Tools terminal in ANSI mode I'd get the same thing as with PuTTY. I don't. Can you assist?

  • Hi @JonnyMac
    Watched your presentation on YouTube (56mins in). Thanks, it was helpful and easy to follow. The rest of the presentation was too advanced for me.
    Couple of questions:
    1. Is there anyway of stop/starting the Spin Tools Terminal like PST?
    2. In Spin Tools IDE, when I cognew a method (i.e. TestPwm) it flags it as unused (at PUB TestPwm). To get round this problem, I have to state (declare?) the method name somewhere before its definition:

        cognew(TestPwm, @Stack_Blue)
    
        TestPwm     <<< not required in Propeller Tool IDE
    
      PUB TestPwm |rate, tc, tHa, t
          ---
    

    Is this the right technique, a Spin Tool anomaly or have I missed something obvious?
    PS ... I'm coding in spin1.
    Cheers.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-21 00:11

    Is there anyway of stop/starting the Spin Tools Terminal like PST?

    If you run the program with Shift+F10 (or press Shift when clicking Run on toolbar), the terminal will automatically open. You need only set it to PST mode and at the desired baud rate.

    To get round this problem, I have to...

    No, you don't -- in fact what you're doing could cause a problem. Warnings are suggestions and will not stop your program from running. Only errors will prevent your program from being downloaded. This comes down to the parser not seeing that your method is being referenced inside cognew. Once Marco see's this he may be able to add that to the warnings rules.

    There was a time when this code would warn of x not being used. Marco fixed it once the false warning was pointed out.

    Some things are a little more subtle, for example:

    The compiler thinks y and z are not being used, but they're being initialized by the longfill command. It may be too much for the compiler to understand what's happening here. Again, when you see a warning, have a look, but don't modify your code unnecessarily to make false warning go away. If you edit a library file, for example, it's likely that every method will be flagged as not used because they are not being called from inside that file (most library methods are called from the parent file). Make sense?

    Good luck with your projects.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-21 02:52

    Feature request: Comment/Uncomment lines with [Ctrl]+['].

    How I'd like to see it work: When [Ctrl]+['] is pressed the program would iterate through selected lines (or current line if no selection) and check the beginning of the line. If the line does not begin with apostrophe and a #, an apostrophe and a # would be inserted. If the beginning of the line is apostrophe followed by #, those to characters would be removed from the line.

    Before:

    After:

    Other targeted tools (e.g., Arduino IDE and Thonny) have this feature and I find it quite useful. Yes, I know we have {{ and }}, but they're not as useful. The feature should appear in the Edit menu above Format Source as Comment/Uncomment.

    Thanks for considering, Marco.

  • @JonnyMac said:
    At the last minute I was hoping to show off a colorful display using Spin Tools' terminal in ANSI mode. I have a program with an ANSI object. In PST, it looks like this:

    In ANSI mode using PuTTY, it looks like this:

    I was hoping that using the Spin Tools terminal in ANSI mode I'd get the same thing as with PuTTY. I don't. Can you assist?

    I can't believe it... the color codes are working but I forget to update the character draw with the set colors... need to add some tests for the terminal.

  • @Thezen said:

    1. Is there anyway of stop/starting the Spin Tools Terminal like PST?

    The terminal window can be closed as any other window, and can be opened with F12 or the Tools -> Show Terminal menu or toolbar icon. In addition, pressing the SHIFT key with the upload functions will automatically open the terminal (or switch to it if already open). Unlike PST, this terminal doesn't conflict with the upload and isn't deactivated when the window is unfocused.

    1. In Spin Tools IDE, when I cognew a method (i.e. TestPwm) it flags it as unused (at PUB TestPwm). To get round this problem, I have to state (declare?) the method name somewhere before its definition:

      cognew(TestPwm, @Stack_Blue)
      
      TestPwm     <<< not required in Propeller Tool IDE
      

      PUB TestPwm |rate, tc, tHa, t
      ---
      Is this the right technique, a Spin Tool anomaly or have I missed something obvious?

    No this is a bug... and that workaround fixes the warning (and the consequent unused method removal) but also starts TestPwm two times which is not what you want (I guess).

  • Thank you @JonnyMac and @macca for your helpful replies.

    My fault! I meant is there a way of pausing the Serial Terminal?
    Multi-line comment/uncomment feature would be a useful feature as suggested, if that's possible.
    @JonnyMac - Yes, your explanation makes sense. Cheers! The problem is if I ignore the warnings the program doesn't work as expected.

    @macca - "...and the consequent unused method removal..." makes sense. Explains the behaviour of the program.
    The way round this issue (I found) is to include a 'call' to the affected method. Seems to work OK. I've attached the program.
    You'll notice that TestPwm 'declaration' is between object definitions. It doesn't seem to make a call to that method.

    I appreciate you're both busy so I'm grateful for any help.

    One last thing, when the program is working: I get messages Main Cog 0, TestPwm Cog 2. Any ideas as to what happened to Cog 1? Same issue when run in Propeller Tool.
    Many thanks.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-21 17:04

    My fault! I meant is there a way of pausing the Serial Terminal?

    This can probably be done (would require a button on the terminal window) but comes with its own set of issues, specifically, the terminal needs to have a bigger buffer to hold incoming bytes that are not yet being passed on to the display pane. If you pause too long, you could overflow this buffer and that leads to other issues.

    Personally, I'd prefer to see a scrollback buffer added to the terminal window (like in PST and PuTTY).

    Any ideas as to what happened to Cog 1?

    The PST object launches a cog to synthesize TX and RX UARTs -- in your program that is consuming Cog 1. If you look through Parallax Serial Terminal you'll find its StartRxTx() method launches the UART assembly cog.

    In my programs I use the OBJ section to document cog consumption.

    obj
    
    ' main                                                          ' * master Spin cog
      time : "jm_time_80"                                           '   timing and delays (80MHz)
      io   : "jm_io"                                                '   simple io
      term : "jm_fullduplexserial"                                  ' * serial IO for terminal
    ' bkg                                                           ' * background cog
    
    ' * uses cog when loaded
    
  • Thanks @JonnyMac for your reply.

    "... (would require a button on the terminal window) but comes with its own set of issues ... "
    I see what you're saying.

    "...PST object launches a cog to synthesize TX and RX UARTs ..."
    That explains Cog 1. Thanks!

    I'll adopt the comments method you describe.
    Running cogs needs a different way of thinking (at least for me).
    In the mean time, I'll continue studying the tutorials in the PE Kit.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-22 00:27

    Just be mindful that the PEK, while really good at teaching P1 architecture, does so in a way that employs a lot of bad coding habits (to keep listings as short as possible for a book). For example, do you want to have to copy-and-paste the delay() method to every program where it's needed? Of course not. This is where libraries help.

    I've attached a P1 template and a few basic libraries to start with. Whether you adopt my style or someone else's, do find a consistent style; this will help you find "gotchas" that are not syntax errors, but may be logic errors. Propeller Tool and Spin Tools allow you point to a template file which makes starting a project very easy. Unzip the attached archive and put the template file where you want; put the other files into your Library folder (allow to overwrite since these are my latest).

    Running cogs needs a different way of thinking (at least for me).

    Once it sinks in you'll wish you could do it on every micro. One way to think of it is moving house. If you're doing it on your own, you have to pack every room and move the boxes to the van. If, though, you invite friends over, one each could handle the living room, kitchen, bathroom, and bedroom, while one moves boxes to the van, and another fetches food and drink and conveys messages between the others. We use cogs to handle a small part of a large task, or to synthesize a process that might be hardware bound in another processor (e.g., UARTs).

    The attached images are of a display built for Riot Games (it sits in their lobby now), one of the biggest online gaming companies in the world. The entire display uses a single P1. This is how I divided the program

    Cog 0 - main
    Cog 1 - DMX driver
    Cog 2 - tree embers
    Cog 3 - tree embers
    Cog 4 - tree embers
    Cog 5 - tree embers
    Cog 6 - Annie hand flame
    Cog 7 - Tibbers flames

    To control a light of high-power LEDs we use output "bricks" that take data from a DMX stream. I have a lot of embedded DMX experience having worked with Disneyland and Legoland on specialty displays that required DMX. The animation cogs all do their thing and place data directly into the DMX transmit buffer. I separated everything because [Hollywood legend] Steve Wang likes a lot of control. During program development I could enable or disable any section(s) he wanted to focus on.

    The code is not difficult -- it just requires a bit of planning. All cogs except the DMX UART are Spin. People love that display. When a lady from their marketing team came to see it when finished she literally burst into tears. That made us smile; it was a 12-week project involving about 25 people and lots of hard work.

  • First of all, thanks for taking the trouble to send all this info, appreciated. My wife was impressed by the work you and the team have done (she didn't burst into tears though). :)
    Learned something new ... DMX streaming!

    I find PEK and the Spin Language Reference really helpful. There's a ton of info regarding spin programming and it will take me time to get to grips with the mechanics of cog programming.
    However, it's always good to have a mentor looking over one's shoulder providing advice.

    The template looks good (thanks) - will require study. Correctly structuring a large program is going to be crucial. The libraries are going to be useful.
    At the moment, I'm keeping the program structure as simple as possible so I can concentrate on getting to grips with the fundamental elements of spin1 programming.

    In future, I'll place spin1 questions in the Propeller 1 thread. I'll check this thread for any updates from you or @macca .

    Cheers for now ...

  • I'll check this thread for any updates from you or @macca.

    Just so there's no confusion, Spin Tools is all Marco; it's his creation, and the product of his hard work. Like you, I'm a happy user of it, and my personality is such that I'm not afraid to ask and advocate for new features that I think will be beneficial to myself and others. We're lucky that Marco has been so open to user suggestions.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-23 02:24

    Feature request: Could we get a right-click context menu in the editor window?

    • Select All
    • Cut
    • Copy
    • Paste
    • Delete

    Propeller Tool and other programs have more extensive menus, but I only ever use the context menu for editing tools.

    Thank you

  • "Just so there's no confusion ... "
    I totally agree.

    "Could we get a right-click context menu..."
    I was thinking the same thing last night!

    @macca ... May I make a cheeky request: the ability to split an edit window in two? Many thanks!

  • Released version 0.30.3 that fixes the above issues with COGNEW and the ANSI terminal codes.

    May I make a cheeky request: the ability to split an edit window in two? Many thanks!

    That will be very complicated. The editor is basically built from scratch using SWT StyledText and, as far as I can tell, it doesn't have a split function built-in so it must be implemented somehow.
    Eclipse has the split editor function and uses, very deep under the hood, StyledText but with some many layers of customizations that wil be almost impossible to use without all the bloat that comes with it.
    All I can say for now is, maybe in the future...

    Right-click menu, comment/uncomment, and other suggestions are added to the TODO list.

  • Thank you so much @macca ! I see version 0.30.3 is available so I'll check it out later today when I get a chance.
    Splitting the edit window's no big deal. It's not worth the trouble if it requires major surgery (so to speak).
    The bug fix will greatly enhance an already intuitive IDE. Looking forward to the next version incorporating @JonnyMac 's suggestions in your TODO list.
    Cheers for now ...

  • I can't run 30.3 on osx mojave
    Error : OSstatus 67032

  • @Ltech said:
    I can't run 30.3 on osx mojave
    Error : OSstatus 67032

    It does run on the most recent macOS version (Ventura 13.5 (22G74))... The OSError code -67032 has to do with a security feature. Did you initially launch Spin Tools IDE by Control-clicking on its app icon? That seems to allow you to bypass Privacy & Security measures on MacOS to allow app launch. After that, it should launch normally.

    You can also look at any error messages in Mac's Console app. That should give a lot more detail, if there's an app crash.

    dgately

  • @Ltech said:
    I can't run 30.3 on osx mojave
    Error : OSstatus 67032

    Can you tell me what is the last version that worked ?
    I have changed the build scripts for version 0.30.1, I don't expect to have such impact, basically the binaries are built on a Mac instead of Linux (macOS 12 Monterey from the GitHub runners page).
    If that's the cause, 0.30.0 should work but 0.30.1 not.

  • LtechLtech Posts: 366
    edited 2023-07-25 06:36

    I investigate,

    • On Mojave , Spin Tools IDE 0.30.1 is running. But not 30.3. I have to investigate my laptop. (this morning 30.1 don't want to run???)
    • On High sierra, Spin Tools IDE 0.30.3 is running.

    So sorry, I first try 30.3 only on one computer.
    I still be fan of you really nice work Macca
    Thank-you

  • Compiler bug: seems to not like ptrb[##0] as an operand. Encountered while trying to build SPCcog:

                  '' Gaussian interpolation
                  ' Get coefficents
                  getnib ptrb,dsp_gausspos,#2
                  rolnib ptrb,dsp_gausspos,#1
                  shl ptrb,#2
    dsp_gt_patch1 rdlong dsp_tmp2,ptrb[##0] ' "reverse"
                  bitnot ptrb,#2 addbits 7
    dsp_gt_patch2 rdlong dsp_tmp1,ptrb[##0] ' "forward"
    
    
  • @Wuerfel_21 said:
    Compiler bug: seems to not like ptrb[##0] as an operand. Encountered while trying to build SPCcog:

    Yes, that syntax is not yet supported, will fix as soon as possible.

Sign In or Register to comment.