Introduction to the Parallax Propeller 2 - by JonnyMac (posted on Nuts and Volts)

Hey all,

A very easy-to-read, current, and comprehensive introduction to the P2 was published for a wider audience by JonnyMac. You'll see references to P2D2, Eric Smith's work, Terry Hitt's BASIC and Ross's Catalina C.

https://www.nutsvolts.com/magazine/article/an-introduction-to-the-parallax-propeller-2

The conversational writing style is something I've personally missed in technical articles and we're so thankful and pleased that @JonnyMac is part of the community.

Ken Gracey
«1

Comments

  • Cool! Has Terry Hitt ported his PropBASIC to P2?
  • Well done Jon :)
  • Great work.
    It helps demistify the smart pins.
    It also reports on the major contributions of the compiler and interpreter authors in a fair way.
  • Nicely done, Jon

    I look forward to your forthcoming book dedicated to demystifying smart pins! :)
  • Jon,
    Congratulations, this is a definitive introduction to the P2.
    A well constructed narrative that covers history, technical specs, sample code, development options/languages and links.
  • PropGuy2PropGuy2 Posts: 272
    edited 2020-08-01 - 15:06:55
    Congratulations to Jon on a timely and informative article on the P2. I would add, check out the code examples listed at the end of the article. They are well thought out, easy to follow and commented for us folks that are still "struggling" to understand all the new Smart pin commands and nuances.
  • Congratulations to Jon. It sure looks great, lots of details. I'm looking forward to reading it.
  • Just read the whole article. Very consistent with Jon's great writing ability. ZIP file was a plus for new users.

    Very good Jon!
  • Jon write:
    Spin 2 has a couple of methods that aid in differential timing: getms() and getsecs(). Both return the run time (milliseconds and seconds, respectively) since the P2 came out of reset. Many will recognize getms() as doing the same thing as millis() does for the Arduino. This is useful for event timing with millisecond granularity. For example:
    
      startPoint := getms()
    
      ‘ do something
    
      duration := getms() – startPoint
    
    The getms() method returns an unsigned 32-bit value which means we can time an event of just over 49 days.
    
    But put 34u don't habe the methods getms() and getsecs().
    Is it in a future version of SPIN2?
  • PublisonPublison Posts: 11,508
    edited 2020-08-01 - 14:56:50
    Jon wrote the article back in May? getms() and getsec() got removed. Chip may put them back in:

    https://forums.parallax.com/discussion/171741/spin2-what-happened-to-getms
  • Another quality contribution Jon. Thank you! Some of these new P2 features are finally starting to sink in.

    I think both jm_led_gamma and jm_pwm are missing from the zip file. I managed to found the latter in a previous post. Maybe just human error?
  • JonnyMacJonnyMac Posts: 6,818
    edited 2020-08-02 - 01:23:38
    I wrote that article back in March, without an IDE that would archive files. I might have missed a few doing it manually. Look here for my latest code:
    -- https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All
    You can find jm_led_gamma.spin2 file in the jm_pwm_demo.zip archive.

    I'm glad you enjoyed the article, and I appreciate the kind words from the community.
  • There's a lot of work involved here, not only in preparing and writing words, but also in choosing words. You want to inform to a reasonable degree and also appeal to the masses while correcting wrong perceptions but not alienating anyone unnecessarily. You stuck your neck out and gave it a go, so I think you have handled it very well and we appreciate this very much. I hereby induct you into the Propeller Hall of Fame. (Is there one? There should be!)

    Well done fellow prophead :smile:
  • Thank you, Peter.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,691
    edited 2020-08-02 - 03:01:07
    If there's anything that might lead me to embrace the P2, it would have to be Jon's N&V article!

    I'm not there yet, mind you! I still have major issues with the devastation this 14-year Quixotic quest has wreaked upon Parallax, its employees, its bottom line, and its core business model. In Ken's position, I would've canceled it years ago, brother or no brother. But, despite my continued misgivings, I now recognize that there might be a germ of something worth paying attention to here.

    My eyes and ears are perked up. I dare anyone to make me a convert!

    -Phil
  • Cluso99Cluso99 Posts: 16,380
    edited 2020-08-02 - 04:18:03
    If there's anything that might lead me to embrace the P2, it would have to be Jon's N&V article!
    It is a real gem aimed just right!
    I'm not there yet, mind you! I still have major issues with the devastation this 14-year Quixotic quest has wreaked upon Parallax, its employees, its bottom line, and its core business model. In Ken's position, I would've canceled it years ago, brother or no brother. But, despite my continued misgivings, I now recognize that there might be a germ of something worth paying attention to here.

    My eyes and ears are perked up. I dare anyone to make me a convert!

    -Phil
    Phil,
    You did an amazing job with your articles about IQ detectors etc with the P1. The P2 can do way more. If you get inclined, I would love to see where you could take the P2. There is a thread about SDR Radio - I'm sure you could make such things work on a P2 nicely.

    Maybe I should say it would be impossible for you to do it ;)
  • @Phil Pilgrim (PhiPi) -There's a learning curve to the P2, but it is easier now that the tools and docs are more mature and you don't have to go through the relearning curves that we did :smile:
  • ... it is easier now that the tools and docs are more mature and you don't have to go through the relearning curves that we did.
    You guys are simply amazing! What a slog you've had to endure! I sincerely hope that your patience, perseverance, and hard work will be amply rewarded! But just getting a variant of Forth embedded into the bowels of the P2 is a huge victory. I wish you well.

    -Phil
  • P2 is way better than P1...
    Even in its infancy ...
  • Rayman wrote:
    P2 is way better than P1...
    I don't doubt your assertion, but it would be helpful to bolster it by illustrating something the P2 can do that the P1 can't.

    Thanks,
    -Phil
  • Peter JakackiPeter Jakacki Posts: 9,340
    edited 2020-08-03 - 03:35:41
    Rayman wrote:
    P2 is way better than P1...
    I don't doubt your assertion, but it would be helpful to bolster it by illustrating something the P2 can do that the P1 can't.

    Thanks,
    -Phil

    But Phil, although the P2 is still fairly new, haven't we demonstrated that already in so many ways? The memory alone has made a lot more possible, the speed alone, has also made a lot more possible, the smartpins alone have made a lot more possible, the new instructions and hardware support too have made a lot more possible. The list goes on but none of these things are in fact alone, they are all packed in under the hood of that P2 logo of that 100 pin chip. Oh, yes, twice as many I/O too.

    I have no doubt that as hard as it may be to hop off that P1 horse and then look rather clumsy mounting this big new bucking and rearing and rather scary P2 horse, that not only will you become a big grinning fan of it, but you will once more be teaching us how to ride this beast that we think we know how to ride, just as you did with the P1.

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,691
    edited 2020-08-03 - 04:37:07
    But Phil, although the P2 is still fairly new, haven't we demonstrated that already in so many ways?
    Well, no, not really. What I want to see is a specific app that the P2 can do that the P1 can't. More memory is nice, but there are other ways to deal with such a limitation -- if, indeed is it a limitation. And, okay, HDMI output is impressive, but how much does that really count toward the P2's overall utility?

    Show me a specific app that the P2 can succeed in that the P1 cannot, and I might be a believer. But I will be hell-bent to demonstrate that the P1 can do the same thing.

    -Phil
  • In his video, Chip demonstrated an FFT on 1024 samples of data, which I submit would not be possible in the same timeframe on P1. Surely it will expand the propeller application envelope for DSP? I've been experimenting with sdr on PCs, but now looking at the P2 to do some of the same signal processing. I've also just put together a P1 board to explore that, as they are both useful devices.
  • I think Phil just invited us to an ITP. He knows as we all know that if you can do something twice as fast as before you can do something you couln‘t do before. And if you do something you can‘t do twice as fast you can do even more. But Phil: isn‘t that too much testing?
  • The world will know the answer in less than 0011001010 days
  • I have no doubt that as hard as it may be to hop off that P1 horse and then look rather clumsy mounting this big new bucking and rearing and rather scary P2 horse, that not only will you become a big grinning fan of it, but you will once more be teaching us how to ride this beast that we think we know how to ride, just as you did with the P1.

    :)
  • David Betz wrote: »
    Cool! Has Terry Hitt ported his PropBASIC to P2?

    David, I am working on it in my spare time.

    Bean
  • Hi
    David, I am working on it in my spare time.
    WooHoo GREAT news _ I was beginning to wonder if I would bother with the P2 at all- But now I'm optimistic.
    I work exclusively with Beans PropBasic- every day - it hits the spot with me- not too high level - no types 'any'-... etc.
    When I use it I tend to think of it as a high level assembler with familiar Basic like mnemonics and no 'garbage removal' et all hanging in the background.

    Dave
  • jmgjmg Posts: 14,417
    tritonium wrote: »
    Hi
    David, I am working on it in my spare time.
    WooHoo GREAT news _ I was beginning to wonder if I would bother with the P2 at all- But now I'm optimistic.
    I work exclusively with Beans PropBasic- every day - it hits the spot with me- not too high level - no types 'any'-... etc.
    When I use it I tend to think of it as a high level assembler with familiar Basic like mnemonics and no 'garbage removal' et all hanging in the background.

    Yup, exactly. There is plenty of room for easy to control 'high level assemblers' :)

    Bean wrote: »
    David Betz wrote: »
    Cool! Has Terry Hitt ported his PropBASIC to P2?
    David, I am working on it in my spare time.
    Bean
    Good to hear.
    One detail that went past on the Python demo, was a nifty idea where they used Basic Stamp style commands to access smart pins, and then had a 'show me disasm' step, which exposed what that command did at the smart pin level.

    Smart pins will be opaque to many, so a setup where users can launch a pin on a single line, and then inspect/copy the assembler that got the pin working, could be usable in any overall P2 development.

  • Yes the .code() feature of Native MicroPython shows what the need PASM2 commands are to get a smart pin doing what you want, but we've talked about extending this so you can call
    .code.basic() or
    .code.spin2() etc.

    We'd just need to template wrapper to format the code so it's right for each language.
Sign In or Register to comment.