tdma implemention

hello,
i need to implement tdma in my project any idea how i can do so ?
thanks

(deleted)

i have 1 master 2 slaves communication and need every slave to transmit 5 sec after the other but i need clock for the synchronization purpose but i dont know from where to begin.

(deleted)

what details shall i provide ? i am using power line communication for sendig and receving , and i am using matlab to for the master code and arduino for the slaves

You have said that the slaves send at five second intervals. Does the master ever send? I hope the slaves can receive!

I'm guessing that the slaves can both send and receive. Each slave needs to know which slave they follow in sequence. When they see that slave send, they wait five seconds and send. That works as long as something (slave or master) can re-start the sequence if a slave fails to send (which would otherwise prevent all future messages).

You can use the millis() function for a clock.

samarhefina:
i have 1 master 2 slaves communication

Easy then. The master tells the slaves when they are allowed to transmit. Have a look at how the I2C protocol works: no slave can send anything unless it is addressed directly by the master. Then you only have one clock and you don't have any sync problems if a slave clock drifts a little.

Alternatively, look at MODBUS. That's another addressed system where the master controls when the slaves transmit. I've used it very successfully with two slaves and one master.

MorganS:
Easy then. The master tells the slaves when they are allowed to transmit. Have a look at how the I2C protocol works: no slave can send anything unless it is addressed directly by the master. Then you only have one clock and you don't have any sync problems if a slave clock drifts a little.

Alternatively, look at MODBUS. That's another addressed system where the master controls when the slaves transmit. I've used it very successfully with two slaves and one master.

Who said anything about I2C? :slight_smile:

I2C is an example of a master-slave communication.

johnwasser:
I'm guessing that the slaves can both send and receive. Each slave needs to know which slave they follow in sequence. When they see that slave send, they wait five seconds and send. That works as long as something (slave or master) can re-start the sequence if a slave fails to send (which would otherwise prevent all future messages).

yes the master sends a broadcast message to the 2 slaves and i want one of them to send the message immediately after it recessives the message and other slave to wait 5 seconds and sends as well so is there a way to do so by arduino

MorganS:
I2C is an example of a master-slave communication.

Yet we have not yet been told what the communication medium actually is.

samarhefina:
yes the master sends a broadcast message to the 2 slaves and i want one of them to send the message immediately after it recessives the message and other slave to wait 5 seconds and sends as well so is there a way to do so by arduino

It's easy to set up timed events on an Arduino using the millis() function, so of course, the answer to this is yes.

aarg:
Yet we have not yet been told what the communication medium actually is.

i am using power line communication and i send the data through power line medium.

(deleted)

samarhefina:
i am using power line communication and i send the data through power line medium.

...and, are you asking us how to do that?

aarg and MorganS
thanks for the help i will try the suggestions.

samarhefina:
aarg and MorganS
thanks for the help i will try the suggestions.

You're welcome. If you have any problems, continue the thread.

hello johnwasser,
any idea on how to know every function functionality of modbus protocol in arduino ? also to use modbus o matlab or how to use modbusmat 1.1 simulater ?
thank you

hello aarg,
from what i understood when i searched that millis() is used to show the hours, ,minutes and second how can i use it to synchromize the data sending ?