NXP Semiconductors 23
33813
5.1.2.4 Prepare to shutdown state
The purpose of the PWREN signal is to allow the MCU to control the shutdown of power to itself when the user turns off the KEYSW. This
may be necessary to allow the MCU the time required to perform its pre-shutdown routines. When the MCU wants to shutdown the power
supplies in the 33813, it must write a logic zero (0) to the PWREN bit in the SPI Control register. Only the state of the PWREN bit in the
SPI Control register controls the shutdown of the 33813 power supplies. In this state, only the outputs are turned off (except ROUT2 if the
Shutdown Disable bit is set. See 5.5.3.3. Using ROUT2 as a power relay, page 37).
Note: In case of KEYSW = 1 condition, 33813 goes back in Normal mode, retrieving the last register configuration. This suggests that
before entering in Prepare to Shutdown mode, user needs to configure registers as appropriate (switching off drivers and pre-drivers for
example).
5.1.2.5 Power On Self-test (POST)
When a power on occurs after a POR, it may be desired to go through an initial Power On Self-test routine to ensure the SPI is working
correctly and the status registers in the 33813 are viable. After a POR, all the registers in the 33813 contain their ‘default’ values, as
indicated in the SPI register tables later in this document. The watchdog is also set to its default timeout value of 10 seconds, so any POST
routine must be accomplished within this time frame or a WD reset may occur.
To perform a POST routine, the MCU should first send a SPI message to set the POST enable bit in the SPI control register 1, bit 6. Once
this bit is set, the status registers are disconnected from the analog and logic portions of the 33813 and are connected only to the SPI
circuitry. The POST can then write various data patterns to the status registers and verify that none of the bits are ‘stuck’ and state of the
bit is accurately reflected. Note that bits in the status register labeled ‘x’ are not implemented and testing these bits may result in erroneous
data. After testing all the status registers and confirming they are viable, the status registers can be set back to their default values by
clearing the POST Enable bit back to 0. The POST enable bit allows the MCU to write ones (1s) to the Status registers.
Normally, the status register can only be cleared to zeros by the MCU and ones can be written to the status register only by the 33813
internal logic. This is designed to prevent the MCU from missing any reported fault bits and, for the 33813, to prevent system status errors
resulting from the MCU erroneously writing a one (1) to a fault bit.
Once the POST enable bit is set back to a zero (0) by the MCU, the status register returns to the condition where the 33813 can only write
ones(1s) to it and the MCU can only write zeros (0s) to it. Again, it is important to note that any POST routine should be designed to take
less than 10 seconds to avoid a watchdog reset from occurring and truncating the POST routine, because the WD reset clears the POST
Enable bit as well.
5.1.3 BATSW output functionality
The BATSW output pin has several functionalities:
• By default, the BATSW output pin is an indication of the state of the KEYSW input.
• The BATSW output can also be used to control an LS driver, such as the Relay ROUT2 driver by connecting the BATSW output
to the RIN2 input.
• The BATSW output can also be configured as a low current LED high-side driver controlled through the SPI interface.
5.1.3.1 BATSW pin as a KEYSW input indication
When KEYSW is at VBAT (12 V) level, the BATSW output is a logic 1 (5.0 V) and when KEYSW is at ground (0 V) level, BATSW is at a
logic 0. The BATSW output may be used to inform the MCU the user is trying to shutdown the vehicle.
5.1.3.2 BATSW pin as an LS driver control
The BATSW output can also be used to control an LS driver, such as the Relay ROUT2 driver, by connecting the BATSW output to the
RIN2 input. (see 5.5.3.3. Using ROUT2 as a power relay, page 37)
5.1.3.3 BATSW pin as an LED driver
If the BATSW signal is not needed by the MCU or to control the Relay 2 output, it can be configured as a low current LED high-side driver
controlled through the SPI interface. As a high-side driver, BATSW can be PWM’d to allow an LED to be dimmed. A bit in the SPI Battery
Switch Logic Output Configuration register called ‘HSD’, controls whether the BATSW output is a simple high-side driver, or controlled by
KEYSW as indicated previously.