I have some devices that use rs485 to communicate via half duplex. I wrote my own serial protocol that listens for an address and has a couple ways to check for valid packets (stop bit, length, cs, etc). It works all fine and dandy, but I am wondering how to avoid a situation where multiple devices try to tx at the same time.
Right now, when my slave devices all receive power, they will transmit a 'status' update to the master telling it that they exist on the bus. I also have a timer running on each device that periodically transmits the status after initial power-up to act as a 'keep alive' so the master knows that they are still powered and active. The problem is that if all the devices power on at the same time, there will be a massive bus conflict. There will also be more conflicts if the timer of the slaves are synced and they try to transmit their keep-alive at the same time. I have a fault pin on the RS485 chip that can generate an interrupt when a conflict exists, but I have no idea how I should handle the conflict.
Are there any rules of thumb, or standards that people use to solve this?