Shop OBEX P1 Docs P2 Docs Learn Events
Any ideas for P2 demos? — Parallax Forums

Any ideas for P2 demos?

What would be good to show the P2 doing? I'm trying to think of some things that it can do uniquely well, without a lot of effort and code. We need some vehicles for getting the idea across to the world.
«1345678

Comments

  • I haven't had time to make this yet, but a 'radial scope' where the analog signals on every pin head towards a central vortex in the middle of the screen.
  • roglohrogloh Posts: 5,122
    edited 2020-02-08 05:40
    You probably need to focus on the real strengths of the P2...

    -Flexible I/O mapping, something that hot swaps/auto detects and reconfigures could show this.
    -Video generation VGA/composite/component/DVI - multiple simultaneous outputs
    -DACs/ADCs on any pin
    -High bandwidth streamer - eg. capture DVI parallel output in real time, or other logic analyser demo
    -ADC scope modes
    -Smartpin modes for serial transfers, clock generation, USB etc
    -Multiple language environments, Forth/C/PASM/Spin2/Python
    -High bandwidth memory transfers
    -Real time guaranteed/deterministic code timing

    How to bundle it all together in something that gets the full idea across is the real challenge.

    Edit: Oh I and I forgot, the Goetzel and CORDIC stuff of course. Your finger sensing demo is good for that.
  • evanhevanh Posts: 15,126
    Protracker clone.
  • roglohrogloh Posts: 5,122
    edited 2020-02-08 06:15
    I thought the same @evanh. It wouldn't be hard to take Ahle2's code and get it to display video text/gfx for the sequencer and scroll it in time with the audio, especially if the video frames are driven at 50Hz instead of 60Hz, to match the audio. But that would only take 3 COGs. We really need to combine with something else to display in another video region, perhaps a second song playing on other pins. In fact you could probably have 6 player COGs, an audio mixer COG and a video COG, though you'd likely start run out of HUB RAM with mod files until we get HyperRAM fully up and going. Might be better to combine it with something different.
  • cgraceycgracey Posts: 14,133
    > @evanh said:
    > Protracker clone.

    That's the Amiga sound program, right?

    We must find a sure way to interest young people. What would get their attention? I made a cool VGA text driver to test Spin2 on and it works great, but I think it might look hopelessly dated to younger people. We need to interest them somehow. How to get it across to them? I suppose the P2 ought to commune with their smart phone somehow.
  • evanhevanh Posts: 15,126
    cgracey wrote: »
    That's the Amiga sound program, right?
    Yep, the creation tool. They worked like a sequencer but only used sampled sound, no MIDI nor synth support. The original commercial package was called Sound Tracker. Came with a set of discs full of sampled instruments. Targetted at building compact title/loader music and in-game sound tracks. The Amiga only had the four DMA'd PCM audio channels therefore that's all Sound Tracker supported. All the others built on that - from disassembled binary I suspect. ProTracker being the most popular by the early 90s. Heavily used in the demo scene.
  • potatoheadpotatohead Posts: 10,253
    edited 2020-02-08 06:59
    Yup. Would be impressive. And fun. I am flirting with doing some composition in one of those programs.

    I like the better tunes I have heard. And it is a really different way to think about music.

    Signal generator demo? With stats, using that spiffy calculator Chip made. Freq % jitter / error, etc.

    Scope mode plus logic analyzer? We have those. Running them together might wow people.
  • Maybe you could do a real time FFT/IFFT or other signal processing on the output audio waveform and display graphically on another region or using it to affect your cool image rotation demo while the music plays, or on another independent screen. Maybe you could add some input control using the Goetzel board and do some funky Theremin effects etc in real time on the music as it plays. Maybe you could show a real time oscilloscope view sampled from the output pins.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2020-02-08 07:43
    My idea isn't a code project, it is a tool to demonstrate how using
    the Propeller 2 is easy, and writing Propeller 2 programs can be
    easy too.

    Adapt Sigrok "PulseView" and it's protocol decoders as a free tool
    for students to use with the Propeller 2.

    Combine Sigrok and a flexible standard library.


    Bill M.

    Perhaps Sigrok can open up more possibilities to students.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-02-08 08:53
    How about a self-hosted scope (with FFT and frequency counting) + logic analyzer + signal generator while playing music and running a hdmi/vga monitor and keyboard while hosting web pages?
    Sure, there are micros out there that can do some of that but I don't think any can juggle all that stuff in real-time.
  • jmgjmg Posts: 15,140
    My idea isn't a code project, it is a tool to demonstrate how using
    the Propeller 2 is easy, and writing Propeller 2 programs can be
    easy too.

    Adapt Sigrok "PulseView" and it's protocol decoders as a free tool
    for students to use with the Propeller 2.

    Combine Sigrok and a flexible standard library.
    Bill M.
    Perhaps Sigrok can open up more possibilities to students.

    One possibility is to have sigrok talk to a P2 board, and so allow P2 to become the Logic Analyser.
    That is a code project.
  • JonnyMacJonnyMac Posts: 8,912
    edited 2020-02-08 17:42
    Simultaneous playback of two WAV files (stereo or mono) from an SD card. It's okay to force the files to be the same sample rate, but if they could differ, that would be great.
  • Back in the days of the P1, there was a graphics demo that could draw lines and shapes and text on a screen. Would be nice to have an update of that which will work with the plethora of TFT and OLED screens available for micros now (it's hard to find a convention badge without one).
  • Some sort of graphics demo? I imagine one can blit many hundreds of 8bpp sprites with SETQ+WMLONG.
  • cgraceycgracey Posts: 14,133
    > @Wuerfel_21 said:
    > Some sort of graphics demo? I imagine one can blit many hundreds of 8bpp sprites with SETQ+WMLONG.

    If font pixels were stored as bytes, that would be a very good way to write a font into 8bpp display memory.
  • It's a good way to write any non-opaque graphic into an 8bpp line/frame buffer. Moreso large sprites or tiles than text, since an 8xY character would just take 2 LONGs per line, so more time spent on overhead than actually letting the hardware do the blitting.
    It can't easily handle horizontal mirroring though. Vertical mirroring as well as vertical stretching and shearing, are easy.
  • cgracey wrote: »
    We must find a sure way to interest young people. What would get their attention? I made a cool VGA text driver to test Spin2 on and it works great, but I think it might look hopelessly dated to younger people. We need to interest them somehow. How to get it across to them? I suppose the P2 ought to commune with their smart phone somehow.

    Or an open-source smartwatch?
  • Chip, I think the best demo you could do is the one we discussed:

    A standalone board design with USB host for a keyboard/mouse and an HDMI output, with an SD card for storage.

    You could make the software for this to run on your existing demo board, but ultimately a Raspberry Pi Zero formfactor (Quickstart?) would be an ideal embodiment of the P2 for real users.

    A bunch of I/O pins (Pi has 40 pins, you'd have USB, HDMI, SD, etc and still have pins leftover) and an on-board dev environment would make the system very usable.

    The SD card could have a autoexec.bin or startup.bin containing a loadable program that the P2 could run, so people could deploy these after development is done.

    The SD also bridges the interoperability gap.

    No harm in putting an ESP32 on there as a Wifi bridge too, opens the opportunities up.

    But you really need to write and show reference implementations of USB, HDMI, etc so people can get a foothold.
  • I don't have an answer to compete with the cellphone and app store crowd.
    If you can dream it, you can get it on your cellphone. Is Bluetooth pairing still a nightmare even with 4.0?

    A few ideas for a few different audiences...

    Those destined to be engineers:
    The idea is that, eventually, a select few ask how all this stuff actually works.
    For that crowd, all you need is the simple things: an easy to install editor with commented example code that gets them started.
    You aren't stating 200 MHz loud enough. TWO HUNDRED MHz, 8 CORES. 5 nanoseconds update rate of 60 I/O PINS at that speed.

    There's the indie crowd:
    Port plasma pong. But you can't call it that, because Atari hands out cease and desists like Halloween candy. Call it fluid table tennis.
    Here is a simple website example (use the WASD keys).
    http://anirudhjoshi.github.io/fluid_table_tennis/#
    But the real version used mouse control and had sliders to tweak the physics and put objects down in the playfield.
    I know CORDIC is up to the task here for fluid simulation. Interpolate for whatever grid size for rock-solid 60 fps.

    There's the enthusiast crowd:
    Honestly, you don't have to agree with the imagery in DOOM (I don't), but if you can port DOOM to the P2 and have it be playable, you can get in the tech news on every major website in the world. Note: it HAS to be DOOM, exactly. No "kind of looks like it". No tech demo. The FULL thing. Use the SD card and parse the WAD level files, and at least 8 MB of whatever RAM you need: SRAM, SDRAM, HyperRAM. You will be judged at how much better than a 486 your chip is, by a very technical crowd very familiar with every aspect of DOOM. I'd say port over Quake 1 but that would be "Impossible".
    https://github.com/id-Software/DOOM

    There's the kinesthetic crowd:
    Some kind of crazy modular synthesizer.
    Internal oscillators and an audio microphone and line input as well.
    Some way of patching in and out effects graphically. (draw patch wires with mouse click and drag).
    Save/load settings in bulk storage like SD.

    Maybe doing something cool with Goertzel position sensing as a theremin that's more stable or can be calmed down (recalibrated) easily. Unfortunately requires specific hardware or instructions on making antenna system from a cardboard box or 3D printout or even legos. Not disappointing like the accessory board because it's too small. At least 5x5 inches (hand-sized).

    Have the sounds in certain frequency ranges trigger on/off to certain effects (Goertzel again). Do the dumb auto-tune voice effect.
    Do voice record/playback. Let us mess with the speed and otherwise filter and distort the audio. Hilarity ensues.

    There's the internet meme crowd:
    Control a ripoff version of Superman N64 "solve my maze" where you flop around and fly poorly in crude 3D, fighting the controls and getting severely punished for missing the rings you're supposed to fly through. Gain notoriety and offer the source code so people can "fix it" (break it further, actually). Do something awful like use an accelerometer (fall back to mouse and keyboard control) so the player is never totally in control.
    Nyan cat was actually a very cool demo on P1, but that's too old now. Minimum is Playstation level (320x240x8 3D). Think of janky and grainy graphics of the PS1 era silent hill or twisted metal games.
    Now that you have CORDIC, fast multiply, and high clock speed, texture mapping is entirely possible. Even without that special texel unit circuit that P2-hot had.

  • I have been working on a all band SSB and CW ham transceiver for about a year now. I am currently using the P1 FLiP module - but the next gen will use the P2 with all its new features. Currently I am doing a P1 motherboard with an added RF daughter board to prove out each individual circuit(s). Details change every day with new ideas and capabilities that the P2 can ultimately do for a demo. I really need a P2 FLip module (hint) But hopefully by May I will be ready for a booth at the the Dayton, Ohio, *Hamvention*
  • Wuerfel_21Wuerfel_21 Posts: 4,374
    edited 2020-02-09 00:31
    Oh yeah, Doom would be rad.

    It actually only needs 4MB RAM on DOS, not sure how that translates to P2. (DOS Doom runs under DPMI, so I wonder if it uses/needs the bottom 640K at all? However, that doesn't include the 256K of VGA memory a DOS PC has. Altough IIRC it renders to a buffer in main RAM and then just blits that into VGA memory in a sortof triple-buffering setup - maps well to external RAM on P2, so we only need to keep one ~64K work buffer in Hub RAM. Also not sure what actually hogs the main memory - I'm thinking the majority is textures(most of them are pretty small, but IIRC all textures used for thing sprites (monsters,decoration,pickups,projectiles,explosions,etc), as well as menu graphics are loaded at all times, so they add up quickly), which are efficient and easy to load from external RAM (especially if a draw command queue is implemented, so texture fetching can happen in parallel with rendering). Level data on disk is in the <200K ballpark, but I think it shrinks a bit when loaded (since texture names get converted into short array indices. OTOH, a lot of other indices in the files get converted into pointers, so IDK))
    P2 likey has way better raw integer performance on a single cog than ye olde 486, but as always, memory is in short supply.
  • cgraceycgracey Posts: 14,133
    Lots of good ideas here.
  • jmgjmg Posts: 15,140
    I like the instrumentation uses, as those can demo well, and have immediate practical uses as a bonus.

    It depends a bit on how much added hardware you are prepared to add, for the demo to work ?

    eg This stepper motor driver (18V/2A) has a 25MHz SPI link, as well as Step/Dirn and microstepping.
    The Link takes a 32b word, and seems to have 10b quadrature DACs, so could support ROM calibration of motors.

    Voltmeters & Frequency counters are easy to do with a basic P2, and a Signal Generator is a means to verify those work.
    It would be nice to see some DAC Signal Generator measurements, around noise floor and distortion.
    Adding a Stereo Audio Codec, should allow a higher performance Audio tester.

    I also saw new parts added to Alps linear position sensors - they have dual-wiper 360' models, and linear models to 40mm, plus high rating models (price goes up, of course)
  • cgraceycgracey Posts: 14,133
    edited 2020-02-09 05:42
    jmg wrote: »
    I like the instrumentation uses, as those can demo well, and have immediate practical uses as a bonus.

    It depends a bit on how much added hardware you are prepared to add, for the demo to work ?

    eg This stepper motor driver (18V/2A) has a 25MHz SPI link, as well as Step/Dirn and microstepping.
    The Link takes a 32b word, and seems to have 10b quadrature DACs, so could support ROM calibration of motors.

    Voltmeters & Frequency counters are easy to do with a basic P2, and a Signal Generator is a means to verify those work.
    It would be nice to see some DAC Signal Generator measurements, around noise floor and distortion.
    Adding a Stereo Audio Codec, should allow a higher performance Audio tester.

    I also saw new parts added to Alps linear position sensors - they have dual-wiper 360' models, and linear models to 40mm, plus high rating models (price goes up, of course)

    Yes, I think motor control could be really good to demonstrate. It does require some hardware to show, though. I wonder if we could demonstrate some motion control concepts which have important application, but could be done with some simple, small motor/encoder hardware. Something that would obviously scale up to much bigger power. We could have live (even 3D) graphics to show the system metrics during operation. Kind of like a control system and specialized oscilloscope, all in one.
  • cgracey wrote: »
    What would be good to show the P2 doing? I'm trying to think of some things that it can do uniquely well, without a lot of effort and code. We need some vehicles for getting the idea across to the world.


    Chip, Ken,

    A "winding machine".

    Something that probably any other microcontroller can do (P1). And something that will not make P2 stressed at all. But I think that P2 has some special features that will made it very simple (like smartpins modes and CORDIC).

    It is also something that probably Parallax can sell as Kit, as I think that all main components (IR Sensors, motor, servo, ...) are already on current Parallax shop website.

    Applications: (What can you do with an coil winding machine?)

    Make/Repair a speaker coil :
    Guitar coil/pickup :
    Inductor/Coil :
    Solenoid Motor coil :

    Added below some Winding Machine examples (some of them very ingenious) with a brief description of interesting design concepts:

    A very nice project ( ) with:

    OLED display and rotary encoder (0:26s-0:35),
    Winding control with Motor and Screw guides reused from old DVD (1:37s-1:43s)
    wire guiding tool made from a screw (2:17s -3:45)
    IR encoder used to count turns (10:11s - 10:45s)
    (another use for that Sharp GP2A25J0000F sensor that parallax has put on early Spring cleaning area just days ago)

    Similar concept :

    In this project, the first minute shows how a simple switch is used to reverse winding direction:

    On this one, second 45 shows how a servo is used to reverse winding direction:

    Another video that shows a servo to control winding motion control. Also possible application of CORDIC engine (look nice coil at the end) :

  • cgracey wrote: »
    jmg wrote: »
    I like the instrumentation uses, as those can demo well, and have immediate practical uses as a bonus.

    It depends a bit on how much added hardware you are prepared to add, for the demo to work ?

    eg This stepper motor driver (18V/2A) has a 25MHz SPI link, as well as Step/Dirn and microstepping.
    The Link takes a 32b word, and seems to have 10b quadrature DACs, so could support ROM calibration of motors.

    Voltmeters & Frequency counters are easy to do with a basic P2, and a Signal Generator is a means to verify those work.
    It would be nice to see some DAC Signal Generator measurements, around noise floor and distortion.
    Adding a Stereo Audio Codec, should allow a higher performance Audio tester.

    I also saw new parts added to Alps linear position sensors - they have dual-wiper 360' models, and linear models to 40mm, plus high rating models (price goes up, of course)

    Yes, I think motor control could be really good to demonstrate. It does require some hardware to show, though. I wonder if we could demonstrate some motion control concepts which have important application, but could be done with some simple, small motor/encoder hardware. Something that would obviously scale up to much bigger power. We could have live (even 3D) graphics to show the system metrics during operation. Kind of like a control system and specialized oscilloscope, all in one.

    This is some good imagineering. A motor controller with a built-in useful display...something better than what I'm currently working with:



    3072 x 4096 - 5M
  • Was in the pub the other day and I overheard a conversation between a couple of guitarists. One of them was complaining that his $10,000 guitar (!!!) went out of tune constantly. I couldn't help but jump in to brag about my auto tuning guitars and, of course, they'd never heard of such a thing.

    I put them on to the YouTube videos of the Peavey AT-200 and they were gobsmacked. Even more so that the product had been dropped.

    Hex piezo pickups are readily available and are attached to any guitar via a velcro strip.

    A P2-based kit that could be attached to any guitar would be very popular and a great vehicle for publicising the P2.

    Auto-tune is only one feature. There are many, many possibilities that can be instantly activated via footswitches or alternatively by plucking the appropriate string/fret whilst depressing a button on the guitar. Listing attached.

    If I had the ability, I'd be all over this. I have been playing for 46 years, fallen for all the expensive BS such as "tone woods" and "warm, creamy, buttery" tube amps.

    Dumped all of that horse hooey but I'm keeping my 3 Auto-tune guitars 👍


  • Guitar stuff would be gratifying to the younger crowd. A ramped up version of the Coyote would be cool:
    https://forums.parallax.com/discussion/101493/project-openstomp-tm-coyote-1-guitar-effects-pedal/p1
    I'm thinking delay with the built in A/D and D/A with some HyperRam would bring parts count down, (minus some filtering).
  • There is a difference between "demo" and "product". The demo should be able to run on the P2 eval board.
  • potatoheadpotatohead Posts: 10,253
    edited 2020-02-09 19:34
    Variations on that with a mic might be

    Voice transformer

    Sing along pitch corrector. On this one, do something silly like, "Mary had a little lamb", and no matter what they try to sing, it's "Mary had a little lamb" (in terms of pitch, not diction)


Sign In or Register to comment.