Mini-computer based on the Parallax Propeller microcontroller
Parallax microcontroller called Propeller , in comparison with the “classics” of the PIC or AVR genre, occupies a somewhat strange niche. About the first two, we can say that these are general purpose architectures. The creators of the same Propeller approached the question "from the flank." The main features of the Propeller:
8 independent cores working in parallel. Any time sharing required for shared memory resources or I / O ports is not controlled by the programmer and is embedded into the chip. This gives predictability in code execution time. Each core (cog) has 4K of its own isolated RAM. Also, each core has a built-in hardware module for generating (note!) A TV or VGA video signal.
No concept of interruptions. Instead, it is proposed to run competing tasks in different kernels (cogs).
You can program either in assembly language or in a special high-level language Spin, which greatly simplifies multi-core and parallel programming. Spin interpreter is sewn into the crystal.
Almost no concept of programming or firmware crystal. The upper half of the address (ROM) space of 32KB is stitched by the Spin interpreter and various system tables. In this case, each time you turn on, you need to download the program from the outside (for example, from the development environment) to the lower area of 32KB (RAM). But usually in real use, an external I2C memory chip EEPROM is connected, the contents of which are automatically copied to RAM when the crystal is turned on.
The processor is declared as 32-bit, since it operates with data of this size, but the address space is 16-bit (64KB).
The Spin language is designed for convenient multiprocessor programming, and looks like a cross between a procedural and an object-oriented language.
Here is an example of Spin code that starts the function spinning on several cores. The code is really simple and straightforward.
CON _clkmode = xtal1 + pll16x 'Establish speed _xinfreq = 5_000_000 '80Mhz OBJ led: "E555_LEDEngine.spin"'Include LED methods object VAR byte Counter 'Establish Counter Variable long stack[90] 'Establish working space PUB Main cognew(Twinkle(16,clkfreq/50), @stack[0]) 'start Twinkle cog 1 cognew(Twinkle(19,clkfreq/150), @stack[30]) 'start Twinkle cog 2 cognew(Twinkle(22,clkfreq/100), @stack[60]) 'start Twinkle cog 3 PUB Twinkle(PIN,RATE) 'Method declaration repeat 'Initiate a master loop repeat Counter from 0to100'Repeatloop Counter led.LEDBrightness(Counter, PIN) 'Adjust LED brightness waitcnt(RATE + cnt) 'Wait a moment repeat Counter from 100to0'Repeatloop Counter led.LEDBrightness(Counter,PIN) 'Adjust LED brightness waitcnt(RATE + cnt) 'Wait a moment
The cognew function runs a task on three cores, parametrizing each with its own frequency and stack. ')
Simplified The propeller is arranged as follows:
The name "Propeller" comes from its model of transferring priority to access to shared resources. The time-sharing module Hub does this in a circle, such as a spinning propeller.
I do not want this article to delve into the Propeller itself, for this is a big topic. For those interested in the end there are links to books in which you can get detailed information about this microcontroller.
But I want to talk about one interesting project called " Pocket Mini Computer ". This is a Propeller based mini-computer (P8X32A) using the “P8X32A QuickStart” evaluation board.
It looks good as follows (photo from the official site):
In fact, the author sells the evaluation board plus an expansion board, which has VGA, microSD, PS / 2, sound and Wii Gameport. Optionally, you can put the SRAM RAM chip to 32KB.
The point of the project is that the author has developed a BASIC interpreter that turns it all into a micro computer a la 80s. BASIC is written in Spin'e (the source is open ). The dialect is very limited, for example, there are no arrays, string and real variables, variable names are only one-letter, etc. Nevertheless, access is given to all peripherals, including the SD card, and also allows you to run purely binary files that can be written even on the same Spin'e, even on C (Parallax has a GCC version for Propeller), even on assembly language
Next, a few photos of the designer to make it clear what is given in the set. As I said before, the PMC base is the ready-made P8X32A QuickStart, so you only need to solder the expansion card.
Almost everything is soldered.
Sandwich assembly.
Here is a small demo to evaluate the graphics capabilities.
General impressions
Propeller
I can't call it a general-purpose processor. In my subjective opinion, in order to use the Propeller effectively, you need to understand your applied task very well. For example, the Propeller does not have PWM, D / AC, built-in flash memory, triggers, interrupt concepts, and the creators suggest either to implement the necessary software using the power of several cores or to use specialized external circuits. In the books given at the end, many examples of working with additional microcircuits are described.
Interesting is another. The creators of the Propeller did not forget to deviate from the traditional approach and tried to put concrete applications, almost ready-made tasks, into the crystal. Maybe for some projects this will come in handy. As I understand it, the Propeller is very convenient for creating various kinds of gaming machines and consoles, for example, because of the built-in ability to generate a high-quality television and VGA signal.
Conclusion : an interesting architecture, definitely worth a look.
PMC Constructor
Again, a double sensation. It seems to work, but BASIC obviously lacks resources, especially memory. For example, the same PIC32- based Maximite surpasses it. It can run at least RetroBSD , even Radio-86RK . And the built-in MMBasic is incomparably more powerful.
Although, for $ 39 - this is a great toy for those who want to feel the Propeller, having already assembled the device.
For a snack
Books on the Propeller, which I read, with regards to architecture, and overlooked (with regards to projects). I recommend everything.
A small and very understandable book for beginners. Described (with pictures) interesting projects. One of the co-authors is a PMC designer.
Extremely competent book in terms of architecture and understanding of the essence of the Propeller. It considers only Spin programming, but with a full explanation of the approaches and features of the microcontroller. After reading the first chapter, you will get an almost complete understanding of the architecture. The following are a few projects (you can skip this).
At the time of this writing, the first book is only available in Kindle format on Amazon at a price of two dollars, but the second and third books can be found if you search.