831
Chapter 18
AFCAN Controller
User’s Manual U16580EE3V1UD00
18.14 Time Stamp Function
CAN is an asynchronous, serial protocol. All nodes connected to the CAN bus have a local, autono-
mous clock. As a consequence, the clocks of the nodes have no relation (i.e., the clocks are asynchro-
nous and may have different frequencies).
In some applications, however, a common time base over the network (= global time base) is needed.
In order to build up a global time base, a time stamp function is used. The essential mechanism of a
time stamp function is the capture of timer values triggered by signals on the CAN bus.
18.14.1 Time
stamp
function
The CAN Controller supports the capturing of timer values triggered by a specific frame. An on-chip 16-
bit capture timer unit in a microcontroller system is used in addition to the CAN Controller. The 16-bit
capture timer unit captures the timer value according to a trigger signal (TSOUT) for capturing that is
output when a data frame is received from the CAN Controller. The CPU can retrieve the time of occur-
rence of the capture event, i.e., the time stamp of the message received from the CAN bus, by reading
the captured value. The TSOUT signal can be selected from the following two event sources and is
specified by the TSSEL bit of the CnTS register.
•
SOF event (start of frame)
(TSSEL = 0)
•
EOF event (last bit of end of frame)
(TSSEL = 1)
The TSOUT signal is enabled by setting the TSEN bit of the CnTS register to 1.
Figure 18-34:
Timing diagram of capture signal TSOUT
The TSOUT signal toggles its level upon occurrence of the selected event during data frame reception
(in <~Reference>Figure 18-34, the SOF is used as the trigger event source). To capture a timer value
by using the TSOUT signal, the capture timer unit must detect the capture signal at both the rising edge
and falling edge.
This time stamp function is controlled by the TSLOCK bit of the CnTS register. When TSLOCK is
cleared to 0, the TSOUT signal toggles upon occurrence of the selected event. If TSLOCK is set to 1,
the TSOUT signal toggles upon occurrence of the selected event, but the toggle is stopped as the
TSEN bit is automatically cleared to 0 as soon as the message storing to the message buffer 0 starts.
This suppresses the subsequent toggle occurrence by the TSOUT signal, so that the time stamp value
toggled last (= captured last) can be saved as the time stamp value of the time at which the data frame
was received in message buffer 0.
Caution
The time stamp function using the TSLOCK bit stops toggle of the TSOUT
signal by receiving a data frame in message buffer 0. Therefore, message
buffer 0 must be set as a receive message buffer. Since a receive message
buffer cannot receive a remote frame, toggle of the TSOUT signal cannot be
stopped by reception of a remote frame. Toggle of the TSOUT signal does not
stop when a data frame is received in a message buffer other than message
buffer 0.
For these reasons, a data frame cannot be received in message buffer 0 when
the CAN module is in the normal operation mode with ABT, because message
buffer 0 must be set as a transmit message buffer. In this operation mode,
therefore, the function to stop toggle of the TSOUT signal by the TSLOCK bit
cannot be used.
t
TSOUT
SOF
SOF
SOF
SOF
Summary of Contents for V850E/PH2
Page 6: ...6 Preface User s Manual U16580EE3V1UD00...
Page 16: ...16 User s Manual U16580EE3V1UD00...
Page 28: ...28 User s Manual U16580EE3V1UD00...
Page 32: ...32 User s Manual U16580EE3V1UD00...
Page 84: ...84 Chapter 2 Pin Functions User s Manual U16580EE3V1UD00 MEMO...
Page 144: ...144 Chapter 3 CPU Functions User s Manual U16580EE3V1UD00 MEMO...
Page 192: ...192 Chapter 5 Memory Access Control Function PD70F3187 only User s Manual U16580EE3V1UD00 MEMO...
Page 312: ...312 Chapter 9 16 Bit Timer Event Counter P User s Manual U16580EE3V1UD00 MEMO...
Page 534: ...534 Chapter 11 16 bit Timer Event Counter T User s Manual U16580EE3V1UD00...
Page 969: ...969 Chapter 20 Port Functions User s Manual U16580EE3V1UD00 MEMO...
Page 970: ...970 Chapter 20 Port Functions User s Manual U16580EE3V1UD00...
Page 976: ...976 Chapter 22 Internal RAM Parity Check Function User s Manual U16580EE3V1UD00 MEMO...
Page 984: ...984 Chapter 23 On Chip Debug Function OCD User s Manual U16580EE3V1UD00 MEMO...
Page 1006: ...1006 Chapter 24 Flash Memory User s Manual U16580EE3V1UD00 MEMO...
Page 1036: ...1036 Chapter 27 Recommended Soldering Conditions User s Manual U16580EE3V1UD00 MEMO...
Page 1046: ...1046 Appendix A Index User s Manual U16580EE3V1UD00 MEMO...
Page 1052: ...1052 User s Manual U16580EE3V1UD00...
Page 1053: ......