Datasheet
2003-2019 Microchip Technology Inc. DS20001801J-page 59
MCP2515
10.0 MODES OF OPERATION
The MCP2515 has five modes of operation. These
modes are:
1. Configuration mode
2. Normal mode
3. Sleep mode
4. Listen-Only mode
5. Loopback mode
The operational mode is selected via the
REQOP[2:0] bits (CANCTRL[7:5]); see Register 10-1).
When changing modes, the mode will not actually
change until all pending message transmissions are
complete. The requested mode must be verified by
reading the OPMODE[2:0] bits (CANSTAT[7:5]); see
Register 10-2.
10.1 Configuration Mode
The MCP2515 must be initialized before activation.
This is only possible if the device is in the Configuration
mode. Configuration mode is automatically selected
after power-up, a Reset or can be entered from any
other mode by setting the REQOP[2:0] bits to ‘100’.
When Configuration mode is entered, all error counters
are cleared. Configuration mode is the only mode
where the following registers are modifiable:
• CNF1, CNF2, CNF3 registers
• TXRTSCTRL register
• Filter registers
• Mask registers
10.2 Sleep Mode
The MCP2515 has an internal Sleep mode that is used
to minimize the current consumption of the device. The
SPI interface remains active for reading even when the
MCP2515 is in Sleep mode, allowing access to all
registers.
To enter Sleep mode, the Request Operation Mode bits
are set in the CANCTRL register (REQOP[2:0]). The
OPMODE[2:0] bits (CANSTAT[7:5]) indicate the opera-
tion mode. These bits should be read after sending the
SLEEP command to the MCP2515. The MCP2515 is
active and has not yet entered Sleep mode until these
bits indicate that Sleep mode has been entered.
When in internal Sleep mode, the wake-up interrupt is
still active (if enabled). This is done so that the MCU
can also be placed into a Sleep mode and use the
MCP2515 to wake it up upon detecting activity on the
bus.
When in Sleep mode, the MCP2515 stops its internal
oscillator. The MCP2515 will wake-up when bus activity
occurs or when the MCU sets, via the SPI interface, the
WAKIF bit (CANINTF[6]). To ‘generate’ a wake-up
attempt, the WAKIE bit (CANINTE[6]) must also be set
in order for the wake-up interrupt to occur.
The TXCAN pin will remain in the recessive state while
the MCP2515 is in Sleep mode.
10.2.1 WAKE-UP FUNCTIONS
The device will monitor the RXCAN pin for activity while
it is in Sleep mode. If the WAKIE bit is set, the device
will wake-up and generate an interrupt. Since the inter-
nal oscillator is shut down while in Sleep mode, it will
take some amount of time for the oscillator to start-up
and the device to enable itself to receive messages.
This Oscillator Start-up Timer (OST) is defined as
128 T
OSC
.
The device will ignore the message that caused the
wake-up from Sleep mode, as well as any messages
that occur while the device is ‘waking up’. The device
will wake-up in Listen-Only mode. The MCU must set
Normal mode before the MCP2515 will be able to
communicate on the bus.
The device can be programmed to apply a low-pass
filter function to the RXCAN input line while in internal
Sleep mode. This feature can be used to prevent the
device from waking up due to short glitches on the CAN
bus lines. The WAKFIL bit (CNF3[6]) enables or
disables the filter.
10.3 Listen-Only Mode
Listen-Only mode provides a means for the MCP2515 to
receive all messages (including messages with errors)
by configuring the RXM[1:0] bits (RXBnCTRL[6:5]). This
mode can be used for bus monitor applications or for
detecting the baud rate in ‘hot plugging’ situations.
For Auto-Baud Detection (ABD), it is necessary that at
least two other nodes are communicating with each
other. The baud rate can be detected empirically by
testing different values until valid messages are
received.
Listen-Only mode is a silent mode, meaning no
messages will be transmitted while in this mode
(including error flags or Acknowledge signals). In
Listen-Only mode, both valid and invalid messages will
be received, regardless of filters and masks or the
Receive Buffer Operating Mode bits, RXMn. The error
counters are reset and deactivated in this state. The
Listen-Only mode is activated by setting the Request
Operation Mode bits (REQOP[2:0]) in the CANCTRL
register.