TDT-Protocol on CAN » Historie » Version 61
Maximilian Seesslen, 13.02.2023 17:05
1 | 12 | Maximilian Seesslen | h1. Intro |
---|---|---|---|
2 | 1 | Maximilian Seesslen | |
3 | 17 | Maximilian Seesslen | With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue. |
4 | An monitor-software is able to display values without knowing anything about the sensors or their configuration. |
||
5 | 46 | Maximilian Seesslen | The CANId cinsists of an function code and the node id. Like CANOpen the function code is 4 Bits and the Node-ID is 7 Bit. |
6 | In CAN2.0A there can only be 128 Nodes. |
||
7 | 1 | Maximilian Seesslen | |
8 | 35 | Maximilian Seesslen | CAN 2.0A: 0..0x7FF |
9 | CANOpen: 4 Bit Function code, 7 Bit Node-ID |
||
10 | Node-Id: 0..0x7F |
||
11 | 1 | Maximilian Seesslen | Function-Code Mask: 0x780 |
12 | 46 | Maximilian Seesslen | There are 14 or 28 Filters on STM32Fs |
13 | Some STM32 have an internal 96-bit unique ID. |
||
14 | 1 | Maximilian Seesslen | |
15 | 44 | Maximilian Seesslen | h2. Function code |
16 | |||
17 | 1 | Maximilian Seesslen | |_. Code |_. Decription |_. Examples | |
18 | 51 | Maximilian Seesslen | | 0x0 | NMT-Write | | |
19 | | 0x1 | NMT-Send | | |
||
20 | | 0x2 | Alarms | | |
||
21 | 58 | Maximilian Seesslen | | 0x3 | Write object | Set Date, illumination | |
22 | | 0x4 | Read object | Get product codes | |
||
23 | | 0x5 | Send object | Send temperature | |
||
24 | | 0x6 | Resend object | Replay recorded data | |
||
25 | | 0x7 | data blob | | |
||
26 | |||
27 | 1 | Maximilian Seesslen | |
28 | h1. IDs, ranges and commands |
||
29 | |||
30 | 46 | Maximilian Seesslen | h2. Node IDs |
31 | 1 | Maximilian Seesslen | |
32 | 44 | Maximilian Seesslen | * 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code |
33 | 1 | Maximilian Seesslen | * 29-Bit-Identifier, (CAN 2.0B); 0x20000000 |
34 | |||
35 | |_. Range |_. Decription |_. Examples | |
||
36 | | 0x01-0x0F | Network Manager | PC | |
||
37 | | 0x10-0x2F | Active controller | CANDis | |
||
38 | | 0x30-0x4F | Actor | CANSwitch | |
||
39 | 47 | Maximilian Seesslen | | 0x50-0x6F | Sending sensors | Sensemux, CANIO | |
40 | 1 | Maximilian Seesslen | | 0x70-0x7F | Passive Sensors | CANRec | |
41 | |||
42 | 45 | Maximilian Seesslen | h2. Object structutre |
43 | 1 | Maximilian Seesslen | |
44 | 44 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples | |
45 | | 2 | Object | Plain Sensor value; Set illumination | |
||
46 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
47 | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
||
48 | | 4 | Value | 32Bit | |
||
49 | 36 | Maximilian Seesslen | |
50 | 44 | Maximilian Seesslen | h2. Objects |
51 | 36 | Maximilian Seesslen | |
52 | 59 | Maximilian Seesslen | |_. Code |_. Description | |
53 | | none | | |
||
54 | | ambientLight | | |
||
55 | | plantLight | | |
||
56 | | multimediaSwitch | | |
||
57 | | mainSwitch | | |
||
58 | | date | | |
||
59 | | time | | |
||
60 | | dummy | | |
||
61 | | plantSensor | | |
||
62 | | plantSensor [0-7] | | |
||
63 | | firmwareVersion | | |
||
64 | | firmwareDate | | |
||
65 | | hardwareRevision | | |
||
66 | | hardwareDate | | |
||
67 | | temperatureIntern [0-7] | | |
||
68 | | temperatureExtern | | |
||
69 | | humidity | | |
||
70 | | VOC | | |
||
71 | 60 | Maximilian Seesslen | | Replay | | |
72 | 1 | Maximilian Seesslen | |
73 | 44 | Maximilian Seesslen | h2. Units |
74 | 17 | Maximilian Seesslen | |
75 | 44 | Maximilian Seesslen | * Date: year 2B, month 1B, day 1B |
76 | 1 | Maximilian Seesslen | * Time: hour 1B, minute 1B, second 1B, subsecond 1B |
77 | 17 | Maximilian Seesslen | |
78 | 46 | Maximilian Seesslen | h2. Example: Turn on the lights |
79 | 1 | Maximilian Seesslen | |
80 | 46 | Maximilian Seesslen | |_.Data |_.Size |_.Description | |
81 | |0x300 | 29 Bits | Function code: Write Object; All objects. | |
||
82 | |0x0 | 2 Byte | Message-Type: Global command | |
||
83 | |0x1 | 1 Byte | Data-Type: Permill | |
||
84 | |0x1 | 1 Byte | PWM: PWM permilli | |
||
85 | |1000 | 4 Byte | Value: Full Brightness | |
||
86 | |||
87 | 1 | Maximilian Seesslen | h1. Multipacket-Strings |
88 | |||
89 | 46 | Maximilian Seesslen | There should be the posssibillity to write the complete SPI-Flash even if it takes forever. |
90 | Not every slave needs to be able to send super big blocks. But every slave should be able to |
||
91 | send e.g. descriptions. |
||
92 | 61 | Maximilian Seesslen | There can not be multiple transfers at the same time from one node because there is no identification. |
93 | 15 | Maximilian Seesslen | |
94 | 46 | Maximilian Seesslen | |_. Size |_. Type | |
95 | | 0x4 | Package number (0: Data contains package count) | |
||
96 | | 0x4 | Data | |
||
97 | 61 | Maximilian Seesslen | |
98 | h2. Header |
||
99 | |||
100 | |_. Size |_. Type | |
||
101 | | 0x4 | Total size | |
||
102 | | 0x4 | Type (1=SDCard) | |
||
103 | | 0x4 | Target | |
||
104 | | 0x4 | CRC32 of data | |
||
105 | |||
106 | h2. Example: CANRec |
||
107 | |||
108 | PC requests an complete dump from single Node. Node will just stream it out. |
||
109 | |||
110 | |||
111 | 46 | Maximilian Seesslen | |
112 | 54 | Maximilian Seesslen | h1. NMT |
113 | 48 | Maximilian Seesslen | |
114 | h2. Actuator introduction |
||
115 | |||
116 | When introduction is requested by system command, each device must send an description. |
||
117 | |||
118 | |_. Size |_. Decription |_. Examples | |
||
119 | | 2 | Object | Object | |
||
120 | | 6 | MAC/Unique ID| 48Bit | |
||
121 | |||
122 | 52 | Maximilian Seesslen | h3. Objects |
123 | 53 | Maximilian Seesslen | |
124 | 57 | Maximilian Seesslen | |_. Size |_. Decription | |
125 | |1 | Request intoruction | |
||
126 | |2 | MAC low | |
||
127 | |3 | MAC high | |
||
128 | |4 | Protocol versions | |
||
129 | |5 | Firmware version | |
||
130 | |6 | Product Code | |
||
131 | |7 | Node-Id | |
||
132 | |||
133 | 55 | Maximilian Seesslen | |
134 | h3. Protocol versions |
||
135 | |||
136 | |_. Size |_. Decription | |
||
137 | |1 | TDT Major | |
||
138 | 56 | Maximilian Seesslen | |1 | TDT Minor | |
139 | |1 | NMT Major | |
||
140 | |1 | NMT Minor | |
||
141 | |1 | Blob Major | |
||
142 | |1 | Blob Minor | |
||
143 | 55 | Maximilian Seesslen | |
144 | 25 | Maximilian Seesslen | |
145 | h1. V2 |
||
146 | |||
147 | |_. Size |_. Decription |_. Examples | |
||
148 | | 1 | Packet type | Standard TDT packet | |
||
149 | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
||
150 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
151 | 31 | Maximilian Seesslen | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
152 | 30 | Maximilian Seesslen | | 4 | Value | 32Bit | |
153 | |||
154 | 1 | Maximilian Seesslen | h2. Multimessage package |
155 | |||
156 | There should be the posssibillity to write the complete SPI-Flash even if it takes forever. |
||
157 | Not every slave needs to be able to send super big blocks. But every slave should be able to |
||
158 | send e.g. descriptions. |