The Propeller microcontroller on the Activity Board (original [1] or WX [2] version) can be the brains for your own inventions, such as a robot.
It is the brains of the ActivityBot robot [3], for example.
So, what is a microcontroller? It is an integrated circuit (computer chip) that includes a tiny processor to do the “thinking” and some memory so it can keep track of what it is doing.
Microcontrollers also have input/output pins, I/O pins for short, that can exchange electrical signals with other devices such as lights, switches, beepers, motors, and sensors.
A single-core microcontroller has just one processor inside. A multicore microcontroller has two or more processors, also called cores, inside one chip.
A single-core microcontroller is multitasking when it executes several tasks that must share its single processor. The processor must interrupt each task to switch briefly to another, to keep all of the processes going.
Imagine a chef in a kitchen alone, making bread, roast beef, and sauce. The chef must knead the bread dough for 15 minutes, interrupt that task every minute to stir the sauce, and remove the roast from the oven as soon as a thermometer reaches 120 °F. At any moment, the chef (processor) is executing only one task, while keeping all three processes (kneading, stirring, roasting) going at once.
Now imagine being that chef. The more tasks you must do at once, the more difficult it gets to keep track of them all, and keeping the timing right becomes more of a challenge.
A multi-core microcontroller is multiprocessing when it executes several tasks at once, with each task using its own processor. This is also referred to as true multitasking.
Imagine a chef in a kitchen with three assistants, making bread, roast beef, and sauce. The chef puts one assistant at the stove to stir the sauce every minute. Another assistant is sent to keep watch on the thermometer, and remove the roast when it reaches 120 °F. Now the chef is free to knead bread dough for 15 minutes. The three cooks (processors) are keeping all three processes (kneading, stirring, roasting) executing at the same time, without any task-switching interruptions, and without missing the moment when the thermometer reaches 120 °F. There is even an extra assistant ready to help if something more is needed.
Multiple cores makes it easier to do many tasks at once, especially if precise timing is needed.
The Propeller microcontroller has 8 cores, and so can do multiprocessing, also called true multitasking. The cores are all the same. It has 32 I/O pins, which are also all the same. Each core can work with every I/O pin. This means that all of the Propeller cores and I/O pins are equally good at any tasks they must perform. Each core has a bit of its own memory. Each core also takes turn accessing a larger Main Memory, where they can share information.
Eight cores in one microcontroller might sound intimidating. It might seem complicated to have to write programs for all of them. But the Propeller C language has pre-written code tasks, called functions, that make it easy.
Just think of functions as recipes the head chef can hand over to assistants, instead of having to explain to each one how to cook. One assistant can even ask another assistant for help, without bothering the head chef. Just as a team of 8 chefs can efficiently manage great meals, the Propeller with its eight cores can efficiently manage great inventions. Now that's teamwork!
A C library is a collection of functions, sort of the way a cookbook is a collection of recipes.
A C program can use functions from many different libraries, just as a meal might use recipes from several different cookbooks.
So what does multicore processing look like for an invention like the ActivityBot?
Your C program might start a motor function, which makes another core manage the motors to make the robot move. Then, it might call a sensor function so the robot can “see” if there is an obstacle in its path. If an object is detected, your program then might call a music function, which will task other cores with the jobs of fetching songs from an SD card and playing music on an audio jack.
The ActivityBot [3]is just one example of a microcontroller invention. You can use the Activity Board to build other projects or create your own inventions.
Links
[1] https://learn.parallax.com/propellerab
[2] https://learn.parallax.com/PropellerAB-WX
[3] https://learn.parallax.com/activitybot
[4] https://learn.parallax.com/inspiration/propeller-1
[5] https://learn.parallax.com/propeller-c-tutorials