from what i understand as long as i specify an address for Wire(addr) the device will be a slave. the master would be undefined. i suppose software serial may be an option. more importantly here is stability. i dont want a device to freeze if the i2c gets some noise
That's correct but some Arduinos can not behave as slaves, can not have an I2C address and thus can not receive data.
SPI is faster yet simpler and thus more stable than I2C, can span larger distances, at the expense of a dedicated select (and MISO?) line for each slave.
Ive looked into SPI it seems reasonable. i could use an arduino to take some of the load from my esp cpu too. Now im worried about endian"ness with between arduino and esp.
i could use a port expander. i just dont have one. i do have arduinos. I think the arduino could be more useful. i could probably flash the arduino over spi if i needed to. but i could just simple make it change output state like expander too
for me the i2c expander cost more than the arduino nano and the nano has analog and digital pins. i have arduino and esp setup on i2c now and it works pretty good.
i have dozens of nanos and other arduino but no io expanders except for reading analog
I think it can happen. All you have to do is set a free address in the software and work as a slave device. The datasheet shows that the ATmega328 can work below 3 volts if it is 8 MHz. In this way, it will be possible to connect directly to the ESP and possibly be powered by it.
I might if the arduino dont work well. i have so many nanos and 0 i/o expanders. i dont see why it should be an issue. except for making sure the slave arduino received the message from the master and the master can request the pin states right after to make sure my request to change pin state was successful
Need to program ATmega328 as standalone without external XTAL - 8MHz is possible with internal RC generator. Need test of what speed is possible on I2C in that case because internal oscilator is not very precisly. I2C work on 100kHz, 400kHz, 1MHz or 3.4MHz. Work on internal oscilator is possible with program of fuse bits. In ESP8266 is no needed to change nothing. I use similar (ATmega88) work on internal RC oscilator for different purpose.