Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
70
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

12.4.4 Programming a Message Acceptance Filter

The mask registers provide a method for developing an acceptance filtering strategy. Without a filtering strategy, a message object could accept an incoming message only if their identifiers were identical. The mask registers allow a message object to ignore one or more bits of incoming message identifiers, so it can accept a range of message identifiers.

The standard global mask register (Figure 12-9) applies to messages with standard (11-bit) message identifiers, while the extended global mask register (Figure 12-10) applies to messages with extended (29-bit) identifiers. The message 15 mask register (Figure 12-11) provides an additional filter for message object 15, to allow it to accept a greater range of message identifiers than message objects 1–14 can. Clear a mask bit to accept either a zero or a one in that position.

The CAN controller applies the appropriate global mask to each incoming message identifier and checks for an acceptance match on message objects 1–14. If no match exists, it then applies the message 15 mask and checks for a match on message object 15.

CAN_SGMSK

Address:

1E07H, 1E06H

(87C196CA)

Reset State:

Unchanged

Program the CAN standard global mask (CAN_SGMSK) register to mask (“don’t care”) specific message identifier bits for standard message objects.

 

15

 

 

 

 

 

 

 

8

87C196CA

 

 

 

 

 

 

 

 

 

MSK20

MSK19

MSK18

 

 

 

 

 

 

 

 

 

 

 

7

MSK28 MSK27 MSK26 MSK25

0

MSK24 MSK23 MSK22 MSK21

Bit

Bit

 

Function

Number

Mnemonic

 

 

 

 

 

 

15:13

MSK20:18

ID Mask

 

 

These bits individually mask incoming message identifier (ID) bits.

 

 

0

= mask the ID bit (accept either “0” or “1”)

 

 

1

= accept only an exact match

 

 

 

12:8

Reserved; for compatibility with future devices, write zeros to these bits.

 

 

 

7:0

MSK28:21

ID Mask

 

 

These bits individually mask incoming message identifier (ID) bits.

 

 

0

= mask the ID bit (accept either “0” or “1”)

 

 

1

= accept only an exact match

 

 

 

 

Figure 12-9. CAN Standard Global Mask (CAN_SGMSK) Register

12-18

CAN SERIAL COMMUNICATIONS CONTROLLER

CAN_EGMSK

Address:

1E0BH, 1E0AH,

(87C196CA)

 

1E09H, 1E08H

 

Reset State:

Unchanged

Program the CAN extended global mask (CAN_EGMSK) register to mask (“don’t care”) specific message identifier bits for extended message objects.

 

31

 

 

 

 

 

 

 

 

24

87C196CA

 

MSK4

MSK3

MSK2

MSK1

 

MSK0

 

 

 

23

 

 

 

 

 

 

 

 

16

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MSK12

MSK11

MSK10

MSK9

 

MSK8

MSK7

MSK6

 

MSK5

 

 

15

 

 

 

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MSK20

MSK19

MSK18

MSK17

 

MSK16

MSK15

MSK14

 

MSK13

 

 

7

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MSK28

MSK27

MSK26

MSK25

 

MSK24

MSK23

MSK22

 

MSK21

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

Bit

 

 

 

 

Function

 

 

 

 

Number

Mnemonic

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31:27

MSK4:0

ID Mask

 

 

 

 

 

 

 

 

 

 

 

These bits individually mask incoming message identifier (ID) bits.

 

 

 

 

0 = mask the ID bit (accept either “0” or “1”)

 

 

 

 

 

 

 

1 = accept only an exact match

 

 

 

 

 

 

 

 

26:24

Reserved; for compatibility with future devices, write zeros to these bits.

 

 

 

 

 

 

 

 

 

 

 

23:16

MSK12:5

ID Mask

 

 

 

 

 

 

 

 

15:8

MSK20:13

These bits individually mask incoming message identifier (ID) bits.

 

7:0

MSK28:21

 

0 = mask the ID bit (accept either “0” or “1”)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 = accept only an exact match

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 12-10. CAN Extended Global Mask (CAN_EGMSK) Register

12-19

Соседние файлы в предмете Электротехника