Hello Nuwan,
this time i modified digital clock to transmitt data measns seconds,miniutes,hours to pc via rs232 also send a unit id why im going to attach several units parallal.also i need to get two digit number to transmitt that was my data also.
Do you mean you are going to attach multiple microcontroller UARTs to a single PC RS232 interface. This is likely to fail as if two microcontrollers transmit data at the same time then the PC will receive corrupt data. Even if data is not corrupted by a collision the TX pin is always driving the signal so the microcontrollers would essentially be fighting each other for control of the signal probably leading in damaging the microcontrollers. You could use resistors to circumvent this but the collisions would still be an issue. What would be better is if everything came to a central point before being sent to the PC. A RS485 bus could potentially be used to do this.
http://www.matrixmultimedia.com/article.php?a=419
Alternatively you could use resistors to connect the signals together and then have a pin that tells the other microcontrollers that you are sending data. The microcontrollers must then all check this signal before sending to ensure a collision does not occur.
simply what i want is collect time ,unit id, and two digit data only.i sent unit id every main program cycle to identify the unit is online.
is it going to work.?
One unit: Yes,
Multiple Units: Not directly without some kind of work around for the collision and bus contention problems.