Shop OBEX P1 Docs P2 Docs Learn Events
What can your P2 do? — Parallax Forums

What can your P2 do?

Peter JakackiPeter Jakacki Posts: 10,193
edited 2019-07-14 08:03 in Propeller 2
Ok, admit it fellow forumistas who are lucky enough to have a P2 parked in your kennel, you know you've had one of these puppies for a while, so what tricks have you taught it? What can it do?

Here's a short video of some of the things that I may have shown before but also includes a video game as well.

«13

Comments

  • Very cool! I'm afraid mine is just collecting dust. I'd send it to someone else who could better use it but I paid for it myself and *might* get back to it sometime.
  • I've got mine networking via an ENC28J60, which I need for a lot of legacy P1 projects, and also reading scan codes from a PS/2 keyboard. Haven't gotten around to writing commands to the PS/2 but it's probably not as important as the networking for the projects I will need to migrate.
  • cgraceycgracey Posts: 14,133
    Looks good, Peter. I commented on your video.
  • I seemed to have stopped here. There is much improvement to be made.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-06-15 04:06
    @ke4pjw - don't stop, once you've got the momentum, it is way easier to keep it going and keep having fun.


    There seems to be a flicker issues in my video playback at times and I've got a feeling it might have to do with the SD block read or the initial latency so I will write a little debug routine that will record all that info for every frame that is read to help me pinpoint these issues. This doesn't seem to happen on the bender video which doesn't have a matching sound track.

    BTW, I decided to start this thread in response to the "It's been so quiet around here" thread. There's no reason for it to be quiet as if people are waiting to get their hands on a P2. There are plenty of tools available and the best way to test those tools is to tackle some real application. Just don't keep it secret, let us know about it and we can be excited over the P2 together. It doesn't have to be finished or perfect.

  • Cluso99Cluso99 Posts: 18,066
    AMAZING :smiley:

    Video playback at 4:35 is amazing for P2!
  • samuellsamuell Posts: 554
    edited 2019-06-15 13:28
    Hi,

    Mine can calculate prime numbers, but that's it. I've done some experimentation and tested out some code. However, lately, I had other things, so I haven't dedicated any time to the P2.

    By the way, I've wrote an article containing my first impressions (in Portuguese):
    http://www.bloguetronica.com/2019/05/o-novo-micro-controlador-da-parallax.html

    Saw your video, and the demo is very impressive! By the way, did you find any reason for the crashes? Is it supply/BOD related?

    Kind regards, Samuel Lourenço
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-06-15 13:36
    That video playback isn't as good as it has been but I think I need to fine tune the interaction between fetching video frames from one file and filling the audio buffers from another. When I find out what is happening I will redo some videos as well and they should be a lot clearer and glitch free then. But the main point is that we don't have to have things perfect upfront, just get it functional and have fun doing it, then have more fun perfecting it later. Don't be afraid to dip your big toe in P2 waters, it's plenty warm and fun.

    There are so many areas to explore with the P2 and my next area will be to do with audio processing. I'm hoping eventually to put a mixing console and PA system into a small black box, skip the antiquated huge and heavy power amp with 100V line output transformers, and just feed pure digital and DC power to addressable class-d enabled PA speakers sans transformers. Then the whole thing will mostly be automatic but can be monitored and controlled from a tablet over WiFi. With a networked speaker system it is possible to individually control the volume and material on each speaker which will also help with roving microphones as used in halls and malls and churches and businesses. Security, safety, evac and fire are other functions that can be built in too. The P2D2 will form the heart of many of my projects which may very well start out on matrix board.....because I can.



  • My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-06-15 13:54
    David Betz wrote: »
    My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.

    I've seen a lot of tools being developed for the P2 and that is really great but it's kinda like having a workshop full of tools that can create and build almost anything, but nothing to show for it except the tools themselves.
    Are there any projects that you've been able to use your interpreter in that can both showcase the P2 and the interpreter, and also get others interested or even excited at the same time?
  • David Betz wrote: »
    My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.

    I've seen a lot of tools being developed for the P2 and that is really great but it's kinda like having a workshop full of tools that can create and build almost anything, but nothing to show for it except the tools themselves.
    Are there any projects that you've been able to use your interpreter in that can both showcase the P2 and the interpreter, and also get others interested or even excited at the same time?
    No. The interpreter is essentially useless. I just used it as a test program for fastspin/C. I'm beginning to think I should abandon my hobby of language design. All languages are essentially the same anyway. As you say, an actual application would be more interesting.

  • David Betz wrote: »
    David Betz wrote: »
    My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.

    I've seen a lot of tools being developed for the P2 and that is really great but it's kinda like having a workshop full of tools that can create and build almost anything, but nothing to show for it except the tools themselves.
    Are there any projects that you've been able to use your interpreter in that can both showcase the P2 and the interpreter, and also get others interested or even excited at the same time?
    No. The interpreter is essentially useless. I just used it as a test program for fastspin/C. I'm beginning to think I should abandon my hobby of language design. All languages are essentially the same anyway. As you say, an actual application would be more interesting.

    You hit the nail on the head there because my "philosophy" in developing Tachyon and TAQOZ is simply that it is a means to an end, the end being the application. Damn the torpedoes, full speed ahead.

    Even when I first started developing Tachyon I already had started testing applications even though the kernel was barely an embryo. As I develop my applications, I develop my tools to suit.
    You may find that if you have a real application to tackle that this will most certainly help to refine and define any tools you are developing. Tackle the application and you tackle the tools.
  • David Betz wrote: »
    David Betz wrote: »
    My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.

    I've seen a lot of tools being developed for the P2 and that is really great but it's kinda like having a workshop full of tools that can create and build almost anything, but nothing to show for it except the tools themselves.
    Are there any projects that you've been able to use your interpreter in that can both showcase the P2 and the interpreter, and also get others interested or even excited at the same time?
    No. The interpreter is essentially useless. I just used it as a test program for fastspin/C. I'm beginning to think I should abandon my hobby of language design. All languages are essentially the same anyway. As you say, an actual application would be more interesting.

    You hit the nail on the head there because my "philosophy" in developing Tachyon and TAQOZ is simply that it is a means to an end, the end being the application. Damn the torpedoes, full speed ahead.

    Even when I first started developing Tachyon I already had started testing applications even though the kernel was barely an embryo. As I develop my applications, I develop my tools to suit.
    You may find that if you have a real application to tackle that this will most certainly help to refine and define any tools you are developing. Tackle the application and you tackle the tools.

    Oops. Sorry! It didn't occur to me that you might read my message as a criticism of Tachyon. I think Tachyon is a different animal. It is definitely not just another programming language. It's more of a complete development environment and runtime environment for building Propeller applications. It definitely stands out in the crowd.
  • David Betz wrote: »
    David Betz wrote: »
    David Betz wrote: »
    My P2 can run a simple BASIC interpreter that I wrote for the P1. That is what I was using to test Eric's fastspin C compiler a while back.

    I've seen a lot of tools being developed for the P2 and that is really great but it's kinda like having a workshop full of tools that can create and build almost anything, but nothing to show for it except the tools themselves.
    Are there any projects that you've been able to use your interpreter in that can both showcase the P2 and the interpreter, and also get others interested or even excited at the same time?
    No. The interpreter is essentially useless. I just used it as a test program for fastspin/C. I'm beginning to think I should abandon my hobby of language design. All languages are essentially the same anyway. As you say, an actual application would be more interesting.

    You hit the nail on the head there because my "philosophy" in developing Tachyon and TAQOZ is simply that it is a means to an end, the end being the application. Damn the torpedoes, full speed ahead.

    Even when I first started developing Tachyon I already had started testing applications even though the kernel was barely an embryo. As I develop my applications, I develop my tools to suit.
    You may find that if you have a real application to tackle that this will most certainly help to refine and define any tools you are developing. Tackle the application and you tackle the tools.

    Oops. Sorry! It didn't occur to me that you might read my message as a criticism of Tachyon. I think Tachyon is a different animal. It is definitely not just another programming language. It's more of a complete development environment and runtime environment for building Propeller applications. It definitely stands out in the crowd.

    Sorry, I didn't think anything of the sort, I just used Tachyon as my example of a philosophy and I believe that tools should be developed in conjunction with applications. Even if the tools are designed to be standardized, at the very least the applications provide the focus for the kinds of functions and problems that the tool needs to deal with in the real world. Even if the tool isn't "complete", and it never will be, it will still prove to be very useful and gain a reputation in getting the job done, and done well at that.
  • Mine's been used recently to measure intermodulation distortion and noise floor in an RIAA preamplifier with the aid of an ADS8885 add-on board: mod_preamp_twotone.jpg
  • Okay, these are very cool apps for the P2! But my question is this: what can the P2 do that can't be done otherwise, either equally or less expensively or with a smaller BOM using other modules or components? Note: I do not include retro game or OS emulation apps in this question. Those are yesterday's news and don't count.

    -Phil
  • evanhevanh Posts: 15,126
    Phil,
    What use is such a question? How long can anything claim a crown for?

    The prop2 has a purpose already. If someone finds other uses then that's cool too.

  • @Mark_T - very neat and functional. Excellent! Can you publish code and schematics?

    @"Phil Pilgrim (PhiPi)" - Hey, what happened to your energy! You have had so many cool projects and ideas and quizzes all centered around the "what's it good for" P1. Who would have thought that you could hook an antenna to your Prop and listen to the radio? But you did. So cool.

    On paper the P1 didn't look like much at all but it was only from delving in under the hood and getting to know the guts of it that we have had so many cool uses for it. Sure, they could have been done with other chips, but we do mean "chips" and not a chip. I see exactly the same with P2 except there is so much more built into it that I might never get to know fully, which is a really good thing in that we can always discover new things. The main advantages for me at the very present are memory, speed, and I/O (and smart at that), but by no means are they the only advantages.



  • cgraceycgracey Posts: 14,133
    Mark_T, that looks great. Is the P2 generating the video, too?
  • jmgjmg Posts: 15,140
    Okay, these are very cool apps for the P2! But my question is this: what can the P2 do that can't be done otherwise, either equally or less expensively or with a smaller BOM using other modules or components? Note: I do not include retro game or OS emulation apps in this question. Those are yesterday's news and don't count.

    Have you checked out the price of Octal UARTs ?
    Or the price of quadrature counters, need 4/6+ of those ?
    Or the price of moderate sized FPGA ?
    Or the price of Dual-Port memory ?
    ...

  • @Mark_T - very neat and functional. Excellent! Can you publish code and schematics?
    https://github.com/MarkTillotson/Prop2_FFT
  • Hey, what happened to your energy! You have had so many cool projects and ideas and quizzes all centered around the "what's it good for" P1.
    My energy is being devoted to making money by designing the P1 into products for customers. I have not yet found its limits! :)

    Anyway, good points, all! I hope the P2 finds profitable niches in the microcontroller marketplace.

    -Phil
  • rjo__rjo__ Posts: 2,114
    edited 2019-06-19 06:18
    It's a long story and it sounds like a complete fabrication.

    All of this takes one cog:... except for the second PropCam(right now at 80MHz system clock a second Cog is required). At 200 MHz, it is all in one cog.

    Everything has been tested... but not exactly put into a holistic solution, if you catch my drift.

    My P2 uses Parallax's 360feedback servos to control a gimbal which includes 7:1 gearing from ServoCity to improve the accuracy of the feedback position. On the gimbal is a pair of PropCams.

    This is roughly what it does.

    A Python nanny tells the P2 to move the servo a little and report back exactly where it is pointed. Next, the nanny tells the P2 told to take a stereo picture and send it over a serial line to her. The nanny sends the stereo image to StereopSys(My Opus:), which then launches parallel versions of itself to do stereo matching. The widely scattered matching data is then collated, vectorized and output as a .ply file. My homebrew computer for this is an 8 core AMD 2700x with sixteen threads... only 12 of which are being used for analysis. A 16 GB RAMdisk is used to speed up disk related tasks.

    This whole process isn't fast enough to tell your car to turn left, unless your car is on Mars and takes a day or two to do anything.

    Right now I'm hung up getting the PropCam lines elegantly passed through a Chinese slip-ring... and haven't decided if I want the 2 PropCams on the same gimbal with fixed convergence or go whole hog and make them independently posed.

    I know... sounds like a complete fabrication. One P2 Cog? Impossible right?

    You asked.
  • @rjo__ Stereo implies two, not one :) Impossible!
    But if it can't keep your Earth car on the road, what can it do?
    Would you call this an "off-road" device :)

    Why only 80Mhz then? Don't you have a real P2?

    We want videos, we want videos (do you mind holding my placard).
  • rjo__rjo__ Posts: 2,114
    @rjo__ Stereo implies two, not one :) Impossible!
    But if it can't keep your Earth car on the road, what can it do?
    Would you call this an "off-road" device :)

    Why only 80Mhz then? Don't you have a real P2?



    We want videos, we want videos (do you mind holding my placard).

    1. Well, if you leave the P2 serial image transfer out of it... quite a lot!!!

    I have been benchmarking. In order to support the numbers, I need a real demo.

    At 460,800 Baud... which is my nanny's limit, transferring the image from the P2 to the nanny takes about 2/3 of a second. One solution is to take serial image transfer away from the nanny and give it to more competent serial software. I don't know what that would look like speed-wise… but OzPropDev does:)

    A more practical approach might be to simply broadcast the image, with dedicated transmitters and receivers on both ends. That way your base station could have the nanny and your P2 could inhale the world around it.

    2. I do not have a real P2... I turned away for one instant and they were gone.
    Actually, I think it is your fault. I am a paying customer out here in the middle of nowhere.
    YOU Haven't FINISHED YOUR REVISIONS... AND YOU HAVEN'T POSTED A PRICE.... BLAH BLAH BLAH BLAH












  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-06-19 07:45
    rjo__ wrote: »
    2. I do not have a real P2... I turned away for one instant and they were gone.
    Actually, I think it is your fault. I am a paying customer out here in the middle of nowhere.
    YOU Haven't FINISHED YOUR REVISIONS... AND YOU HAVEN'T POSTED A PRICE.... BLAH BLAH BLAH BLAH
    Actually I had finished my R2 version but did the R3 version and got pcbs back a couple of weeks ago. I've had a couple of holdups getting an R3 assembled but if all goes well I will have at least a dozen made up this week. I was hoping to sort out the EFM8 USB software but I just can't seem to get into it so I will probably load the CP2102N chips instead. Price? I haven't costed it yet but it won't be much.











    [/quote]

  • @"Peter Jakacki", as I PM'd you I am OK with EFM8 (and RTC). I'll develop the USB by myself.
  • rjo__rjo__ Posts: 2,114
    Sounds good to me. Any chance I can get two?
  • jmgjmg Posts: 15,140
    I was hoping to sort out the EFM8 USB software but I just can't seem to get into it so I will probably load the CP2102N chips instead.
    Yes, it's a good idea to at least fit some CP2102N parts.
    I have some progress on EFM8 + VCPXpress - it is at the testing and tuning stage.


  • jmgjmg Posts: 15,140
    dMajo wrote: »
    @"Peter Jakacki", as I PM'd you I am OK with EFM8 (and RTC). I'll develop the USB by myself.

    Curious what do you have functioning on EFM8UB3 and USB ?
Sign In or Register to comment.