2

I am working on a project which requires a dozen VL53l0X I2C-TOF sensors to be polled by one master MCU over a few meters of cable.

Thus, I decided to accompany each TOF by an Atmega8 acting as a gateway between the TOF and a Modbus (using a MAX485), which is managed by an ESP32 (the master). Since I require fairly low latency (~10 reads / sensor / second) I am a bit disappointed by the Modbus RTU performance (mostly caused by the forced 1.75ms delay between frames).

My question: Is there any quicker, more suitable, Atmega-bearable bus protocol for long distances? Ethernet is sadly not an option due to the limited slaves computing power and cost...

1
  • 1
    MODBUS is just a communication protocol that runs on an existing physical layer - RS485. You don't have to run MODBUS over RS485 - you can run whatever you like over RS485, it's just serial.
    – Majenko
    Commented Dec 11, 2020 at 11:15

1 Answer 1

1

CAN for the Phy (physical) layer would be good for several thousand feet. You can use whatever baud and protocol on the CAN layer you like within reason. I am assuming (maybe in error) that they all communicate on the same bus. This CAN Phy was designed for this. It would be possible for you to write your own protocol and simply address each by a unique number or whatever. There is also the option of using a CAN controller but I think that would be a lot of time not needed to design your solution. By placing a Atmega8 at each sensor opens up a lot of possibilities for you.

2
  • So, am I understanding it right that each slave would need it's own Object-ID?
    – Daniel D.
    Commented Dec 12, 2020 at 16:14
  • Not sure what you are asking. Each simply needs a unique identifier so you can address them individually. You can do an 'all call if' you like. The address can be as simple as A, B, C etc then you can see it on the bus monitor. For example, when you address 'A' it responds with its data. You may have to add a preamble so the slaves know it is a command not data. No suggestions as I do not know what the data stream will look like. Keep It Simple it is much easier to troubleshoot.
    – Gil
    Commented Dec 13, 2020 at 19:50

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.