Texas Instruments | TCAN4550 Watchdog | Application notes | Texas Instruments TCAN4550 Watchdog Application notes

Texas Instruments TCAN4550 Watchdog Application notes
Application Report
SLLA455 – April 2019
TCAN4550 Watchdog Configuration Guide
Eric Hackett
ABSTRACT
This application report presents the configuration, function, and use of the watchdog feature integrated
into the TCAN4550 family of system basis chips (SBC) with integrated CAN FD controller and transceiver.
Use cases and examples featuring the TCAN4550 are also provided to help further explain the features
benefits.
1
2
3
4
5
6
Contents
Introduction ...................................................................................................................
General Description of Watchdog .........................................................................................
Timeout Watchdog...........................................................................................................
Explanation of Watchdog Specific to TCAN4550 ........................................................................
Watchdog Configuration ....................................................................................................
Summary ......................................................................................................................
1
1
2
2
2
4
List of Tables
..................................................................................
1
Watchdog Timer Configuration Options
2
GPO2 Configuration Options ............................................................................................... 3
2
3
GPIO1 Configuration Options .............................................................................................. 3
4
Watchdog Action Configuration Options .................................................................................. 3
Trademarks
All trademarks are the property of their respective owners.
1
Introduction
As Controller Area Network (CAN) technology moves to faster and faster data rates in applications, the
need for developers to move from classical CAN to CAN flexible data-rate (FD) is apparent. Part of the
challenge from moving from classic CAN to CAN FD is having to find a new controller: either a dedicated
CAN FD controller, which are few and far between and add cost, or a microcontroller with the CAN FD
stack integrated, which is also an expensive addition to the application. The TI TCAN4550 helps
overcome the cost and complexity challenges when moving to CAN FD, bridging the gap by allowing the
use of an MCU only requiring SPI, and converting the SPI message to CAN frames on the CAN bus.
The TCAN4550 also integrates an LDO for self-supplied CAN, as well as an low-dropout (LDO) output,
and a Watchdog, making it a part of Texas Instruments' CAN SBC family, and the first to be released to
market. This application report goes into detail about the configuration and servicing of the TCAN4550
device.
2
General Description of Watchdog
A watchdog function is common in the electronics industry, and is a timer meant to verify that the
controller of a device is working correctly. This is done by the controller periodically updating or resetting a
timer in the controlled device based upon a specific timing sequence. If this is not executed correctly, an
interrupt or timeout signal is generated. Depending on the system design, some kind of corrective action
takes place. The idea is that in systems where human intervention is not easy, possible, or cannot take
place quick enough, the system autonomously fixes any issues with its main controller by forcing a reset
on it.
SLLA455 – April 2019
Submit Documentation Feedback
TCAN4550 Watchdog Overview and Configuration Guide
Copyright © 2019, Texas Instruments Incorporated
1
Timeout Watchdog
3
www.ti.com
Timeout Watchdog
The timeout watchdog is the simplest implementation of the watchdog function. The general concept goes
as follows: a timer is started as soon as the first watchdog trigger is sent, and that same trigger must be
sent within the configured time limit, or an error is asserted. In most cases, an error counter is
incremented when the timer runs out before a trigger occurs, and when this counter reaches a certain
value, a fault (interrupt) is sent to the controller to initiate the diagnostic and/or fixing mechanisms.
4
Explanation of Watchdog Specific to TCAN4550
The TCAN4550 integrates a timeout watchdog for monitoring the microprocessor. When using the
watchdog function, it runs continuously and is default enabled. There are four different timer values for the
timeout length and three options for watchdog failure indication. The watchdog is active in normal and
standby modes, but off in sleep mode. However, the watchdog timer does not begin until the first correct
trigger is received. Once the first correct trigger is received, the watchdog runs continuously until it is
serviced incorrectly, where a watchdog failure occurs.
There are two options for triggering the watchdog service: writing to a register, or by toggling the voltage
on the GPIO1 pin either high or low. Until the first trigger is issued, the watchdog does not run even if it is
enabled through the registers, and the first trigger can happen in standby or normal mode.
If the watchdog timer expires with no correct service, then a watchdog event occurs. This event can be
indicated in three different ways, all configurable through SPI registers. The three indicators are setting an
interrupt to output on the nINT pin, pulsing INH pin and placing the device into standby mode, or pulsing
the watchdog output pin. The watchdog output pin in this case is GPO2, which can be configured to be the
watchdog event output in the same register as the rest of the watchdog configuration bits. It is important to
note that even if the option of toggling INH or the GPO2 is chosen, the watchdog timeout interrupt is still
set and nINT still toggles, giving two indications. However, if the interrupt option is chosen, only that
indicates the watchdog failure event.
5
Watchdog Configuration
The configuration options for the watchdog on TCAN4550 are located in register 0x0800. The watchdog
timer, GPO2 configuration, watchdog service bit, watchdog failure event indication configuration, GPIO1
configuration, and watchdog enable are all contained in the register.
5.1
Watchdog Timer Configuration
The watchdog timer is configured by setting bits [29:28] in register 0x0800; the four options are 60 ms,
600 ms, 3 s, and 6 s. By default, the timer is set to 60 ms, meaning that once the first correct watchdog
trigger is sent, the timer begins to count to 60 ms. If a correct trigger is received before the 60 ms timer
runs out, then the watchdog has been correctly serviced. The moment the correct trigger is sent, the timer
restarts from that point to count up to 60 ms again. The timer does not go the full duration, even when
correctly serviced. If the watchdog is not correctly serviced within the 60 ms timer, a watchdog failure
event occurs.
Table 1. Watchdog Timer Configuration Options
REGISTER 0x0800 BITS [29:28] VALUE
2
DESCRIPTION
00
60 ms
01
600 ms
10
3s
11
6s
TCAN4550 Watchdog Overview and Configuration Guide
Copyright © 2019, Texas Instruments Incorporated
SLLA455 – April 2019
Submit Documentation Feedback
Watchdog Configuration
www.ti.com
5.2
GPO2 Configuration
GPO2 can be configured as an M_CAN_INT 0 interrupt, the watchdog output, or to mirror the nINT pin. So
while it is not specific to the watchdog function, it does have an option that affects the watchdog failure
indication. Configuring GPO2 to be the watchdog output pin causes the pin to toggle high to low to high in
300 ms in the case of a watchdog failure. If GPO2 is configured to mirror the nINT pin, it still signals the
watchdog failure event, but as a result of the watchdog failure interrupt being set.
Table 2. GPO2 Configuration Options
REGISTER 0x0800 bits [23:22] VALUE
5.3
DESCRIPTION
00
No action
01
M_CAN_INT 0 interrupt (active low)
10
Watchdog output
11
Mirror nINT pin
Watchdog Service Configuration
Bit 18 in register 0x0800 is designated as the watchdog service bit. This bit is used to service the
watchdog if the GPIO1 analog trigger is not enabled. To correctly service using the bit, write bit 18 in
register 0x0800 to 1 within the watchdog timer, and the timer resets from the moment the bit was written.
There is also the option to enable GPIO1 as the watchdog service input. The GPIO1 configuration bits are
[15:14] in register 0x0800, and writing a 10 to those bits configures the GPIO1 as the watchdog input
trigger. To correctly service the watchdog using GPIO1, a pulse from low to high or high to low must
happen within the watchdog timer; the service is recognized on the transition edge. Once the edge
transition is seen by GPIO1 within the watchdog timer, the timer resets and begins counting up to the
configured timer value.
Table 3. GPIO1 Configuration Options
5.4
REGISTER 0x0800 BITS [15:14] VALUE
DESCRIPTION
00
GPO
01
Reserved
10
GPI - Automatically becomes a WD input trigger pin
11
Reserved
Watchdog Failure Event Indication Configuration
As mentioned in Section 4, there are three different options for watchdog failure indication: set the
interrupt flag toggling nINT, pulse INH pin then place the device in standby mode, or pulse the watchdog
output pin (GPO2 if enabled). Again, it is important to remember that no matter what the watchdog timeout
interrupt flag is set as in the case of a watchdog failure, meaning that nINT also always toggles in a
watchdog failure. Selecting this option in register 0x0800 bits [17:16] merely makes it so that only the
interrupt is set, and nothing else indicates the watchdog failure.
Table 4. Watchdog Action Configuration Options
REGISTER 0x0800 BITS [17:16] VALUE
DESCRIPTION
00
Set interrupt flag and if a pin is configured to reflect WD output as an interrupt,
the pin shows low.
01
Pulse INH pin and place device into standby mode - high to low to high in 300
ms
10
Pulse watchdog output pin if enabled - high to low to high in 300 ms
11
Reserved
SLLA455 – April 2019
Submit Documentation Feedback
TCAN4550 Watchdog Overview and Configuration Guide
Copyright © 2019, Texas Instruments Incorporated
3
Summary
6
www.ti.com
Summary
The watchdog configuration and service can be a daunting task for any device. Hopefully this report sheds
some light on the function of the watchdog module on the TCAN4550-Q1 CAN SBC, and allows the
development to be as smooth and straightforward as possible.
4
TCAN4550 Watchdog Overview and Configuration Guide
Copyright © 2019, Texas Instruments Incorporated
SLLA455 – April 2019
Submit Documentation Feedback
IMPORTANT NOTICE AND DISCLAIMER
TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATASHEETS), DESIGN RESOURCES (INCLUDING REFERENCE
DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES “AS IS”
AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD
PARTY INTELLECTUAL PROPERTY RIGHTS.
These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate
TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable
standards, and any other safety, security, or other requirements. These resources are subject to change without notice. TI grants you
permission to use these resources only for development of an application that uses the TI products described in the resource. Other
reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third
party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims,
damages, costs, losses, and liabilities arising out of your use of these resources.
TI’s products are provided subject to TI’s Terms of Sale (www.ti.com/legal/termsofsale.html) or other applicable terms available either on
ti.com or provided in conjunction with such TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable
warranties or warranty disclaimers for TI products.
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2019, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertising