Presentation is loading. Please wait.

Presentation is loading. Please wait.

LocoNet A network for controling model railroads by Stefan Bormann

Similar presentations


Presentation on theme: "LocoNet A network for controling model railroads by Stefan Bormann"— Presentation transcript:

1 LocoNet A network for controling model railroads by Stefan Bormann

2 Contents n LocoNet? System overview. n Physical layer n Packet layer n Application layer – an overview n Loco operation n Example: FRED n References.

3 1a) System overview DCC C:> LocoNet. Command Station

4 1b) What is LocoNet? n invented by Digitrax n proprietory n Peer to peer n CSMA/CD n ~3 Layers.

5 2a) Physical layer - electrical Net Ground RX TX +12V 15mA masterany device 3V.

6 2b) Physikal layer - timing n Baud, 60µs bit time n 8N1 D0 1 0 Start 0 D1D2D3D4D5D6D7Stop 1 60µs 600µs.

7 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...

8 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

9 3c) Packet timing, net access n CD: carrier detect (defines end of packet) MD 6 PD CD 20bit times n PD: priority delay (high prio. = small PD) n MD: master delay (only master may transmit).

10 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.

11 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.

12 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 are loco slots u 0 dispatch slot u >120 are special slots (fast clock, programming) n loco slots have fields:

13 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)

14 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

15 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)

16 6a) FRED n FRemos Einfacher Drehregler n Simple to use n Can only control one engine u speed, u direction, u F0, F1, F2.

17 NACK.Dispatch GetACKWrite SlotSlot ReadDispatch Get 6b) FRED: Example for protocol (acquire loco) masterFREDmasterFRED

18 Get Slot By Address 6c) FRED: Example of protocol (reconnect) Slot Read masterFRED ACK.Write SlotSlot ReadNull Move masterFRED if slot data changed

19 7. References n This clinic: stefan.bormann/dcc/dcc_e.html n Digitrax homepage: n LocoNet-Hackers mailing list:


Download ppt "LocoNet A network for controling model railroads by Stefan Bormann"

Similar presentations


Ads by Google