ATmega328p-pu (I2C?) mini Network.

Hi all,

Now I'm not even sure if I should start this topic but I got some questions that need to be answered. As we know there is possible a communication between 2+ arduino boards using i2C bus

Example: http://www.geeetech.com/blog/2012/03/communicating-between-two-arduino-boards-using-i2c-bus/

In a topic that I done months ago probably about i2C bus I made question how to connect multiple sensors on a arduino (need to find the address of each sensor put the same pull up resistor ..etc)

But what I have today in this topic in this project is to connect more than 3x ATmega328p-pu between them which one of them will be the Master (getting all the data from the others) and the rest of them Slaves and be as a Network.

The Master will get the necessary data from the Slaves, the slaves in the other way gonna have different kind of code and sensors,buttons..etc

Questions:

  1. Is it possible to connect multiple atmega's together as one Master and multiple slaves?
  2. What a actual pull up resistor do, why i have to put them and how should I know which one to put If i have other sensors connected in the same Slave.
  3. Does the Slaves/Master code gonna affect the Loop of the code in case i need to do something extremely controllable?
  4. Does the network gonna slow down the atmegas for any kind of reason?
  5. How exactly I'm gonna send data from Slaves to Master?

ps(Master will be only to get the data from the slaves and store it or print it in the serial monitor)

If you can't answer or you think that I don't know some things please give me a link/url where i will be glad to read and learn, please do not make negative comments, we are here to learn science. :D

Thanks, Domino60

Domino60: 1. Is it possible to connect multiple atmega's together as one Master and multiple slaves? 2. What a actual pull up resistor do, why i have to put them and how should I know which one to put If i have other sensors connected in the same Slave. 3. Does the Slaves/Master code gonna affect the Loop of the code in case i need to do something extremely controllable? 4. Does the network gonna slow down the atmegas for any kind of reason? 5. How exactly I'm gonna send data from Slaves to Master?

1) I2C supports any number of masters and slaves. All nodes must have different addresses.

2) Some boards come with built-in pullup resistors - check! The current through the pullups should not exceed the driving capabilities of the digital pins. If you don't know how to calculate that current, you can measure it using a DVM. With all boards connected and powered on, it's the DC current from pin to Gnd.

A bus should be terminated by pullups only at each end, i.e. 2 pullups at the ends of a daisy-chain bus are sufficient. This topology allows for the most devices on the bus, and simple cabling (flat ribbon with press-on connectors. In star topology you have more ends to terminate.

3) When master/slave means that only the master requests data from the slaves, all read requests go into loop() of the master, the slaves respond in interrupt handlers.

4) Not much.

5) See the example code for the Wire library.