Author Topic: Multi-core MCu's  (Read 11062 times)

0 Members and 1 Guest are viewing this topic.

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Multi-core MCu's
« on: April 25, 2013, 12:10:54 pm »
I was looking into the Propeller 8-core (cog) MCU and found the idea of true multi tasking excellent.
I was not so taken with the actual solutions of Propeller. So:

Are there any other MCU's that do hardware multi-core processing?

I do mean MCU's not MPU's - so I expect some built in memory and IO and around the 48-pins range (or so).

It is for a R&D Robot project.

Thanx,
Marc
Wrong code should not compile!
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14861
  • Country: gb
    • Mike's Electric Stuff
Re: Multi-core MCu's
« Reply #1 on: April 25, 2013, 12:15:09 pm »
XMOS do some powerful low-cost multicore devices.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #2 on: April 25, 2013, 05:40:12 pm »
XMOS looks very promising. Thanx!  ;D
Wrong code should not compile!
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30440
  • Country: nl
    • NCT Developments
Re: Multi-core MCu's
« Reply #3 on: April 26, 2013, 05:49:37 pm »
NXP has some dual core ARM controllers (LPC4300 series). These also have an FPU which could make it a lot easier to do some hefty processing. Perhaps its better to use a high end board like a Beagle board. In R&D projects you might want to concentrate on the real problems first and optimise / miniaturize later.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline flynnjs

  • Contributor
  • Posts: 24
  • Country: gb
Re: Multi-core MCu's
« Reply #4 on: April 26, 2013, 07:39:17 pm »
Freescale Xgate coprocessor?
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #5 on: April 29, 2013, 07:25:11 am »
NXP has some dual core ARM controllers (LPC4300 series). These also have an FPU which could make it a lot easier to do some hefty processing. Perhaps its better to use a high end board like a Beagle board. In R&D projects you might want to concentrate on the real problems first and optimise / miniaturize later.

I do agree on having a heavier board for R&D, I think you would want to keep the architecture the same (so you can use code you tested during R&D phase?). I understand that the Beagle Board runs Linux and that is not the platform I'm looking for. I'm also looking for low-cost. I am familiar with PIC and AVR...

Freescale Xgate coprocessor?

Nice! Thanx.
Wrong code should not compile!
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: Multi-core MCu's
« Reply #6 on: April 29, 2013, 12:36:26 pm »
MCU like PIC and AVR  really don't have anything they would be doing that requires more cores. The chips are so cheap that it is easier to just add another chip for the task and programming is much easier that way too.
 
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #7 on: April 29, 2013, 12:42:55 pm »
MCU like PIC and AVR  really don't have anything they would be doing that requires more cores. The chips are so cheap that it is easier to just add another chip for the task and programming is much easier that way too.

Yes, that is one option that crossed my mind also - especially when I read this thread about bottom dollar MCU's. One aspect that I am not sure on is how you would coordinate these separate MCU's into doing one 'task'. With multi-core MCU's I was hoping that there would be some 'services' for that - and with XMOS and Propeller there seem to be.

So how would you propose that these separate MCU's communicate to each other or a central brain?
Wrong code should not compile!
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: Multi-core MCu's
« Reply #8 on: April 29, 2013, 12:57:23 pm »


So how would you propose that these separate MCU's communicate to each other or a central brain?

It is hard to say without knowing the target application. If you  wanted to sync code operation you could do it with clock signals, almost all MCU support that option. If you wanted to do it based on a task each chip was performing you could use a single pin for passing messages between the chips.
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #9 on: April 29, 2013, 02:42:49 pm »
Its for a R&D Robot project. The (ultimate) idea is to have modules that do their own processing that can be plug-&-play'ed into the system. Think of a single leg as module that manages its own movement of several servos/motors. Or a set of sensors as module that provide directional proximity detection. Or a video camera that interprets the video signal and fires events for certain (configurable) conditions.

I figured I would have a bus running through the robot that would communicate on an (more) abstract command level. Each module would know if that command was for them or not and how to interpret that command into the specifics for that module.

A central brain would coordinate the different tasks among the modules. This would be the multi-core MCU - one core for coordinating each type of sub-system (movement, sensors/feedback). But I was also planning on experimenting with running separate cores for each algorithm. So location awareness, path finding, sensor interpretation and such. But this might change once I start writing this code and experimenting with this setup.
Also all these MCU's would be as small as possible.

