Eng.Remon said:
ummm ok i did all the part of sensors with uc1.
i did the keybad with int and lcd with uc2
i m on my way to finish the dtmf generator and receiver with hang up on the uc3 . what i didnt do is connected and make the protocols between each. thats what i have problems in .
so in other meaning i did each one seperatly . but not connected with whole the project
Is it safe to say that the goal is to finish the project as quick as possible and still have it look good to the person who grades it.
Go with RS232 because it will handle the distance you require and it is most easily understood.
U2 is the difficult part because it needs to UARTS. The link between it and U1 gets the most traffic so use the hardware UART for that. The link between U2 and U3 is used only when a phone call is to be made. Since no one will be calling in U3 should never have to start a conversation with U2. Should be safe to used a software (bit bang) Uart for this link.
U1 and U3 only require one UART which they have.
Read up on the 80c51 UART and see if you can find and drivers online or in app notes that you can use. Do the U2-U1 connection first because it uses only hardware UARTS. You can go polled or with interrupts whatever you can find.
Next find a bit-bang routine for the 80c51. Go with polled here. You only have to pay attention to U3 if you are expecting a responce from it.
Now write your protocol.
You have been taling about encoding the data between U2-U1 in eight bits. You can do that, but since the traffic is light you could use a human readable one.
For example if U1 wanted to tell U2 the temerature was 23
From U1 to U2:
T23
From U2 to U1:
AT23
When U1 sees the msg sent back with an A prepended it knows that U2 has the message. Keep it simple. I would not get much more complicated then this as it is not needed.
The above suggestion uses about 10 times the bytes to send but it is closed loop and you can read it without decoding a binary mapping. There is overhead in converting numbers to and from ASCII strings.