Go Down

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

mihun70

hy! i tried my first pcb with atmega 328..

oric_dan

#46
Mar 31, 2013, 11:58 pm Last Edit: Apr 01, 2013, 07:45 pm by oric_dan Reason: 1
Cool, I'm glad you brought up this thread, as I had missed it completely. I've been working
up a similar project, tying two 328s together and communicating via I2C. In my case, I
jinned up the 2nd 328 on a prototyping shield, which I'm also using as a test platform for
the RFM22 transceiver. I haven't gotten to the I2C part, but this board will have Arduino
stacking headers for mounting over a UNO board.

I'm interested if other people have done much using I2C for communicating between two
328s. I suppose one will need to be master and the other slave.

CrossRoads

Nice pics - now you need to figure out how to crop them & resize to be about 800 pixels wide.

"I suppose one will need to be master and the other slave."

Whomever starts the transfer supplies the clock and the initial data, and is by definition the master.

Have you seen my dual '328P board? Lots of headers for connecting up I2C, SPI, Serial, for interchip transfers.
Load both with standard bootloaders and away you go!
http://www.crossroadsfencing.com/BobuinoRev17/
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

oric_dan

Quote
Whomever starts the transfer supplies the clock and the initial data, and is by definition the master.

Have you seen my dual '328P board?

I just now noticed your board, due to mihun70 restarting this thread, now that I jiggered
up my own 328 on the proto shield, ;-).

Re I2C comms and mastering, I guess you could have each of the 328s I2C peripherals
being set to slave mode, until such a time as they want to make a transfer, then take
over as buss master. Need a scheme to avoid conflicts. I was hoping someone would proffer
some firsthand experience on using I2C between 2 cpus.

CrossRoads

Make both boards slaves, listening all the time. I think (anecdotal) the Wire.h library may have stuff built in to not start a master transfer if the lines are busy already.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

mihun70

#50
Apr 03, 2013, 10:12 am Last Edit: Apr 03, 2013, 10:18 am by mihun70 Reason: 1
hy!my boards are home made :smiley-roll-blue:...with foto paper..feeric clorhidre...with basic arduino pins :smiley-red:...the boards are working XD.Please! be noticed that this is my first pcb (i'm not an expert)...made with altium.I spend a lot of time learning Altium.Your boards looks like are taken from industrial devices :smiley-eek-blue:..and professional design..
Now i work on an dual 328p-au.i hope that will be more profy than the my "legacy" boards :smiley-roll-sweat:

Constantin

Mihun,

Nice job running OSX on a Dell. Must have been an interesting project also!

CrossRoads

"Your boards looks like are taken from industrial devices ..and professional design.."
Well, that's what I am 8) I don't bother with home etching & drilling holes & trying to come up with my own silkscreen & solder mask - not when boards are available with all that done for ~$3.50 with shipping for ten 10cm x 10cm boards.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

graynomad

Yeah, these days I can't see any reason to dick around with DIY boards, maybe if it's simple and you want it tomorrow, but the PCB fab services around now are great.

mihun70, you're using Altium, you can send the PcbDoc file directly to iTead, no need for Gerbers which makes life a bit easier.

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

mihun70

guys!i work now on another pcb with 2 atmega 328p-au.I want to ask...-my team (2 software developers) want to comunicate between controlers trough miso mosi ss - and i quicly need to find out witch is te 4-th pin???pin 17 -PB5 SCK or pin 12-PB0-CLKO or dosen't matter?
please!someone who knows to tel me witch and why!
on pin 17 i arleady have an led...

CrossRoads

SCK      SCK
MOSI    MISO
MISO    MOSI
SS        SS

Both sides need to have SS as an input pin with pullup resistor enabled. Whomever wants a transaction will change its SS output, pull it low, and take on the Master role for the tranfer(s).
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

mihun70

You know many stuf!help me please!my english isn't so god ...i do not understand pullup rez:-?.I suppose it's like I2C interface.From vcc trough an rezistor to ss line?

mihun70

http://www.engineersgarage.com/sites/default/files/circuitdiagram/AVR-SPI-circuit.gif
is this a good config?

graynomad

Login required for that link.

CR, is that right? Can you connect MISO to MOSI and vv?

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

mihun70

Hy!be strong !new  arduino core 2 duino is coming!
Continental is the name of the contest organizers,USV is my university logo.
this is my second pcb project!
I wait for opinions...

Go Up