TDT-Protocol on CAN » Historie » Revision 89
Revision 88 (Maximilian Seesslen, 11.07.2023 14:31) → Revision 89/104 (Maximilian Seesslen, 11.07.2023 14:33)
h1. Intro
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
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.
In CAN2.0A there can only be 128 Nodes.
CAN 2.0A: 0..0x7FF
CANOpen: 4 Bit Function code, 7 Bit Node-ID
Node-Id: 0..0x7F
Function-Code Mask: 0x780
There are 14 or 28 Filters on STM32Fs
Some STM32 have an internal 96-bit unique ID.
|_. Bits |_. Area |_. Decription |_. Examples |
| 4 |/2.CAN-Id | Function code | Send object |
| 7 | NodeId | Sensemux WZ |
| 16 |/4.Data | Object | Set illumination |
| 8 | Unit | promilPwm |
| 8 | Flags | Confirmation required |
| 32 | Value | 350‰ |
[[NMT]]
[[MMP]]
[[Alerts]]
h2. Function code
Function code can be 0..15 / 0x00..0x0F
|_. Code |_. Decription |_. Examples |
| 0x0 | NMT-Write | |
| 0x1 | NMT-Send | |
| 0x2 | NMT-Introduce | Device sends UID only |
| 0x3 | NMT-setId | Set NodeId on Device |
| 0x4 | Alarms | |
| 0x5 | Write object | Set Date, illumination |
| 0x6 | Read object | Get product codes |
| 0x7 | Send object | Send temperature |
| 0x8 | Resend object | Replay recorded data |
| 0x9 | data blob | |
h1. IDs, ranges and commands
h2. Node IDs
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
|_. Range |_. Decription |_. Examples |
| 0x01-0x0F | Network Manager | PC |
| 0x10-0x2F | Active controller | CANDis |
| 0x30-0x4F | Actor | CANSwitch |
| 0x50-0x6F | Sending sensors | Sensemux, CANIO |
| 0x70-0x7F | Passive Sensors | CANRec |
h2. CAN data structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | Plain Sensor value; Set illumination |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Flags | Confirmation required |
| 4 | Value | The kind of data that was specified in 'unit' |
h2. Objects
|_. Code |_. Description |
| none | |
| ambientLight | |
| plantLight | |
| multimediaSwitch | |
| mainSwitch | |
| date | |
| time | |
| dummy | |
| plantSensor | |
| plantSensor [0-7] | |
| firmwareVersion | |
| firmwareDate | |
| hardwareRevision | |
| hardwareDate | |
| temperatureIntern [0-7] | |
| temperatureExtern [0-7] | |
| humidity | |
| VOC | |
| Replay | |
| Data-Dump (SD-Card) | |
h2. Units
* Date: year 2B, month 1B, day 1B
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
h2. Example: Turn on the lights
|_.Data |_.Size |_.Description |
|0x300 | 29 Bits | Function code: Write Object; All objects. |
|0x0 | 2 Byte | Message-Type: Global command |
|0x1 | 1 Byte | Data-Type: PWM Permill |
|0x1 | 1 Byte | Flags: None |
|1000 | 4 Byte | Value: Full Brightness |
h2. Alarms/Alerts
Devices should indicate issues; e.g.:
* Battery low
* I2C problems
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | I2C, VBat, |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Issue | Whats wrong, Undervolts, Communication error |
| 4 | Value | 32Bit |
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
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.
In CAN2.0A there can only be 128 Nodes.
CAN 2.0A: 0..0x7FF
CANOpen: 4 Bit Function code, 7 Bit Node-ID
Node-Id: 0..0x7F
Function-Code Mask: 0x780
There are 14 or 28 Filters on STM32Fs
Some STM32 have an internal 96-bit unique ID.
|_. Bits |_. Area |_. Decription |_. Examples |
| 4 |/2.CAN-Id | Function code | Send object |
| 7 | NodeId | Sensemux WZ |
| 16 |/4.Data | Object | Set illumination |
| 8 | Unit | promilPwm |
| 8 | Flags | Confirmation required |
| 32 | Value | 350‰ |
[[NMT]]
[[MMP]]
[[Alerts]]
h2. Function code
Function code can be 0..15 / 0x00..0x0F
|_. Code |_. Decription |_. Examples |
| 0x0 | NMT-Write | |
| 0x1 | NMT-Send | |
| 0x2 | NMT-Introduce | Device sends UID only |
| 0x3 | NMT-setId | Set NodeId on Device |
| 0x4 | Alarms | |
| 0x5 | Write object | Set Date, illumination |
| 0x6 | Read object | Get product codes |
| 0x7 | Send object | Send temperature |
| 0x8 | Resend object | Replay recorded data |
| 0x9 | data blob | |
h1. IDs, ranges and commands
h2. Node IDs
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
|_. Range |_. Decription |_. Examples |
| 0x01-0x0F | Network Manager | PC |
| 0x10-0x2F | Active controller | CANDis |
| 0x30-0x4F | Actor | CANSwitch |
| 0x50-0x6F | Sending sensors | Sensemux, CANIO |
| 0x70-0x7F | Passive Sensors | CANRec |
h2. CAN data structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | Plain Sensor value; Set illumination |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Flags | Confirmation required |
| 4 | Value | The kind of data that was specified in 'unit' |
h2. Objects
|_. Code |_. Description |
| none | |
| ambientLight | |
| plantLight | |
| multimediaSwitch | |
| mainSwitch | |
| date | |
| time | |
| dummy | |
| plantSensor | |
| plantSensor [0-7] | |
| firmwareVersion | |
| firmwareDate | |
| hardwareRevision | |
| hardwareDate | |
| temperatureIntern [0-7] | |
| temperatureExtern [0-7] | |
| humidity | |
| VOC | |
| Replay | |
| Data-Dump (SD-Card) | |
h2. Units
* Date: year 2B, month 1B, day 1B
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
h2. Example: Turn on the lights
|_.Data |_.Size |_.Description |
|0x300 | 29 Bits | Function code: Write Object; All objects. |
|0x0 | 2 Byte | Message-Type: Global command |
|0x1 | 1 Byte | Data-Type: PWM Permill |
|0x1 | 1 Byte | Flags: None |
|1000 | 4 Byte | Value: Full Brightness |
h2. Alarms/Alerts
Devices should indicate issues; e.g.:
* Battery low
* I2C problems
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | I2C, VBat, |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Issue | Whats wrong, Undervolts, Communication error |
| 4 | Value | 32Bit |