beautypg.com

Preliminary – Rainbow Electronics T89C51CC02 User Manual

Page 78

background image

78

Rev.A - May 17, 2001

Preliminary

T89C51CC02

15.9. Time Trigger Communication (TTC) and Message Stamping

The T89C51CC02 has a programmable 16-bit Timer (CANTIMH&CANTIML) for message stamp and TTC.

This CAN Timer starts after the CAN controller is enabled by the ENA bit in the CANGCON register.

Two user modes of the timer are implemented:

Time Trigger Communication:

Catch of this timer in the CANTTCH & CANTTCL registers on SOF or EOF, depending on the SYNCTTC
bit in the CANGCON register, when the network is configured in TTC by the TTC bit in the CANGCON register.

In this mode, CAN only sends the frame once, even if an error occurs.

Message Stamping

Catch of this timer in the CANSTMPH & CANSTMPL registers of the message object which received or sent
the frame.

All messages can be stamps.

The stamping of a received frame occurs when the RxOk flag is set.

The stamping of a sent frame occurs when the TxOk flag is set.

The CAN Timer works in a loopback mode (0x0000... 0xFFFF, 0x0000) which serves as a time base to stamp all
received or transmitted messages.

When the timer overflows from 0xFFFF to 0x0000, an interrupt is generated if the ETIM bit of the CAN Timer
in a micro-controller interrupt system register is set.

Figure 63. Block diagram of CAN Timer

EOF on CAN frame

ENA

CANGCON.1

CANTCON

RXOK i

CANSTCH.5

TXOK i

CANSTCH.4

÷

6

Fcan

CLOCK

SOF on CAN frame

TTC

CANGCON.5

SYNCTTC

CANGCON.4

CANTTCH & CANTTCL

CANSTMPH & CANSTMPL

CANTIMH & CANTIML

OVRTIM

CANGIT.5

When 0xFFFF to 0x0000