Go Down

Topic: Two Arduino's One Board? (Read 880 times) previous topic - next topic

NewJesus

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!

Coding Badly


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

Nick Gammon

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.
http://www.gammon.com.au/electronics

NewJesus

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?

Nick Gammon

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.
http://www.gammon.com.au/electronics

NewJesus

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

Nick Gammon

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).
http://www.gammon.com.au/electronics

CrossRoads

Leave off the crystals and other parts you don't want, such as RS232 driver.
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.

cr0sh

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...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

CrossRoads

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

Nick Gammon

#10
Oct 16, 2012, 06:35 am Last Edit: Oct 16, 2012, 06:37 am by Nick Gammon Reason: 1

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.
http://www.gammon.com.au/electronics

Nick Gammon

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.
http://www.gammon.com.au/electronics

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up