EasyManuals Logo

ST STM32F10 Series User Manual

ST STM32F10 Series
519 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #285 background imageLoading...
Page #285 background image
UM0306 Controller area network (bxCAN)
285/519
14.4 Operating modes
bxCAN has three main operating modes: initialization, normal and SLEEP. After a
hardware reset, bxCAN is in SLEEP mode to reduce power consumption and an internal
pull-up is active on CANTX. The software requests bxCAN to enter initialization or SLEEP
mode by setting the INRQ or SLEEP bits in the CAN_MCR register. Once the mode has
been entered, bxCAN confirms it by setting the INAK or SLAK bits in the CAN_MSR register
and the internal pull-up is disabled. When neither INAK nor SLAK are set, bxCAN is in
normal mode. Before entering normal mode bxCAN always has to synchronize on the
CAN bus. To synchronize, bxCAN waits until the CAN bus is idle, this means 11 consecutive
recessive bits have been monitored on CANRX.
14.4.1 Initialization mode
The software initialization can be done while the hardware is in Initialization mode. To enter
this mode the software sets the INRQ bit in the CAN_MCR register and waits until the
hardware has confirmed the request by setting the INAK bit in the CAN_MSR register.
To leave Initialization mode, the software clears the INQR bit. bxCAN has left Initialization
mode once the INAK bit has been cleared by hardware.
While in Initialization Mode, all message transfers to and from the CAN bus are stopped and
the status of the CAN bus output CANTX is recessive (high).
Entering Initialization Mode does not change any of the configuration registers.
To initialize the CAN Controller, software has to set up the Bit Timing (CAN_BTR) and CAN
options (CAN_MCR) registers.
To initialize the registers associated with the CAN filter banks (mode, scale, FIFO
assignment, activation and filter values), software has to set the FINIT bit (CAN_FMR). Filter
initialization also can be done outside the initialization mode.
Note: When FINIT=1, CAN reception is deactivated.
The filter values also can be modified by deactivating the associated filter activation bits (in
the CAN_FA0R register).
If a filter bank is not used, it is recommended to leave it non active (leave the corresponding
FACT bit cleared).
14.4.2 Normal mode
Once the initialization has been done, the software must request the hardware to enter
Normal mode, to synchronize on the CAN bus and start reception and transmission.
Entering Normal mode is done by clearing the INRQ bit in the CAN_MCR register and
waiting until the hardware has confirmed the request by clearing the INAK bit in the
CAN_MSR register. Afterwards, the bxCAN synchronizes with the data transfer on the CAN
bus by waiting for the occurrence of a sequence of 11 consecutive recessive bits (≡ Bus Idle)
before it can take part in bus activities and start message transfer.
The initialization of the filter values is independent from Initialization Mode but must be done
while the filter is not active (corresponding FACTx bit cleared). The filter scale and mode
configuration must be configured before entering Normal Mode.
www.BDTIC.com/ST

Table of Contents

Other manuals for ST STM32F10 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F10 Series and is the answer not in the manual?

ST STM32F10 Series Specifications

General IconGeneral
BrandST
ModelSTM32F10 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals