I have a bit of a weird question, and I’d really like to hear how someone with practical experience would approach it.
Suppose you have a temperature sensor that can provide temperature data through four interfaces: UART, SPI, I2C, and CAN. You need to connect it to an MCU and simply read the room temperature. Since all four interfaces can give you the same temperature value, which one would you actually choose, and more importantly, what would be your reason for rejecting the others?
Personally, I would probably remove CAN first, but my reason is not very strong. I mainly associate CAN with automotive and distributed/robust communication, so it feels unnecessary for a simple temperature sensor connected directly to an MCU. But I’m not sure if that is a good technical reason.
Then between SPI, UART, and I2C, I would probably remove SPI because it generally needs more signal lines than I2C, especially when multiple devices are involved. That leaves UART and I2C.
If saving pins is the main concern, I might choose UART because it only needs TX and RX, whereas I2C needs SDA and SCL. But I also know this is probably oversimplifying the decision
how would you make this decision. Which interface would you choose in this particular situation, and what would be your reason for rejecting the other three?
Suppose you have a temperature sensor that can provide temperature data through four interfaces: UART, SPI, I2C, and CAN. You need to connect it to an MCU and simply read the room temperature. Since all four interfaces can give you the same temperature value, which one would you actually choose, and more importantly, what would be your reason for rejecting the others?
Personally, I would probably remove CAN first, but my reason is not very strong. I mainly associate CAN with automotive and distributed/robust communication, so it feels unnecessary for a simple temperature sensor connected directly to an MCU. But I’m not sure if that is a good technical reason.
Then between SPI, UART, and I2C, I would probably remove SPI because it generally needs more signal lines than I2C, especially when multiple devices are involved. That leaves UART and I2C.
If saving pins is the main concern, I might choose UART because it only needs TX and RX, whereas I2C needs SDA and SCL. But I also know this is probably oversimplifying the decision
how would you make this decision. Which interface would you choose in this particular situation, and what would be your reason for rejecting the other three?