Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 94

Maximilian Seesslen, 11.07.2023 15:56

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 74 Maximilian Seesslen
|_. Bits |_. Area   |_. Decription        |_. Examples             |
16 73 Maximilian Seesslen
| 4      |/2.CAN-Id | Function code       | Send object            |
17 74 Maximilian Seesslen
| 7      |            NodeId              | Sensemux WZ            |
18
| 16 	 |/4.Data   | Object 	          | Set illumination       |
19
| 8 	 |            Unit 	          | promilPwm              |
20
| 8 	 |            Flags 	          | Confirmation required  | 
21
| 32 	 |            Value 	          | 350‰                   |
22 92 Maximilian Seesslen
| 64Bits Data|      |                     |                        |
23 71 Maximilian Seesslen
24 87 Maximilian Seesslen
[[NMT]]
25
[[MMP]]
26 89 Maximilian Seesslen
[[Alerts]]
27 87 Maximilian Seesslen
28 44 Maximilian Seesslen
h2. Function code
29 86 Maximilian Seesslen
30 83 Maximilian Seesslen
Function code can be 0..15 / 0x00..0x0F
31 44 Maximilian Seesslen
32 1 Maximilian Seesslen
|_. Code |_. Decription    |_. Examples             |
33 51 Maximilian Seesslen
| 0x0    | NMT-Write       |                        |
34 1 Maximilian Seesslen
| 0x1    | NMT-Send        |                        |
35 79 Maximilian Seesslen
| 0x2    | NMT-Introduce   | Device sends UID only  |
36 82 Maximilian Seesslen
| 0x3    | NMT-setId       | Set NodeId on Device   |
37 90 Maximilian Seesslen
| 0x4    | Alarms          | Send by nodes          |
38 82 Maximilian Seesslen
| 0x5    | Write object    | Set Date, illumination |
39
| 0x6    | Read object     | Get product codes      |
40
| 0x7    | Send object     | Send temperature       |
41
| 0x8    | Resend object   | Replay recorded data   |
42 58 Maximilian Seesslen
| 0x9    | data blob       |                        |
43 1 Maximilian Seesslen
44 94 Maximilian Seesslen
h2. Node-ID
45
46
Depending on the function code, the Node-ID can be the target or the source. Node-ID '0' means every node should inspect the message.
47
48
|_. Function code |_. Node-ID interpretation|
49
| NMT-Write       | Destination or 0        |
50
| NMT-Send        | Source                  |
51
| NMT-Introduce   | Source                  |
52
| NMT-setId       | New Node-ID             |
53
| Alarms          | Source                  |
54
| Write object    | Destination or 0        |
55
| Read object     | Targeted Source         |
56
| Send object     | Source                  |
57
| Resend object   | Replayed Source         |
58
| data blob       | Destination             |
59
60
61
62 1 Maximilian Seesslen
h1. IDs, ranges and commands
63
64 46 Maximilian Seesslen
h2. Node IDs
65 1 Maximilian Seesslen
66 44 Maximilian Seesslen
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
67 1 Maximilian Seesslen
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
68
69
|_. Range      |_. Decription           |_. Examples              |
70
| 0x01-0x0F    | Network Manager        | PC                      |
71
| 0x10-0x2F    | Active controller      | CANDis                  |
72
| 0x30-0x4F    | Actor                  | CANSwitch               |
73 47 Maximilian Seesslen
| 0x50-0x6F    | Sending sensors        | Sensemux, CANIO         |
74 1 Maximilian Seesslen
| 0x70-0x7F    | Passive Sensors        | CANRec                  |
75
76 75 Maximilian Seesslen
h2. CAN data structutre
77 1 Maximilian Seesslen
78 68 Maximilian Seesslen
|_. Size |_. Decription |_. Examples                                                                                |
79 93 Maximilian Seesslen
| 2      | Object       | Set ambient illumination                                                                  |
80 68 Maximilian Seesslen
| 1      | Unit         | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String  |
81 75 Maximilian Seesslen
| 1      | Flags        | Confirmation required                                                                     |
82 1 Maximilian Seesslen
| 4      | Value        | The kind of data that was specified in 'unit'                                             |
83 93 Maximilian Seesslen
84 68 Maximilian Seesslen
85 36 Maximilian Seesslen
86 44 Maximilian Seesslen
h2. Objects
87 36 Maximilian Seesslen
88 59 Maximilian Seesslen
|_. Code                  |_. Description             |
89
| none                    |                           |
90
| ambientLight            |                           |
91
| plantLight              |                           |
92
| multimediaSwitch        |                           |
93
| mainSwitch              |                           |
94
| date                    |                           |
95
| time                    |                           |
96
| dummy                   |                           |
97
| plantSensor             |                           |
98
| plantSensor [0-7]       |                           |
99
| firmwareVersion         |                           |
100
| firmwareDate            |                           |
101
| hardwareRevision        |                           |
102
| hardwareDate            |                           |
103
| temperatureIntern [0-7] |                           |
104 64 Maximilian Seesslen
| temperatureExtern [0-7] |                           |
105 59 Maximilian Seesslen
| humidity                |                           |
106
| VOC                     |                           |
107 60 Maximilian Seesslen
| Replay                  |                           |
108 63 Maximilian Seesslen
| Data-Dump (SD-Card)     |                           |
109 1 Maximilian Seesslen
110 44 Maximilian Seesslen
h2. Units
111 17 Maximilian Seesslen
112 44 Maximilian Seesslen
* Date: year 2B, month 1B, day 1B
113 1 Maximilian Seesslen
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
114 17 Maximilian Seesslen
115 46 Maximilian Seesslen
h2. Example: Turn on the lights
116 1 Maximilian Seesslen
117 46 Maximilian Seesslen
|_.Data   |_.Size   |_.Description                              |
118
|0x300    | 29 Bits | Function code: Write Object; All objects. |
119 91 Maximilian Seesslen
|0x0      | 2 Byte  | Object: Ambient illumination              |
120 67 Maximilian Seesslen
|0x1      | 1 Byte  | Data-Type: PWM Permill                    |
121 1 Maximilian Seesslen
|0x1      | 1 Byte  | Flags: None                               |
122 70 Maximilian Seesslen
|1000     | 4 Byte  | Value: Full Brightness                    |