TDT-Protocol on CAN » Historie » Version 73
Maximilian Seesslen, 11.07.2023 11:54
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 | 73 | Maximilian Seesslen | |_. Bits |_. Area | _. Decription |_. Examples | |
16 | | 4 |/2.CAN-Id | Function code | Send object | |
||
17 | 71 | Maximilian Seesslen | | 7 | NodeId | Sensemux WZ | |
18 | 73 | Maximilian Seesslen | | 16 |/4.Data | Object | Set illumination | |
19 | 72 | Maximilian Seesslen | | 8 | Unit | promilPwm | |
20 | 73 | Maximilian Seesslen | | 8 | Flags | Confirmation required | |
21 | | 32 | Value | 350‰ | |
||
22 | 71 | Maximilian Seesslen | |
23 | |||
24 | 44 | Maximilian Seesslen | h2. Function code |
25 | |||
26 | 1 | Maximilian Seesslen | |_. Code |_. Decription |_. Examples | |
27 | 51 | Maximilian Seesslen | | 0x0 | NMT-Write | | |
28 | | 0x1 | NMT-Send | | |
||
29 | | 0x2 | Alarms | | |
||
30 | 58 | Maximilian Seesslen | | 0x3 | Write object | Set Date, illumination | |
31 | | 0x4 | Read object | Get product codes | |
||
32 | | 0x5 | Send object | Send temperature | |
||
33 | | 0x6 | Resend object | Replay recorded data | |
||
34 | | 0x7 | data blob | | |
||
35 | |||
36 | 1 | Maximilian Seesslen | |
37 | h1. IDs, ranges and commands |
||
38 | |||
39 | 46 | Maximilian Seesslen | h2. Node IDs |
40 | 1 | Maximilian Seesslen | |
41 | 44 | Maximilian Seesslen | * 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code |
42 | 1 | Maximilian Seesslen | * 29-Bit-Identifier, (CAN 2.0B); 0x20000000 |
43 | |||
44 | |_. Range |_. Decription |_. Examples | |
||
45 | | 0x01-0x0F | Network Manager | PC | |
||
46 | | 0x10-0x2F | Active controller | CANDis | |
||
47 | | 0x30-0x4F | Actor | CANSwitch | |
||
48 | 47 | Maximilian Seesslen | | 0x50-0x6F | Sending sensors | Sensemux, CANIO | |
49 | 1 | Maximilian Seesslen | | 0x70-0x7F | Passive Sensors | CANRec | |
50 | |||
51 | 45 | Maximilian Seesslen | h2. Object structutre |
52 | 1 | Maximilian Seesslen | |
53 | 68 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples | |
54 | | 2 | Object | Plain Sensor value; Set illumination | |
||
55 | | 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String | |
||
56 | | 1 | - | Reserved | |
||
57 | | 4 | Value | 32Bit | |
||
58 | |||
59 | 36 | Maximilian Seesslen | |
60 | 44 | Maximilian Seesslen | h2. Objects |
61 | 36 | Maximilian Seesslen | |
62 | 59 | Maximilian Seesslen | |_. Code |_. Description | |
63 | | none | | |
||
64 | | ambientLight | | |
||
65 | | plantLight | | |
||
66 | | multimediaSwitch | | |
||
67 | | mainSwitch | | |
||
68 | | date | | |
||
69 | | time | | |
||
70 | | dummy | | |
||
71 | | plantSensor | | |
||
72 | | plantSensor [0-7] | | |
||
73 | | firmwareVersion | | |
||
74 | | firmwareDate | | |
||
75 | | hardwareRevision | | |
||
76 | | hardwareDate | | |
||
77 | | temperatureIntern [0-7] | | |
||
78 | 64 | Maximilian Seesslen | | temperatureExtern [0-7] | | |
79 | 59 | Maximilian Seesslen | | humidity | | |
80 | | VOC | | |
||
81 | 60 | Maximilian Seesslen | | Replay | | |
82 | 63 | Maximilian Seesslen | | Data-Dump (SD-Card) | | |
83 | 1 | Maximilian Seesslen | |
84 | 44 | Maximilian Seesslen | h2. Units |
85 | 17 | Maximilian Seesslen | |
86 | 44 | Maximilian Seesslen | * Date: year 2B, month 1B, day 1B |
87 | 1 | Maximilian Seesslen | * Time: hour 1B, minute 1B, second 1B, subsecond 1B |
88 | 17 | Maximilian Seesslen | |
89 | 46 | Maximilian Seesslen | h2. Example: Turn on the lights |
90 | 1 | Maximilian Seesslen | |
91 | 46 | Maximilian Seesslen | |_.Data |_.Size |_.Description | |
92 | |0x300 | 29 Bits | Function code: Write Object; All objects. | |
||
93 | |0x0 | 2 Byte | Message-Type: Global command | |
||
94 | |0x1 | 1 Byte | Data-Type: Permill | |
||
95 | |0x1 | 1 Byte | PWM: PWM permilli | |
||
96 | |1000 | 4 Byte | Value: Full Brightness | |
||
97 | |||
98 | 1 | Maximilian Seesslen | h1. Multipacket-Strings |
99 | |||
100 | 46 | Maximilian Seesslen | There should be the posssibillity to write the complete SPI-Flash even if it takes forever. |
101 | Not every slave needs to be able to send super big blocks. But every slave should be able to |
||
102 | send e.g. descriptions. |
||
103 | 61 | Maximilian Seesslen | There can not be multiple transfers at the same time from one node because there is no identification. |
104 | 15 | Maximilian Seesslen | |
105 | 46 | Maximilian Seesslen | |_. Size |_. Type | |
106 | | 0x4 | Package number (0: Data contains package count) | |
||
107 | | 0x4 | Data | |
||
108 | 61 | Maximilian Seesslen | |
109 | h2. Header |
||
110 | |||
111 | |_. Size |_. Type | |
||
112 | | 0x4 | Total size | |
||
113 | | 0x4 | Type (1=SDCard) | |
||
114 | 62 | Maximilian Seesslen | | 0x4 | Target node ID | |
115 | 1 | Maximilian Seesslen | | 0x4 | CRC32 of data | |
116 | 62 | Maximilian Seesslen | |
117 | 61 | Maximilian Seesslen | |
118 | h2. Example: CANRec |
||
119 | |||
120 | PC requests an complete dump from single Node. Node will just stream it out. |
||
121 | |||
122 | |||
123 | 46 | Maximilian Seesslen | |
124 | 54 | Maximilian Seesslen | h1. NMT |
125 | 48 | Maximilian Seesslen | |
126 | h2. Actuator introduction |
||
127 | |||
128 | When introduction is requested by system command, each device must send an description. |
||
129 | |||
130 | |_. Size |_. Decription |_. Examples | |
||
131 | | 2 | Object | Object | |
||
132 | | 6 | MAC/Unique ID| 48Bit | |
||
133 | |||
134 | 52 | Maximilian Seesslen | h3. Objects |
135 | 53 | Maximilian Seesslen | |
136 | 57 | Maximilian Seesslen | |_. Size |_. Decription | |
137 | |1 | Request intoruction | |
||
138 | |2 | MAC low | |
||
139 | |3 | MAC high | |
||
140 | |4 | Protocol versions | |
||
141 | |5 | Firmware version | |
||
142 | |6 | Product Code | |
||
143 | |7 | Node-Id | |
||
144 | |||
145 | 55 | Maximilian Seesslen | |
146 | h3. Protocol versions |
||
147 | |||
148 | |_. Size |_. Decription | |
||
149 | |1 | TDT Major | |
||
150 | 56 | Maximilian Seesslen | |1 | TDT Minor | |
151 | |1 | NMT Major | |
||
152 | |1 | NMT Minor | |
||
153 | |1 | Blob Major | |
||
154 | |1 | Blob Minor | |
||
155 | 55 | Maximilian Seesslen | |
156 | 25 | Maximilian Seesslen | h1. V2 |
157 | |||
158 | |_. Size |_. Decription |_. Examples | |
||
159 | | 1 | Packet type | Standard TDT packet | |
||
160 | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
||
161 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
162 | 31 | Maximilian Seesslen | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
163 | 1 | Maximilian Seesslen | | 4 | Value | 32Bit | |
164 | 65 | Maximilian Seesslen | |
165 | h1. V3 |
||
166 | |||
167 | |_. Size |_. Decription |_. Examples | |
||
168 | | 2 | Object | | |
||
169 | | 1 | Sub-Id; | Flags, Subid | |
||
170 | | 1 | Unit/Type | Hz_int, °C_centi, Time, Date, PWM_milli, CAN-ID, Name, Description, Room | |
||
171 | | 4 | Value | 32Bit | |
||
172 | |||
173 | h2. Flags |
||
174 | 1 | Maximilian Seesslen | |
175 | 67 | Maximilian Seesslen | 4 Bit multi message count |
176 | 4 Bit multi message pos |
||
177 | |||
178 | Length in Bytes given via CAN? |
||
179 | Strings with max. 64 characters. |
||
180 | |||
181 | 1 | Maximilian Seesslen | h2. Multimessage package |
182 | |||
183 | 67 | Maximilian Seesslen | There should be the possibillity to write the complete SPI-Flash even if it takes forever. |
184 | 1 | Maximilian Seesslen | Not every slave needs to be able to send super big blocks. But every slave should be able to |
185 | send e.g. descriptions. |
||
186 | 69 | Maximilian Seesslen | |
187 | h2. Alarms/Alerts |
||
188 | |||
189 | Devices should indicate issues; e.g.: |
||
190 | |||
191 | * Battery low |
||
192 | * I2C problems |
||
193 | 70 | Maximilian Seesslen | |
194 | h2. Object structutre |
||
195 | |||
196 | |_. Size |_. Decription |_. Examples | |
||
197 | | 2 | Object | I2C, VBat, | |
||
198 | | 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String | |
||
199 | | 1 | Issue | Whats wrong, Undervolts, Communication error | |
||
200 | | 4 | Value | 32Bit | |