04.03.2013 Views

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Under development<br />

Preliminary document<br />

Specifications in this document are tentative and subject to change.<br />

<strong>RL78</strong>/<strong>D1A</strong> CHAPTER 14 CAN CONTROLLER<br />

14.14 Time Stamp Function<br />

CAN is an asynchronous, serial protocol. All nodes connected to the CAN bus have a local, autonomous clock. As a<br />

consequence, the clocks of the nodes have no relation (i.e., the clocks are asynchronous and may have different<br />

frequencies).<br />

In some applications, however, a common time base over the network (= global time base) is needed. In order to build<br />

up a global time base, a time stamp function is used. The essential mechanism of a time stamp function is the capture of<br />

timer values triggered by signals on the CAN bus.<br />

14.14.1 Time stamp function<br />

The CAN controller supports the capturing of timer values triggered by a specific frame. An on-chip 16-bit capture timer<br />

unit in a microcontroller system is used in addition to the CAN controller. The 16-bit capture timer unit captures the timer<br />

value according to a trigger signal (TSOUT) for capturing that is output when a data frame is received from the CAN<br />

controller. The CPU can retrieve the time of occurrence of the capture event, i.e., the time stamp of the message received<br />

from the CAN bus, by reading the captured value. TSOUT signal can be selected from the following two event sources<br />

and is specified by the TSSEL bit of the C0TS register.<br />

- SOF event (start of frame) (TSSEL = 0)<br />

- EOF event (last bit of end of frame) (TSSEL = 1)<br />

The TSOUT signal is enabled by setting the TSEN bit of the C0TS register to 1.<br />

TSOUT<br />

Figure 14-61. Timing Diagram of Capture Signal TSOUT<br />

SOF SOF SOF SOF<br />

TSOUT signal toggles its level upon occurrence of the selected event during data frame reception (in the above timing<br />

diagram, the SOF is used as the trigger event source). To capture a timer value by using TSOUT signal, the capture timer<br />

unit must detect the capture signal at both the rising edge and falling edge.<br />

This time stamp function is controlled by the TSLOCK bit of the C0TS register. When TSLOCK is cleared to 0, TSOUT<br />

bit toggles upon occurrence of the selected event. If TSLOCK bit is set to 1, TSOUT toggles upon occurrence of the<br />

selected event, but the toggle is stopped as the TSEN bit is automatically cleared to 0 as soon as the message storing to<br />

the message buffer 0 starts. This suppresses the subsequent toggle occurrence by TSOUT, so that the time stamp value<br />

toggled last (= captured last) can be saved as the time stamp value of the time at which the data frame was received in<br />

message buffer 0.<br />

R01UH0317EJ0004 Rev. 0.04 909<br />

Feb. 22, 2013<br />

t

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!