Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 71

Maximilian Seesslen, 11.07.2023 11:36

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