Pages: [1]   Go Down
Author Topic: Communication between multiple ATmega328 nodes  (Read 1416 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 141
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been researching various communication technologies to interconnect around 10 ATmega328 devices, I2C, SPI, DMX, RS-485.......The list goes on, and gets confusing.

I would really appreciate some real world advice as to the suitability for my project. In essence:

  • I will have 10 addressable ATmega328 nodes, that each contain a sensor, and a single RGB Led.
  • Each node will receive PWM RGB data
  • Each node will transmit sensor data - when it is activated (HIGH or LOW, usually one at a time)
  • Each node will be approx 20cm from the next
  • These will be connected to a Master device which will act as the USB Computer bridge.

As I see it there are two approaches:
1)the Master will write to each device, and continually scan through the array of devices asking for the sensor state.
2)the Master will write to each device and each device can write to the Master when its sensor is HIGH.

Which would be the best approach?
What would be the most suited communication technology to implement this?

Logged

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

#1, less chance of two slaves responding together.
RS485 is designed for that.
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.

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Each node will receive PWM RGB data
You sure of that, it is difficult to send lots of PWM, the data to make the PWM fine but not the signal itself.
Yes go for 1, I would use DMX.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
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 couple of application notes on wiring it up

http://www.maximintegrated.com/app-notes/index.mvp/id/763

http://www.maximintegrated.com/app-notes/index.mvp/id/723
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: 545
Posts: 27357
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

DMX - bit overkill, no?

Master sends out a 6 byte message

message coming
node address
red pwm
blue pwm
green pwm
message end

node responds with current sensor status
node address
on/off
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: 141
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

#1, less chance of two slaves responding together.
RS485 is designed for that.

as a two wire interface?
Logged

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

Can be two wire if only want half-duplex.
See the app notes I posted for wiring 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.

Pages: [1]   Go Up
Jump to: