CAN partial networking definition and configuration on TJA1145

What is CAN partial networking

Partial networking allows nodes in a CAN network to be selectively activated in response to dedicated wake-up frames (WUF). Only nodes that are functionally required are active on the bus while the other nodes remain in a low-power mode until needed. If both CAN wake-up (CWE = 1) and CAN selective wake-up (CPNC = 1) are enabled, and the partial networking registers are configured correctly (PNCOK = 1), the transceiver monitors the bus for dedicated CAN wake-up frames.

1. Wake-up frame(WUF)

A wake-up frame is a CAN frame according to ISO 11898-1:2015, consisting of an identifier field (ID), a Data Length Code (DLC), a data field and a Cyclic Redundancy Check (CRC) code including the CRC delimiter.

1.1. Wake-up frame ID

The wake-up frame format, standard (11-bit) or extended (29-bit) identifier, is selected via bit IDE in the Frame control register.

A valid WUF identifier is defined and stored in the ID registers. An ID mask can be defined to allow a group of identifiers to be recognized as valid by an individual node. The identifier mask is defined in the mask registers, where a 1 means ‘don’t care’.

In the example illustrated in Figure 7, based on the standard frame format, the 11-bit identifier is defined as 0x1A0. The identifier is stored in ID registers 2 and 3. The three least significant bits of the ID mask, bits 2 to 4 of Mask register 2 are set to 1, which means that the corresponding identifier bits are ‘don’t care’. This means that any of eight different identifiers will be recognized as valid in the received WUF (from 0x1A0 to 0x1A7).

1.2.  Wake-up frame Data area

The data field indicates which nodes are to be woken up. Within the data field, groups of nodes can be pre-defined and associated with bits in a data mask. By comparing the incoming data field with the data mask, multiple groups of nodes can be woken up simultaneously with a single wake-up message.

The data length code (bits DLC in the Frame control register;) determines the number of data bytes (between 0 and 8) expected in the data field of a CAN wake-up frame. If one or more data bytes are expected (DLC ≠ 0000), at least one bit in the data field of the received wake-up frame must be set to 1 and at least one equivalent bit in the associated data mask register in the transceiver must also be set to 1 for a successful wake-up. Each matching pair of 1s indicates a group of nodes to be activated (since the data field is up to 8 byes long, up to 64 groups of nodes can be defined).

If DLC = 0000, a node will wake up if the WUF contains a valid identifier and the received data length code is 0000, regardless of the values stored in the data mask. If DLC ≠ 0000 and all data mask bits are set to 0, the device cannot be woken up via the CAN bus (note that all data mask bits are set to 1 by default; ). If a WUF contains a valid ID but the DLCs (in the Frame control register and in the WUF) don’t match, the data field is ignored and no nodes are woken up.

In the example illustrated in Figure 8, the data field consists of a single byte (DLC = 1). This means that the data field in the incoming wake-up frame is evaluated against data mask 7 . Data mask 7 is defined as 10101000 in the example. This means that up to three groups of nodes could be woken up (group 1, 3 and 5) if the respective bits in the data frame are also set to 1.

The received message shown in Figure 8 could, potentially, wake up four groups of nodes: groups 2, 3, 4 and 5. Two matches are found (groups 3 and 5) when the message data bits are compared with the configured data mask (DM7).

1.3.   When to only consider ID or consider both

Optionally, the data length code and the data field can be excluded from the evaluation of the wake-up frame. If bit PNDM = 0, only the identifier field is evaluated to determine if the frame contains a valid wake-up message. If PNDM = 1 (the default value), the data field is included in the wake-up filtering.

1.3.1.  Only consider ID

When PNDM = 0, a valid wake-up message is detected and a wake-up event is captured (and CW is set to 1) when:

• the identifier field in the received wake-up frame matches the pattern in the ID registers after filtering AND

• the CRC field in the received frame (including a recessive CRC delimiter) was received without error.

1.3.2.  Consider both ID and data

When PNDM = 1, a valid wake-up message is detected when:

• the identifier field in the received wake-up frame matches the pattern in the ID registers after filtering AND

• the frame is not a Remote frame AND

• the data length code in the received message matches the configured data length code (bits DLC) AND

• if the data length code is greater than 0, at least one bit in the data field of the received frame is set and the corresponding bit in the associated data mask register is also set AND

• the CRC field in the received frame (including a recessive CRC delimiter) was received without error.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值