2b) Physikal layer - timing n 16600 Baud, 60µs bit time n 8N1 D0 1 0 Start 0 D1D2D3D4D5D6D7Stop 1 60µs 600µs.
3a) Packet layer n bytes are transmitted back-to-back n packets consist of 2, 4, 6 or N bytes n first byte is „opcode“ n last byte is checksum (xor of all other bytes). OpcodeDataCheck...
3b) Opcode always 1 (all other bytes have D7=0) 6 bytes01 4 bytes10 N bytes11 2 bytes00 packet length (including opcode and checksum) 5 bits to encode 32 possible opcodes. D7D6D5D4D3D2D1D0
3c) Packet timing, net access n CD: carrier detect (defines end of packet) MD 6 PD 0..20 CD 20bit times n PD: priority delay (high prio. = small PD) n MD: master delay (only master may transmit).
3d) Packet timing, collisions n Collisions are avoided, by shortening the time between still observing the net is idle until the first bit is transmitted onto the net. n Collision is detected, when a 0 is seen on the net, while a 1 is being transmitted n On detection of a collision, a break (15 bit times 0) is transmitted.
n turnouts n signals n message exchange n decoder programming n fast clock n loco operation 4. Application layer -- an overview station local not used control locally well, interesting... YES Only limited mission for layout-wide LocoNet.
5a) Loco operation n Table with loco data in command station n Slot # = Index in table = Handle n Slot # is a 7 bit number n 128 Slots: u 1..120 are loco slots u 0 dispatch slot u >120 are special slots (fast clock, programming) n loco slots have fields:
5b) Fields of a slot n loco address (14 bits) n state of slot (free/common/idle/IN_USE) n protocol selection (# of speed steps,...) n state of loco u speed (7 bit) u functions (9 bits, F0, F1,..., F8) n consist tree n ID (14 bits, can be a device ID of controller)
5c) Operations on slots (requests) n requests to master: u OPC_LOCO_ADR: get slot by address u OPC_RQ_SL_DATA: get slot by slot # u OPC_WR_SL_DATA: write slot by slot # u OPC_MOVE_SLOTS: move slot from # to # F dispatch put (destination=0) F dispatch get (source=0) F NULL move (source=destination!=0) u OPC_SLOT_STAT1: modify slot status
n responses from master: u OPC_LONG_ACK: simple acknowledge u OPC_SL_RD_DATA: slot data n realtime operation u OPC_LOCO_SPD: 7 bits of speed u OPC_LOCO_DIRF: direction and F0,..., F4 u OPC_LOCO_SND:F5,..., F8 5d) Operations on slots (responses, operation)
6a) FRED n FRemos Einfacher Drehregler n Simple to use n Can only control one engine u speed, u direction, u F0, F1, F2.
NACK.Dispatch GetACKWrite SlotSlot ReadDispatch Get 6b) FRED: Example for protocol (acquire loco) masterFREDmasterFRED
Get Slot By Address 6c) FRED: Example of protocol (reconnect) Slot Read masterFRED ACK.Write SlotSlot ReadNull Move masterFRED if slot data changed
7. References n This clinic: http://www.nord-com.net/ stefan.bormann/dcc/dcc_e.html n Digitrax homepage: http://www.digitrax.com n LocoNet-Hackers mailing list: http://groups.yahoo.com/group/loconet_hackers.