A good choice of microcontroller for multi-master single slave unit w/ accelero?

Hello Arduino friends,

I am working on a project, where I need to have my microcontroller to:

1- have a I2C multi-master bus comm.
2- have a I2C single-slave comm.
3- have an accelerometer (only a single axis is used) connected to it.
4- have a force sensor connected to it.

In your opinion, what is a cheap choice of microcontroller, that gives me all the above?
Very much appreciate your help.
Karim.

1- have a I2C multi-master bus comm.
2- have a I2C single-slave comm.
3- have an accelerometer (only a single axis is used) connected to it.
4- have a force sensor connected to it.

You can run an I2C bus and an SPI bus on an UNO or any other ATMega328-based duino.

You can use an UNO or other duino to program an AVR chip to run stand-alone just for your project.
The UNO is the only one I know that lets you remove the AVR from a socket and install another.

Thank you; Is there a way I can use Pro Mini if I have to use both I2C and SPI?
I was hoping to only b able to employ I2C for all my master/slave purposes. Is it possible?
The force sensor is no problem, just an analog (or digital) pin. However the accelerometer (MMA8452Q) is a bit more complicated and (from the specs) requires I2C communication.
Any suggestion along those lines?
Karim.

I2C and SPI use different pins and separate logic, they can be used independently.

Note that only one master can exist on a SPI bus, it's the device that supplies the SCK pulses and serves the MOSI output.

The MMA8452Q operates on 3.3V, not compatible with a 5V Vcc Arduino. The Pro Mini can operate on 3.3V, otherwise an I2C level shifter is required. You can use the Mini @3.3V, to connect to all 3.3V devices, and put the level shifter between the Mini and other (UNO, Mega...) Arduinos running on 5V.

As the good Doctor alluded to, why is it you think that you need multiple masters and only one sensor on the i2c buss??

Karimskarim, what you will be doing is not so clear but is seems you can start and maybe finish with a Pro Mini but if that would be your only Arduino it will need a way to connect to USB or a separate programmer.

The Nano has USB, is also small and cheap. I got one for $6. It plugs into breadboards just fine.

Why I like the UNO is that you can replace the chip on board. But you can program AVR chips on breadboard with maybe any Arduino. Still the UNO is more the 328P development board to take the chip out and put the chip only in the target project and keep the board.

Along your way you need to make the pieces work then merge them all and still have them work. We have ways to make that happen well, you can learn the basis by blinking leds.

Thank you, first of all, for all the good advice.
Ok; I need to have a multi-master single-slave communication. The reason is to have each unit being able to host multiple other slaves, but at the same time, be prepared to be the slave of another master. Now Pro Mini has only one I2C port (A4 and A5). Do I not need two I2C ports then? One for a Multi-Master bus, and the other for a Slave?
Karim.

Multiple I2C buses are not needed, but sometimes can come in handy. E.g. when frequently polling an I2C sensor stresses the bus, or a dedicated 3.3V sensor bus without level shifters. But then the controllers (with one I2C interface each) need a different communication channel (SPI?).

if this is the case, can i implement the multi-master bus using I2C, and the single-slave using SPI?
Thanks.

To run master or slave takes software on the controller. How much room will your scheme need?

AVR serial ports are capable of full speed SPI in master mode only. I2C is less fast.

You have the option of soft-serial, soft-I2C, soft-SPI through bit-banging digital pins.

karimskarim:
Thank you, first of all, for all the good advice.
Ok; I need to have a multi-master single-slave communication. The reason is to have each unit being able to host multiple other slaves, but at the same time, be prepared to be the slave of another master. Now Pro Mini has only one I2C port (A4 and A5). Do I not need two I2C ports then? One for a Multi-Master bus, and the other for a Slave?
Karim.

The Arduino standard I2C library ("Wire" library) doesn't allow multi-master. Once you call Wire.begin() with a slave address, that Arduino cannot be a master on the bus. Dual ports like on the Arduino Due might be able to save you here by connecting both ports to the same bus. It would need some testing.

It would also need some desoldering on the Due boards to remove the pullup resistors from most of the Arduinos on the bus. The standard pullups are only suitable with one or two of them on the bus.