Norm Cramer wrote: > I know I can do it by polling the stations from the "controller". I > would like something that allowed faster response. ... > Polling stations that do not have data seems like a waste of time. > BTW polling limits my devices to about 12 if I can tolerate a 500msec > delay from input to response (this is really kinda high for this > application). I would like to handle more devices and have better > response time. Other replies so far noted. Mmm! Let me look at some basic considerations here: * Assume 1200 baud for a start, that is 120 characters per second. The "bearer" is an open-collector mark-high serial line (notwithstanding how that is implemented) such that character collisions would not be missed although they might well be misinterpreted. * A Poll consists of two bytes; a poll token and an address byte. The expected reply is either a NAK or a reply sequence. Thus a complete negative poll consists of three bytes. Twelve stations makes 36 bytes, at 120 cps that is 250mS. A random average polling latency is therefore half this or 125mS, to which must be added the length of the message and response packets, presumably not more than another 20 bytes? * The message and response packets however are common to any system. * Each station which generates traffic is pushed to the head of the poll queue, that is it is the next station polled. If it has further traffic, it is serviced immediately and repeatedly until it has none. If however it is temporarily "done", the poll passes to the next most recently served station. Only if no other station has any traffic at all does complete poll looping of all stations resume, and even then, activity from any station results in the more recently-active stations being given priority in the poll queue. * This implements the principles: "Give polling priority to stations in accordance to their recent traffic" plus "Complete a transaction before passing to another station". Both these maximise polling efficiency, and the latter minimises task-switching overhead. The consequence which comes to mind, that some tasks may be delayed disproportionately if the system becomes overloaded, turns out to be unavoidable; in fact it is LESS likely to occur when we know the channel is being used at maximum efficiency. * One alternative to this is Polled Tree Acccess in which two, three or four poll "phases" are periodically issued and stations whose identity matches one of the "branches" reply with an ACK. The controller then polls sub-branch addresses to determine successively more accurately the identity of the station with traffic. For a Binary tree (two phases per bit), average seek is 1¸ polls per address bit or six polls for 16 stations, worst case 2 polls per address bit or eight polls for 16 stations. * The polls now consist of a token, branch level, value and the reply, but the branch level and value may be superposed in one byte giving three bytes per poll as before. The signal to the station that it has finally been polled may be either explicit (the original token as above) or implicit when the last branch poll is detected. * The stations maintain a tri-state address register in which each bit may be either 1, 0 or "wild". Defining any given bit (either 1 or 0) always "wilds" lesser bits in the address and an ACK is sent if the non- wild bits match the station address. When all bits are defined and match the station address the station is selected to send its message. * It is a little more difficult to implement the Most Recently Served queue in this scheme, but increased efficiency may offset this, especially for large numbers of stations. The last station served may however be polled simply by repeating its LSB poll. If it does not reply, the bits of the next MRS queue station can be polled in MSB order, but only so long as they are ACKed, the poll then dropping back to the next queue entry which does not fit the current mask. * A MRS queue need not include all possible stations, but have a few entries after which polling reverts to the basic method; linear search or binary tree navigation. * The other alternative is of course CSMA/CD where each station asynchronously transmits its "bid" for attention including its identity and a checksum. The bearer is checked for other start bits until the moment the station starts its own transmission, thus fulfilling "Carrier Sensing", while it can either check the integrity of its own trans- mission for Collision Detection, or expect an ACK or NAK from the controller according to whether its checksum was seen to be correct or not. * Advantages of this system are simplicity and speed of response if only one station is active. Disadvantages are the possibility that two stations may contend fiercely for attention, even with working "backoff" algorithms which randomly(?) determine wait times before a re-send, in which case the bearer becomes loaded with collisions and overall efficiency becomes MUCH worse than a polled system. * To improve efficiency for this specific application, a mechanism would need to be devised such that the "bid" system is enabled so long as no traffic needs to be passed, while any successful "bidder" then has exclusivity to send and receive message packets exclusively until empty at which point the controller signals again for bids to be made. Well, those are just a few thoughts. Is this what you were seeking? Further detail available on challenge. Cheers, Paul B.