chiark / gitweb /
id location stuff done by Makefiles
[trains.git] / cebpic / README.protocol
1 NMRA
2 ====
3
4 NMRA packets from the computer to the PIC should consist of 8-bit bytes.
5
6 bits 6-0 contain the data to be sent to the track
7 bit 7 is 1 if the byte is the last in the packet and 0 otherwise
8  
9 The first 14 data bits in the NMRA packet should be 1s.
10 (i.e. the first two complete bytes should be 01111111 01111111)
11 (packets beginning with some other sequence are reserved for non-NMRA messages)
12
13 Maximum NMRA message length = 15 bytes (i.e. 105 bits).
14 Messages longer than this will cause things to get confused at the moment.
15
16 baud rate 9600
17 most significant bit first
18 8n1
19
20
21 Flash memory ID locations
22 =========================
23
24 Byte 20 0000h
25                 bit 0           1 for the main PIC (#0)
26                                 0 otherwise
27                 1-7             currently unused, set to 0
28
29 Byte 20 0001h
30                 PIC number (guaranteed to be in range 0..63 inclusive)
31
32 I2C
33 ===