Intel 8XC196NT, 87C196CB user manual Determining The Can Controller’S Interrupt Status

Models: 8XC196NT 87C196CB

1 155
Download 155 pages 42.65 Kb
Page 93
Image 93
7.7DETERMINING THE CAN CONTROLLER’S INTERRUPT STATUS

87C196CB SUPPLEMENT

7.7DETERMINING THE CAN CONTROLLER’S INTERRUPT STATUS

A successful reception or transmission or a change in the status register can cause the CAN con- troller to generate an interrupt request. The INT_PEND1 register (see Table 7-2 on page 7-3) in- dicates whether a CAN interrupt request is pending. The CAN interrupt pending register (Figure 7-19) indicates the source of the request (either the status register or a specific message object). Your interrupt service routine should read the CAN_INT register to ensure that no additional in- terrupts are pending before executing the return instruction.

CAN_INT

Address:

1E5FH

read-only (87C196CB)

Reset State:

00H

The CAN interrupt pending (CAN_INT) register indicates the source of the highest priority pending interrupt. If a status change generated the interrupt request, software can read the status register (CAN_STAT) to determine whether the interrupt request was caused by an abnormal error rate, a successful reception, a successful transmission, or a new error. If an individual message object generated the interrupt request, software can read the associated message object control 0 register (CAN_MSGxCON0). The INT_PND bit-pair will be set, indicating that a receive or transmit interrupt request is pending.

87C196CB

7

0

Pending Interrupt

Bit

 

 

Function

Number

 

 

 

 

 

 

 

 

7:0

Pending Interrupt

 

 

This field indicates the source of the highest priority pending interrupt.

 

Value

Pending Interrupt

Priority (15 is highest; 0 is lowest)

 

00H

none

 

01H

status register

15

 

02H

message object 15

14

 

03H

message object 1

13

 

04H

message object 2

12

 

05H

message object 3

11

 

06H

message object 4

10

 

07H

message object 5

9

 

08H

message object 6

8

 

09H

message object 7

7

 

0AH

message object 8

6

 

0BH

message object 9

5

 

0CH

message object 10

4

 

0DH

message object 11

3

 

0EH

message object 12

2

 

0FH

message object 13

1

 

10H

message object 14

0

 

 

 

 

Figure 7-19. CAN Interrupt Pending (CAN_INT) Register

If a status change generated the interrupt (CAN_INT = 01H), software can read the CAN status register (Figure 7-20) to determine the source of the interrupt request.

7-32

Page 93
Image 93
Intel 8XC196NT, 87C196CB user manual Determining The Can Controller’S Interrupt Status