One of the safest ways to use 'multi-threading' is not to share state and use message based communication. So in that sense - using separate MCU's and a central Bus would fit just fine.

Any suggestions are most welcome.
Wrong code should not compile!
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 9056
  • Country: us
    • SiliconValleyGarage
Re: Multi-core MCu's
« Reply #10 on: April 29, 2013, 02:54:44 pm »
Take a small fpga and instantiate as many soft cores as you want. Some cores are really tiny
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Multi-core MCu's
« Reply #11 on: April 29, 2013, 02:56:52 pm »
Take a small fpga and instantiate as many soft cores as you want. Some cores are really tiny

 :-+ I second this.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #12 on: April 29, 2013, 03:20:51 pm »
I am sure that is a fine solution. Problem is that I do not have a clue about FPGA's (sort-of, kind-of know what they are, but that's about it).

Steep learning curve to get started with FPGA's??
I know about software writing at all levels (assembly, C/C++/C# etc).
Wrong code should not compile!
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14861
  • Country: gb
    • Mike's Electric Stuff
Re: Multi-core MCu's
« Reply #13 on: April 29, 2013, 05:09:15 pm »
Steep learning curve to get started with FPGA's??
Very.
FPGAs would not be a very appropriate solution for this type of problem.
Multiple processors, multiple cores or multiple tasks on a sufficiently powerful single processor are all better solutions.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #14 on: April 29, 2013, 05:13:56 pm »
Steep learning curve to get started with FPGA's??
Very.
FPGAs would not be a very appropriate solution for this type of problem.
Multiple processors, multiple cores or multiple tasks on a sufficiently powerful single processor are all better solutions.

Pfjew!  :phew:
Wrong code should not compile!
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30440
  • Country: nl
    • NCT Developments
Re: Multi-core MCu's
« Reply #15 on: April 29, 2013, 09:23:40 pm »
MCU like PIC and AVR  really don't have anything they would be doing that requires more cores. The chips are so cheap that it is easier to just add another chip for the task and programming is much easier that way too.

Yes, that is one option that crossed my mind also - especially when I read this thread about bottom dollar MCU's. One aspect that I am not sure on is how you would coordinate these separate MCU's into doing one 'task'. With multi-core MCU's I was hoping that there would be some 'services' for that - and with XMOS and Propeller there seem to be.

So how would you propose that these separate MCU's communicate to each other or a central brain?
Do yourself a favor and don't go down this road especially when you are a beginner. Getting a multi-CPU system to work perfectly is a non-trivial task even for experienced programmers. You need mutexes and semaphores around shared data and all events between the processors happen asynchronously. Its better to run through all the tasks sequentally on one fast CPU. Maybe have 2 threads. One for real-time signal processing and one for generic control.

Over the years I've made quite some money cleaning up multi-microcontroller messes and re-designing products (some with up to 13 PICs). IMHO 'if you only have a hammer then everything looks like a nail' seems to apply to you. If PIC & AVR run out of breath you have to move to ARM. Actually you can use the Beagle board and re-use the code on a smaller controller later. Just stick with GCC. I often write & test code on a PC and then use it in a microcontroller project. Debugging on a PC is so much easier and for many projects you don't even need the hardware in the loop. Even better, you can replace the hardware with a simulation which takes the system to the limits so you can check for filter performance, loop stability, etc.
« Last Edit: April 29, 2013, 09:29:08 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #16 on: April 29, 2013, 10:13:39 pm »
[..] Over the years I've made quite some money cleaning up multi-microcontroller messes and re-designing products (some with up to 13 PICs). [..]

So, what is in your experience the most common pitfall and how do you repair these designs?

I often write & test code on a PC and then use it in a microcontroller project. Debugging on a PC is so much easier and for many projects you don't even need the hardware in the loop. Even better, you can replace the hardware with a simulation which takes the system to the limits so you can check for filter performance, loop stability, etc.

Me too. I write Unit Tests to exercise the code on the PC. What do you use for simulation?
Wrong code should not compile!
 

Offline MacAttak

  • Supporter
  • ****
  • Posts: 683
  • Country: us
Re: Multi-core MCu's
« Reply #17 on: April 30, 2013, 12:05:19 am »
[..] Over the years I've made quite some money cleaning up multi-microcontroller messes and re-designing products (some with up to 13 PICs). [..]

So, what is in your experience the most common pitfall and how do you repair these designs?


Honestly, the most common pitfall has got to be engineers that overestimate their own capabilities and think wrongly that parallel processing was appropriate at all in the first place. They paint themselves into a corner and don't realize how deep in shit they really are until it's too late. Repair usually involves ripping all of the multicore code out and replacing it with a more efficient algorithm that does the same job without resorting to multicore.

A pretty good rule of thumb: if you think it's easy then you're almost certainly doing it very wrong.

That's coming from the software side of things where I spend most of my time. I guess something like nctnico where I have made a small fortune over the years from cleaning up the mess after those designs fail... only in my case it's with high-volume server and desktop applications instead of microcontroller systems. We have a rather large consulting practice that is based on mopping up this kind of mess, and clients are thrilled to pay several hundreds of dollars per hour (often for weeks or months at a time) for the service.
 

Offline vvanders

  • Regular Contributor
  • *
  • Posts: 124
Re: Multi-core MCu's
« Reply #18 on: April 30, 2013, 02:12:35 am »
As someone who's built their career writing very time critical code shipping across millions of devices listen to nctnico. I've seen a lot of people go down the route of multicore looking for performance gains and inevitably they end up with worse performance due to locking contention/overhead than if they had just paid attention to cache locality and data access patterns.

If you want to learn by all means go ahead, but the only functional multithreaded systems I've seen built are people with years of experience(and that doesn't even go into lock free algorithms which are another order of magnitude harder).
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: Multi-core MCu's
« Reply #19 on: April 30, 2013, 03:57:18 am »
Its for a R&D Robot project. The (ultimate) idea is to have modules that do their own processing that can be plug-&-play'ed into the system. Think of a single leg as module that manages its own movement of several servos/motors. Or a set of sensors as module that provide directional proximity detection. Or a video camera that interprets the video signal and fires events for certain (configurable) conditions.


This system already exist in every modern car, the system is called CAN ,that is a system where you have modules in parts of the car doing their stuff and then reporting to the main controller.  When deciding if I want or need multiple cores I make the decision based on how much of the task performed will need access to the same set of peripherals. If I have MCU doing motor control I have no need for that motor control task to be part of the core controllers routines for processing video and finding a MCU to do all of those task on one chip wouldn't be the best design.  In some ways you can compare it to a human body, the organs are all independent functions that only require the brain to provide signals while the brain itself doesn't perform the task, imagine a human body that consisted of all the organs consolidated in one organ with the brain still controlling, it wouldn't be good.

 

Offline obiwanjacobiTopic starter

  • Super Contributor
  • ***
  • Posts: 1030
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Multi-core MCu's
« Reply #20 on: April 30, 2013, 07:19:47 am »
Thanks everybody. I understand your concerns and shouts of warning. I am an experienced programmer (20+ years) and also have experience in multi-threaded programming - although on a PC. I know assembly, C/C++/C#. I am a 'intermediate-beginner' in electronics though. But I know enough to a basic robot going.

The R&D part of this project is to see if I can build a system that is 'plug & play'. I thought that having modules with on-board intelligence connected to a Bus would be a good place to start. Think of these modules as separately sold products with which you can 'assemble' a robot of your own design. So I already have multiple MCU's. Another part of this project is to see if and how distributed intelligence might work. To develop a 'language' that all modules can understand and expresses the problem domain of the robot (control, feedback, interpretation etc).

I like the analogy with the human body. It also fits better with the modular concept I seems to be heading to. So perhaps the multi-core MCU will not make it into the design after all. (sorry  :o)

PS: I know about I2C, SPI and CAN busses etc. Thanx  ;)
Wrong code should not compile!
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30440
  • Country: nl
    • NCT Developments
Re: Multi-core MCu's
« Reply #21 on: April 30, 2013, 07:07:20 pm »
[..] Over the years I've made quite some money cleaning up multi-microcontroller messes and re-designing products (some with up to 13 PICs). [..]

So, what is in your experience the most common pitfall and how do you repair these designs?
Usually its thinking a PIC is suitable for anything  :-DD More serious: the biggest problem is the asynchronous nature of processes running on seperate controllers. That really confuses people. In general its nice to be able to divide a problem into several seperated pieces of software but there needs to be a way to convey data between the processes. In some projects I have uses an sqlite database to share information and multi-cast network messages to send events.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->