beautypg.com

4 it can management – Rainbow Electronics T89C51CC01 User Manual

Page 74

background image

74

T89C51CC01

Rev. D – 17-Dec-01

15.3.1 Buffer mode

Any message object can be used to define one buffer, including non-consecutive mes-
sage objects, and with no limitation in number of message objects used up to 15.

Each message object of the buffer must be initialized CONCH2 = 1 and CONCH1 = 1;

Figure 32. Buffer mode

The same acceptance filter must be defined for each message objects of the buffer.
When there is no mask on the identifier or the IDE, all messages are accepted.

A received frame will always be stored in the lowest free message object.

When the flag Rxok is set on one of the buffer message objects, this message object
can then be read by the application. This flag must then be cleared by the software and
the message object re-enabled in buffer reception in order to free the message object.

The OVRBUF flag in the CANGIT register is set when the buffer is full. This flag can
generate an interrupt.

The frames following the buffer-full interrupt will not stored and no status will be over-
written in the CANSTCH registers involved in the buffer until at least one of the buffer
message objects is re-enabled in reception.

This flag must be cleared by the software in order to acknowledge the interrupt.

15.4 IT CAN management

The different interrupts are:

Transmission interrupt,

Reception interrupt,

Interrupt on error (bit error, stuff error, crc error, form error, acknowledge error),

Interrupt when Buffer receive is full,

Interrupt on overrun of CAN Timer.

message object 0

message object 1

message object 2

message object 3

message object 4

message object 5

message object 6

message object 7

message object 8

message object 9

message object 10

message object 11

message object 12

message object 13

Block buffer

buffer 0

buffer 1

buffer 2

buffer 3

buffer 4

buffer 5

buffer 6

buffer 7

message object 14