4 acceptance filtering, Acceptance filtering, Cp3 bt26 – National CP3BT26 User Manual

Page 119

Advertising
background image

119

www.national.com

CP3

BT26

independent filtering procedure, which provides the possi-
bility to establish a BASIC-CAN path.

For reception of data frame or remote frames, the CAN
module follows a “receive on first match” rule which means
that a given message is only received by one buffer: the first
one which matches the received message ID.

The transmission of a frame can be initiated by software
writing to the transmit status and priority register. An alter-
nate way to schedule a transmission is the automatic an-
swer to remote frames. In the latter case, the CAN module
will schedule every buffer for transmission to respond to re-
mote frames with a given identifier if the acceptance mask
matches. This implies that a single remote frame is able to
poll multiple matching buffers configured to respond to the
triggering remote transmission request.

19.4

ACCEPTANCE FILTERING

Two 32-bit masks are used to filter unwanted messages
from the CAN bus: GMASK and BMASK. Figure 48 shows
the mask and the buffers controlled by the masks.

Figure 48.

Acceptance Filtering

Acceptance filtering of the incoming messages for the buff-
ers 0...13 is performed by means of a global filtering mask
(GMASK) and by the buffer ID of each buffer. Acceptance fil-
tering of incoming messages for buffer 14 is performed by a
separate filtering mask (BMASK) and by the buffer ID of that
buffer.

Once a received object is waiting in the hidden buffer to be
copied into a buffer, the CAN module scans all buffers con-
figured as receive buffers for a matching filtering mask. The
buffers 0 to 13 are checked in ascending order beginning
with buffer 0. The contents of the hidden buffer are copied
into the first buffer with a matching filtering mask.

Bits holding a 1 in the global filtering mask (GMASK) can be
represented as a “don’t care” of the associated bit of each
buffer identifier, regardless of whether the buffer identifier bit
is 1 or 0.

This provides the capability to accept only a single ID for
each buffer or to accept a group of IDs. The following two ex-
amples illustrate the difference.

Example 1: Acceptance of a Single Identifier

If the global mask is loaded with 00h, the acceptance filter-
ing of an incoming message is only determined by the indi-
vidual buffer ID. This means that only one message ID is
accepted for each buffer.

Figure 49.

Acceptance of a Single Identifier

Example 2: Reception of an Identifier Group

Set bits in the global mask register change the correspond-
ing bit status within the buffer ID to “don’t care” (X). Messag-
es which match the non-“don’t care” bits (the bits
corresponding to clear bits in the global mask register) are
accepted.

Figure 50.

Acceptance of a Group of Identifiers

A separate filtering path is used for buffer 14. For this buffer,
acceptance filtering is established by the buffer ID in con-
junction with the basic filtering mask. This basic mask uses
the same method as the global mask (set bits correspond to
“don’t care” bits in the buffer ID).

Therefore, the basic mask allows a large number of infre-
quent messages to be received by this buffer.

Note: If the BMASK register is equal to the GMASK regis-
ter, the buffer 14 can be used the same way as the buffers
0 to 13.

The buffers 0 to 13 are scanned prior to buffer 14. Subse-
quently, the buffer 14 will not be checked for a matching ID
when one of the buffers 0 to 13 has already received an ob-
ject.

By setting the BUFFLOCK bit in the configuration register,
the receiving buffer is automatically locked after reception of
one valid frame. The buffer will be unlocked again after the
CPU has read the data and has written RX_READY in the

Buffer 0

BUFFER_ID

Buffer 13

BUFFER_ID

GMASK1

GMASK2

Buffer 14

BUFFER_ID

BMASK1

BMASK2

DS032

GMASK1

00000000

00000000

GMASK2

00000

00000000

BUFFER_ID1

10101010

10101010

BUFFER_ID2

10101

10101010

10101010

10101010

Accepted ID

10101

10101010

DS033

GMASK1

11111111

00000000

GMASK2

00000

00000000

BUFFER_ID1

10101010

10101010

BUFFER_ID2

10101

10101010

XXXXXXXX

10101010

Accepted ID Group

10101

10101010

DS034

Advertising