Go Down

Topic: Communication between multiple ATmega328 nodes (Read 1 time) previous topic - next topic

davivid

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?


CrossRoads

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

Grumpy_Mike

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.

CrossRoads

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

CrossRoads

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

davivid


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


as a two wire interface?

CrossRoads

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

Go Up