Go Down

Topic: Building a dual MCU project with two ATmega328 chips (Read 10 times) previous topic - next topic

BlueJakester

Jul 24, 2012, 07:27 pm Last Edit: Jul 25, 2012, 12:09 am by BlueJakester Reason: 1
I've been thinking about having a project with dual '328 MCU and using I2C for comm between the two.  I did some Google searching and found this blog, where the builder made a shield with a second '328. My objective is to have a lot of I/O pins.

http://blog.makezine.com/2010/01/11/homebrew-dual-core-arduino/

Does the above tutorial look like the best way to approach such a project? Maybe I should build a single MCU project with a more powerful MCU, like an Arduino Mega?

Thanks,
Jake

tim7

It can be very convenient to use several microcontrollers in one project.  For example, certain manufacturers sell LED displays with an ATmega328 as a display controller.  I built a project with several of these displays plus an Arduino, in effect making a 5 "core" device.

In another project I built the Arduino has to handle two simultaneous tasks: a user interface (via encoders, buttons, IR, and LED displays) plus some timed loops running in parallel.  I had to write some fairly complicated code to ensure the interface is responsive without affecting the accuracy of the timers.  With hindsight the project would have been a lot easier with two Arduinos.

The communication method you use isn't important: it can be serial, I2C, SPI, or simple signalling via digital I/Os.

A more powerful chip can certainly reduce the need for multiple microcontrollers, but it's not necessarily an easier or even a cheaper solution.

CrossRoads

Or use a '1284. 32 IO, 2 UARTs, more SRAM than a 2560, still available as a DIP.
See my signature link for some examples.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

CrossRoads

#3
Jul 24, 2012, 08:21 pm Last Edit: Jul 24, 2012, 08:22 pm by CrossRoads Reason: 1
Or, add a bunch of shift registers to a '328. I think the last picture at my link is a board with 12 shift registers. 96 higher current, high voltage capable Outputs.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

BulletMagnet83

Some of the more complicated projects I have in mind would benefit enormously from having a dual-MCU setup. I think it's a perfectly reasonable way of handling complex tasks if, like me, you lack the necessary coding skills to pull it off with a single high-end chip and aren't all that bothered about minimizing hardware costs for mass production :) One such idea was for an 80s style drum synth, and while the current "solution" is to use one MCU for all input control scanning and display twiddling and a whole other one for sample playback, I am sure a decent programmer could do the whole thing on a single processor.

I suppose it depends what you're better at. If you're more comfortable with complex hardware than tricky code, then two Arduinos (or equivalent) might be a good way of approaching a problem.

BlueJakester

Thank you for the feedback gentlemen. CrossRoads, absolutely incredible looking boards on the page linked to in your signature.

Since I have the parts already and am an absolute beginner at this, I think I'll start off  by exploring communication between two '328 MCUs and work my way up from there; one on my Uno the other on a breadboard.

BlueJakester

Adding the link to an excellent I2C tutorial for comm between 2 or more Arduinos:

http://www.uchobby.com/index.php/2008/09/16/introduction-to-i2c/

MichaelMeissner

While it is a neat project, I wouldn't call it dual core, since the usual definition of dual core is two processors inside the same chip that share physical memory (and possibility caches, possibly not).

BlueJakester

Yeah, I agree. I picked up the "dual core" term during my Google searching. I think I'll rename it "dual MCU."

Thanks Michael.

CrossRoads

Here's a dual '328 design I ruminated on a while back but never implemented.
I have a dual '1284 done up too.
I wouldn't mind ordering a set of boards if there was some other interest.
About $4.50 a board to mail a single PCB out when they arrived.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

hoff70

I was also thinking about trying something like this only slightly different. Say have an Atiny 85 running/doing something as part of an entire assembly/sensor/module and having a pin or 2 output to a 328. Or have a 328 pin trigger the 85 to run some type of sketch.

Does this make any sense or does anyone see any big flaws with attempting this?

CrossRoads

That would make sense if you are remoting the funtionality someplace I suppose. Put the processing at the sensor source, send the results back via RS485 interface.  Or something.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

BlueJakester


Here's a dual '328 design I ruminated on a while back but never implemented.
I have a dual '1284 done up too.
I wouldn't mind ordering a set of boards if there was some other interest.
About $4.50 a board to mail a single PCB out when they arrived.



Very nice! You can count me in for one of the dual '328 pcb's if you have them made up. I might even take two :)

PM or email if you do it.

Thanks,
Jake


CrossRoads

Okay, I'll review the design and see it it needs any tweaking based on things I've done since Idid these.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

Quote
Say have an Atiny 85 running/doing something as part of an entire assembly/sensor/module...does anyone see any big flaws with attempting this?

No problems with that. I helped a friend design a board with a Mega256 and 4 Tiny84s. The 84s handled high-speed frequency/period measuring and they all worked as SPI slaves to the Mega.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up