Maybe im missing something really obvious but I hit bit of a brick wall and not sure how to do what I want to do. I am trying to build a arduino board with 2 atmega 328 micros. One of them will be used to monitor some on board sensors and run a LCD. I want the other one free for add on shields and anything else Students want to connect at a later time. My idea is to have everything including all sensors, power s is is possible or how to go about it but I want the 2 micros to communicate through a I2C Bus. I thought about some kind of switch to select which one of the 2 micros to be programmed when uploading code. Is there a better way to go about this. Would I need to modify the bootloader at all to get them to talk to each other? Thanks everyone for your time.
Many sensors are controlled by the I2C bus. If you use that bus for the inter-processor communication it might not be free for the sensor readout. Which of the two processors did you intend to be the master, which the slave? What would be the benefit of having them on one board (except the form factor, but for that you can choose smaller Arduino variants)?
Now that I really stop and think about it, I probably would be better off using a port expander for the shields. so far I have parallel LCD, SPI/i2c and analog sensors + microphone and 1 atmega328 on one prototype board and all is working well. I would like to be able add shields as well but have basically run out of pins. If I use a MCP23017 port expander Can do it that way, i'm just not sure if it will be to slow?
If they are only going to communicate through i2c I don't see the point of having the on the same physical board. Why not just have a cable to connect the two? That way you always have the option of using them independently of each other too.