Is it practical to learn propeller in 2020 ?
CuriousOne
Posts: 931
in Propeller 1
Hello, long time since my last post here
I have a kind of question which I hope I can find an answer here. Before I ask, there's some intro about my level of knowledge.
1. I know BASIC programming language fairly well, started on ZX Spectrum and currently using PicBasic Pro.
2. I have no knowledge of C/C++ and so called "new" languages which use {}[];!=!X and other non logical operators, and want to avoid learning them at all costs.
3. I have some basic ASM knowledge, starting from Z80 times and some very basic PIC16 programming.
4. I tried to use Nextion displays, but their IDE is written with rear left feet, looks like bad copy of Visual Studio and works that way too. Not good.
PBP is indeed a great programming environment, but since Darrel Taylor passed away, no one bothers to develop new code to interact with "new" hardware, such as WS2812 leds, graphical displays and so on. Of course, there are some amateur(ish) code samples available, but they are far far away from perfection and usually either require very high speeds of hardware, or you can't do anything at same time, while say, driving WS2812 leds.
So I want to have a MCU, which can do the following at same time, without me using multi-level interrupts and counting clock ticks by hand, to making timings correct and ensuring everything will work fine.
Drive these color 320x240 displays, display different text, photos, shapes (I don't meant to have GUI like windows or Android, but say having 2-3 fonts at same time should not be causing any headache).
Read data from 2-3 quadrature encoders, quite high speed, up to 2khz input frequency signal.
Read data from 2-3 analog sources (8 bit precision is enough), 3-5 times per second.
Generate 3 separate PWM signals with different frequency and duty cycle (independently adjustable all)
Read time from DS3231 (once per minute)
Read temperature from DS18B20 (once per second)
According to need, drive say up to 100 WS2812 leds, TM1632 led displays, SHT11, DHT21, MAX7219, MAX6969, AD9833 and so on. I mean, the most common, hobby grade hardware which is currently supported by say Arduino libraries. When I asked back in 2017, there were no USB keyboard/mouse libraries available, so what's going on currently, any advances?
Thanks in advance!
I have a kind of question which I hope I can find an answer here. Before I ask, there's some intro about my level of knowledge.
1. I know BASIC programming language fairly well, started on ZX Spectrum and currently using PicBasic Pro.
2. I have no knowledge of C/C++ and so called "new" languages which use {}[];!=!X and other non logical operators, and want to avoid learning them at all costs.
3. I have some basic ASM knowledge, starting from Z80 times and some very basic PIC16 programming.
4. I tried to use Nextion displays, but their IDE is written with rear left feet, looks like bad copy of Visual Studio and works that way too. Not good.
PBP is indeed a great programming environment, but since Darrel Taylor passed away, no one bothers to develop new code to interact with "new" hardware, such as WS2812 leds, graphical displays and so on. Of course, there are some amateur(ish) code samples available, but they are far far away from perfection and usually either require very high speeds of hardware, or you can't do anything at same time, while say, driving WS2812 leds.
So I want to have a MCU, which can do the following at same time, without me using multi-level interrupts and counting clock ticks by hand, to making timings correct and ensuring everything will work fine.
Drive these color 320x240 displays, display different text, photos, shapes (I don't meant to have GUI like windows or Android, but say having 2-3 fonts at same time should not be causing any headache).
Read data from 2-3 quadrature encoders, quite high speed, up to 2khz input frequency signal.
Read data from 2-3 analog sources (8 bit precision is enough), 3-5 times per second.
Generate 3 separate PWM signals with different frequency and duty cycle (independently adjustable all)
Read time from DS3231 (once per minute)
Read temperature from DS18B20 (once per second)
According to need, drive say up to 100 WS2812 leds, TM1632 led displays, SHT11, DHT21, MAX7219, MAX6969, AD9833 and so on. I mean, the most common, hobby grade hardware which is currently supported by say Arduino libraries. When I asked back in 2017, there were no USB keyboard/mouse libraries available, so what's going on currently, any advances?
Thanks in advance!
Comments
The Propeller 1 can do all that peripheral stuff.
With 8 CPUs you don't need interrupts.
Now, the 320x240 display is possible from a timing standpoint, but if you want even 8 bit color and fonts, you're going to be RAM limited. 320*240=76,800, which is more than 2 times the 32KB of the P1. You could use SPI lcd screens with built in RAM.
As for compiler, there is the official Parallax supported propeller tool, that only does ASM and spin. And the other C stuff which you seem to be not interested in. Or the unofficial but highly functional flexgui suite that does compiled BASIC.
Spin doesn't have { } ; statements, but uses indentation. So how far from the left side means what statements are nested. (As opposed to end if, next, etc.)
Basic is fine, it's great, but you'll end up including spin language objects as again that's the official Parallax language.
Questions?
So, maybe I'd recommend getting started with P1 and then switching to P2, as soon as you can...
There is USB KB/Mouse support with P2, BTW.
Also, there's plenty of RAM for that 320x240 display.
2-3 fonts and photos etc is also pushing P1
2kHz Quad is not especially fast. P2 has Quad counters in HW, so you can have 20+ of those
PWM is also native in P2 hardware, but you could maybe manage a P1 fast timing COG that did your QuadCounters and SW-PWM and nothing else.
Take a look at what P2 can do here :
https://forums.parallax.com/discussion/171704/propeller-2-live-forum-early-adopter-series-topics-speakers-and-registration/p1
However USB HID is problematic on the P1 but possible, although P2 has a lot more memory and smarts and speed etc so is able to handle this.
You can easily use USB keyboards on the P1 if they are also PS/2 compatible, and there has been a resurgence of PS/2 for gamers. But I just use the same USB socket for USB or PS/2 and have a jumper to change the termination resistors. So you plug the keyboard directly into the USB socket but talk to it as a PS/2 keyboard without taking up a lot of resources on the P1. BTW, The USB to PS/2 adapter that ships with some of these is nothing more than a passive gender-bender (are we still allowed to say that?) and I would never bother with PS/2 sockets and those adapters.
With Tachyon loaded I do all of these things that you listed without having to recompile because all the runtime routines are preloaded with plenty of room to spare. You can think of Tachyon's routines as a built-in OBEX sitting in the P1 memory. Same too with TAQOZ on P2.
If it does have memory, you can do nice graphics with just P1.
If no memory, then can do 6bpp or 8bpp color pretty nicely with tiled 2bpp driver.
I’m pretty sure I’ve posted code for both ways here somewhere and also at Rayslogic.com.
So let's sort things.
1. USB HID (no I don't need and can't use PS/2 compatible hardware) - only with extra hardware
2. Color display - only models with own memory (can anyone tell me a model)
3. Encoders - OK.
4. ADC ?
5. PWM doable
What about support of these DS3231, WS2812b and so on? are libraries available?
DS3231 RTC
https://forums.parallax.com/discussion/170350/ds3231-demo-missing-from-obex
WS2812
https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/Pixel Driver (WS28xx & SK68xx)
Also, both of these have been discussed a lot on the forum, so just search here to find various examples. Same for any other common modules you want to use.
As for USB HID, I don't think you get it. I'm talking about many of those USB keyboards and mice that can internally (if not advertised) select PS/2 "protocol" or USB HID. They might not come with any adapter and they might not say that they are PS/2 compatible, but there on the "USB" connector are 4 pins, 2 of which are power and the other 2 are either D+/D- or PS/2 clock+data depending upon whether it detects pull-ups or termination resistors when it is plugged into a "USB" socket.
I have used displays in the past that had a SSD2119 driver chip that you could talk to in parallel or SPI, and they ran very well. Just look for this or for ILI9341 controller etc.
Here's a link to a Google pubdoc which I did about 8 years ago that used one of these displays.
BTW, ADC is normally done with SPI or I2C chips and so there is nothing special about interfacing these as many have been interfaced, the most popular being the MCP3208s etc although I always found it cheaper and better to use a $1 micro with A/D instead and load up the micro's firmware from the Prop over 1 extra programming line normally.
For the these DS3231 and others. I know their support is simple and I've done that in picbasic for a long time ago. But I'm asking for the different thing - are libraries for such devices readily available from IDE, or I have to scroll thru the forums and search and copy-paste others code?
For ADC, I see there is no built-in ADC in prop1, right?
Or, you can make a sawtooth ADC simpler, with caveats.
You seem to know a lot about your USB keyboards. From what I can tell, you can't tell, you have to try them. As for "please no more references for that" your first post said
If you continue to be so abrupt I think you will find that the help you are asking for may not be so forthcoming.
+1
Before I read any of this thread, I knew what to expect from @CuriousOne from past experience.
Yes, the late 70's and early 80's were great, weren't they? Truly the "golden age" of personal computing! Who could ever want anything more sophisticated than a TRS-80?
If you would like to be able to write in basic and include some spin objects, check our FlexGui over in the P2 forum. It also works on the P1.
Jim
and here my not fully fleshed out TACHYON driver/experiments (from 2016 I just see) for ILI9341 SPI-LCDs based on Peter's code.
Was working nicely for simple things without need for a display buffer.
should get back to it soon ...
+1 a bit more politeness please here in the forums if you want any help from others ...
It's clear, but now you're potentially in the realm of a Single Board Computer if you need specific USB drivers.
The Propeller 2 can do simple Keyboard/Mouse USB. For my own testing using a bluetooth adapter and a wireless keyboard/mouse worked very well, so things have advanced that far.
The Propeller may not be perfect, but this is where it kicks the tar out of other microcontrollers.
As has been pointed out, could be problematic for the P1 due to memory; the P2 would have an easier time.
I've done that in commercial products (motion platforms for film and video cameras). The code is written in PASM and runs in its own cog; the foreground object can read and even reset the encoder values at any time. I recently wrote a P2 object that can do this for any number of encoders without needing a cog (one of the smart pin modes supports encoder inputs).
I'm sure you know, there are no ADCs in the P1; for the camera motion platform we used an external ADC appropriate for the project. The neat thing about the Propeller is that I was able to write a cog that read and did a running average of the inputs to smooth out operator bumps; running in its own cog meant that code had no impact on the mainline timing.
For the P1 you'd have to write a PASM cog, but it wouldn't be very hard work. In the P2, any pin can be a PWM output (one of the smart pin modes), and you can set it to any frequency/duty-cycle independently per pin.
Yep. Drop it on the I2C bus used by the P1 EEPROM and Robert is your mother's brother; you can do I2C in Spin. The P2 uses flash instead of EEPROM, so you can select any two pins you want for an I2C bus.
Yes. The timing requirements of 1-Wire mean doing it in a PASM cog with the P1, but as I just demonstrated a few days ago, you can do the same thing using inline P2ASM in the P2 (no cog required for 1-Wire).
I was an early adopter of "smart LEDs" (back in the WS2801 days) and may have written the first Propeller driver for them. My jm_rgbx_pixel driver for the P1 works with any 800kHz device, and gets used by a lot of lighting pros (beyond me). I also have a driver for the APA102C pixels which are popular in film and TV for their higher PWM rate.
I think I've made my point, and I agree with Peter: there's enough of a code base that it's usually not difficult to get to where you need to go with a little adaptation. I love the Propeller, but recognize that it's not perfect for everything. Based on your hit list, I'm wondering why you're not considering a Raspberry Pi. I think it can do everything you want. You can configure it to enable 1-Wire interface through the kernel and it will automatically read the DS18b20 for you (low level stuff); I know this because I helped a friend who is a home beer brewer. Last Christmas I helped another friend with a lighting display that was controlled by an RPi, so I assume it has WS28xx drivers available, too. I know for a fact that the IO header has SPI and I2C connections.
Which product in the Arduino ecosystem can do everything on your list at the same time? That seems to be your requirement for the Propeller.
Yes. Are you being sincere, or is this just a troll? My LA skeptical side wonders....
And yes, I'm doing a motion controller for filming (not a commercial project, but for myself). I do have a somehow working prototype using PIC16F887A, but I had to reduce many things - like I'm using text-only 1602 LCD display, have to use own keypad for control, instead of plugging in standard one, can run only on limited speeds, because I bit-bang driving pulses in software and so on. Btw, built-in ADC in 16F887A works brilliantly, no need for extra chips
So as my understandings are, while P1 can solve some of my issues, others are remaining unsolved, and P2 maybe can help in the future, right?
P.S. I'm really surprised and glad to see P2 in silicon, I thought it went into vaporware stage, as BitBoys OY production did
But I might recommend you look at combining a Raspberry Pi with a microcontroller of your choice. You'll get easy support for screens, Python or any other language of your choice, and then use a serial cable for high-speed comms between the Pi and microcontroller. This would let you use the Prop (with Spin or Basic or whatever your language of choice is) for timing critical functions while the Pi takes care of the USB HID and memory-intensive tasks.
Well I have to say that I would prefer the new Maximite Colour 2. It's ARM based and runs interpreted BASIC ~270,000 lines/second. Perfect mate for the P1 and no clunky OS.
In my world, that's pretty much stopped
Might as well forego the motor, stick a sail on it and have it toss out an anchor.