upd70f3402 Renesas Electronics Corporation., upd70f3402 Datasheet - Page 651

no-image

upd70f3402

Manufacturer Part Number
upd70f3402
Description
32-/16-bit Single-chip Microcontroller With Can Interface
Manufacturer
Renesas Electronics Corporation.
Datasheet
16.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 even 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.
16.14.1 Time stamp function
The CAN controller supports the capturing of timer values triggered by successful reception of a data
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 occurrence of the capture event, i.e., the time stamp of the message received from
the CAN bus, by reading the captured value. TSOUT can be selected from the following two event
sources and is specified by the TSSEL bit of the CnTS register.
The TSOUT signal is enabled by setting the TSEN bit of the CnTS register to 1.
TSOUT toggles its level upon occurrence of the selected event during data frame reception (in the
above timing diagram, the SOF is used as the trigger event source). To capture a timer value by using
TSOUT, 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, TSOUT toggles upon occurrence of the selected event. If TSLOCK is set to 1, TSOUT tog-
gles upon occurrence of the selected event, but the toggle is stopped as the TSEN bit is automatically
cleared to 0 when a data frame is received and stored in message buffer 0. This suppresses the subse-
quent toggle occurrence by TSOUT, 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:
Remark:
• SOF event (start of frame)
• EOF event (last bit of end of frame) (TSSEL = 1)
TSOUT
The time stamp function using TSLOCK stops toggle of TSOUT by receiving a data
frame in message buffer 0. Therefore, message buffer 0 must be set as a receive mes-
sage buffer. Since a receive message buffer cannot receive a remote frame, toggle of
TSOUT cannot be stopped by reception of a remote frame. Toggle of TSOUT 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 func-
tion to stop toggle of TSOUT by TSLOCK cannot be used.
n = 0, 1
m = 0 to 31
SOF
Figure 16-56: Timing Diagram of Capture Signal TSOUT
User’s Manual U16702EE3V2UD00
Chapter 16 FCAN Controller
SOF
(TSSEL = 0)
SOF
SOF
t
651

Related parts for upd70f3402