Pages: [1]   Go Down
Author Topic: Two Arduino's One Board?  (Read 699 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well i decided to make a Laser-Tag system based on the Arduino. I want this to be as low budget as possible. Therefore i want to build an Arduino. (http://www.arduino.cc/en/Main/Standalone) This costs about $5, that is why i want to build it. While thinking about this an idea came into my mind. I would be able to have twice the processing power on my custom board if i add another Arduino to it. I want to do this so one can focus about shooting and one about reciving and sending data. I have had trouble with the IR library, At first i tried to have one Arduino Sending and Reviving IR signals between itself. That did not work out, It did not receive the signals it sent. Now i am wondering, What parts can the Arduino share if there are TWO ATmega328 chips on one board. I mean like can they share the Voltage Regulator, Resistors, etc..

Can anyone help me out? P.S. If you know how to make the Arduino be able to send and receive IR signals between itself, I would be glad to hear it.

Thank You!
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Contact @CrossRoads.  I believe he still has some Dual 328 boards for sale...
http://arduino.cc/forum/index.php?topic=124573.0
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't see what would stop you having a couple of Atmega328s on one board. They could share most stuff, like the voltage regulator, etc.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea so specifically what parts would they be able to share? I know for sure they cannot share the 16MHz Crystal. Like if they can share the resistors would it be good with the current ones or would different one be needed for the share?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't have to use a crystal, but if you did, yes it wouldn't be shared. What resistors did you have in mind? A bare board doesn't really need any except possibly a pull-up on reset, which you probably wouldn't share, although maybe you could if you wanted to reset them both at once.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why do i not need to use the clock Crystal? I thought the ATmega chip needed that. Can you please Elaborate?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can run it off an internal 8 MHz oscillator. You lose a bit of accuracy in the clock, and it is half the speed of a 16 MHz crystal, but you don't need the extra part (the crystal, plus the capacitors).
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26554
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

Leave off the crystals and other parts you don't want, such as RS232 driver.


* dual_328s.jpg (110.3 KB, 829x539 - viewed 12 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.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually - though it isn't recommended in the datasheet for the 328 - you can share a clock crystal; I remember somebody doing it back when the old forum was up (so the thread should still exist somewhere). It probably isn't very stable long term; it was really done as something "to see if it could be done" - and not meant for an actual design.

IIRC, there's a way to daisy chain multiple ATMegas together to share a clock source; you feed the main clock into the first 328, then the second thru N are daisy chained from there...

Hmm - from what I am seeing on my datasheet (Rev. 8271C–AVR–08/10), you can feed an external clock source to XTAL1 (PB6, pin 9 on the 28 pin PDIP) - if you want to do that. Also, if you want to use the clock source (system clock - which I believe is any of the clock sources, based on my reading of the datasheet) to drive another device, you get that from the CLKO pin (PB0, pin 14 on the 28 pin PDIP). Of course, for both of these, you need to set fuses appropriately. Read the datasheet carefully, and realize that this is nowhere near "standard Arduino" territory (and I think you may lose an I/O pin?)...

As far as sharing other parts - yes, you can share the regulator, but you will be limited to the current limits of the regulator used. You may want to look into a switching regulator, depending on what else you plan to run off it...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26554
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

Messing with the fuses is why I went to two crystals. Much more straightforward to put standard bootloader on both parts and go from there.
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
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, if you want to use the clock source (system clock - which I believe is any of the clock sources, based on my reading of the datasheet) to drive another device, you get that from the CLKO pin (PB0, pin 14 on the 28 pin PDIP).

I just tried that, and with a 16 MHz Uno I got a 16 MHz output on PB0.  So you could have a single crystal (or resonator to save the capacitors) on processor A, configure it to output its clock, and take the external clock on processor B. That would also keep them exactly in step.
« Last Edit: October 15, 2012, 11:37:45 pm by Nick Gammon » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

They can still have the standard bootloader. Uploading the bootloader changes the fuses (at least doing it in the IDE does) but you only ever need to upload the bootloader once.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5369
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea so specifically what parts would they be able to share? I know for sure they cannot share the 16MHz Crystal.

Yes they can. Sort of...you can tell one of them to output the clock on a pin and the other one can use that for clock input.

Why do i not need to use the clock Crystal? I thought the ATmega chip needed that. Can you please Elaborate?

They have internal 8mHz clocks which you can use.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Pages: [1]   Go Up
Jump to: