Presentation is loading. Please wait.

Presentation is loading. Please wait.

A network for controling model railroads

Similar presentations

Presentation on theme: "A network for controling model railroads"— Presentation transcript:

1 A network for controling model railroads
LocoNet A network for controling model railroads by Stefan Bormann

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

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

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

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

6 2b) Physikal layer - timing
16600 Baud, 60µs bit time 8N1 600µs . 60µs 1 Start D0 D1 D2 D3 D4 D5 D6 D7 Stop 1

7 3a) Packet layer bytes are transmitted back-to-back
Opcode Data Check ... bytes are transmitted back-to-back packets consist of 2, 4, 6 or N bytes first byte is „opcode“ last byte is checksum (xor of all other bytes).

8 3b) Opcode D7 D6 D5 D4 D3 D2 D1 D0 5 bits to encode 32
possible opcodes. always 1 (all other bytes have D7=0) 6 bytes 1 4 bytes N bytes 2 bytes packet length (including opcode and checksum)

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

10 3d) Packet timing, collisions
Collisions are avoided, by shortening the time between still observing the net is idle until the first bit is transmitted onto the net. Collision is detected, when a 0 is seen on the net, while a 1 is being transmitted On detection of a collision, a break (15 bit times 0) is transmitted.

11 4. Application layer -- an overview
turnouts signals message exchange decoder programming fast clock loco operation station local not used control locally well, interesting... YES Only limited mission for layout-wide LocoNet.

12 5a) Loco operation Table with loco data in command station
Slot # = Index in table = Handle Slot # is a 7 bit number 128 Slots: are loco slots 0 dispatch slot >120 are special slots (fast clock, programming) loco slots have fields:

13 5b) Fields of a slot loco address (14 bits)
state of slot (free/common/idle/IN_USE) protocol selection (# of speed steps, ...) state of loco speed (7 bit) functions (9 bits, F0, F1, ..., F8) consist tree ID (14 bits, can be a device ID of controller)

14 5c) Operations on slots (requests)
requests to master: OPC_LOCO_ADR: get slot by address OPC_RQ_SL_DATA: get slot by slot # OPC_WR_SL_DATA: write slot by slot # OPC_MOVE_SLOTS: move slot from # to # dispatch put (destination=0) dispatch get (source=0) NULL move (source=destination!=0) OPC_SLOT_STAT1: modify slot status

15 5d) Operations on slots (responses, operation)
responses from master: OPC_LONG_ACK: simple acknowledge OPC_SL_RD_DATA: slot data realtime operation OPC_LOCO_SPD: 7 bits of speed OPC_LOCO_DIRF: direction and F0, ..., F4 OPC_LOCO_SND: F5, ..., F8

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

17 6b) FRED: Example for protocol (acquire loco)
master FRED master FRED Dispatch Get Dispatch Get Slot Read NACK. Write Slot ACK

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

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

Download ppt "A network for controling model railroads"

Similar presentations

Ads by Google