0

I'm working on a modular CANBUS system for offroad racing. The idea right now is that the main Arduino (1284p at the moment) will be the only one connected to CANBUS, and other modules will have their own atmega's that will communicate with the master over I2C. They will not be physically on the same PCB, but will be physically within inches of each other. One module will have 8 MAX31865 IC's for interfacing with RTD's. The 31865 is not compatible with 5V microcontrollers, which right now we planned on running the Atmega's at 5V. Since the IC's are SPI, they can all share a MOSI, MISO, and CLK bus, so only two channels of a hex converter. For the Chip Select pin, would it be acceptable to use a resistor to decrease the voltage instead of using an additional 8 channels of hex converting?

What would the upsides/downsides be of using an atmega running at 3.3v for the module with the MAX31865's and just using a hex converter on SDA/SCL for the I2C communication to the master? What atmega I use for this is flexible.

2 Answers 2

1

using a hex converter on SDA/SCL for the I2C communication to the master

I2C is not straight forward for level shifting. The I/O pins operate in open drain mode. That is, they don't send out any voltage of their own, they just pull down (like a button) the signals pulled up by resistors.

To level shift you have to read the state of those lines and then replicate that open drain connection to the signals of a different voltage.

But that is not all of course. I2C is a bidirectional protocol on a single data line. That means that data goes in both directions on the data line, so your level shifter has to be able to work in both ways.

There are special I2C level shifter chips available that do that exact thing. Some people sell them on breakout boards if you google around.

But with all that said, if you run your I2C bus purely at 3.3V it should work quite happily with both 3.3V and 5V devices. To do so you need to:

  1. Use external pullup resistors (~3.3KΩ) to 3.3V
  2. Disable the Arduino's idiotic use of the internal pullup resistors on the I2C pins (will need modification of the Wire library)

In short: It is possible to mix 3.3V and 5V I2C devices on a 3.3V I2C bus, but not on a 5V I2C bus.

1

would it be acceptable to use a resistor to decrease the voltage

I don't see any big problem with using a voltage divider for chip select.

What would the upsides/downsides be of using an atmega running at 3.3v for the module with the MAX31865's

At 3.3V you can only run at 13 MHz or less (so in practice, 8 MHz, unless you want to do a lot of fiddling around). This may or may not matter to you. At a lower voltage it uses less power which can be a plus, and you don't need to worry about level converters.

and just using a hex converter on SDA/SCL for the I2C communication to the master?

Do you mean a level converter?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.