Pages: [1] 2 3 ... 6   Go Down
Author Topic: Building a dual MCU project with two ATmega328 chips  (Read 8415 times)
0 Members and 1 Guest are viewing this topic.
Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 24, 2012, 05:09:11 pm by BlueJakester » Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26551
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26551
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: July 24, 2012, 01:22:52 pm by CrossRoads » Logged

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.

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley 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.
Logged

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1836
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks Michael.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26551
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* DualAtmega328.png (56.34 KB, 1258x1079 - viewed 86 times.)

* DualAtmega328_layout.jpg (133.49 KB, 960x720 - viewed 61 times.)

* dual_1284_layout.jpg (132.13 KB, 960x720 - viewed 57 times.)
Logged

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.

Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26551
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

PM or email if you do it.

Thanks,
Jake

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26551
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, I'll review the design and see it it needs any tweaking based on things I've done since Idid these.
Logged

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.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8475
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1] 2 3 ... 6   Go Up
Jump to: