Professional Documents
Culture Documents
Stm32f103rb Can Bus
Stm32f103rb Can Bus
Stm32f103rb Can Bus
Tx:
3 Transmit mailbox
Modes
3 modes Sleep/ init/normal / after reset we are in sleep mode to reduce power consumption
INIT Modes
/1. Set INRQ bit in CAN_MCR - - - > verify INAK bit in CAN_MSR
To leave the init mode clear bit INRQ from CAN_MCR
In INIT mode :
1/ Configure the Bit Timing CAN_BTR and CAN option CAN_MCR
2/ To init the CAN filter banck FINIT bit must be set CAN_FMR
- -- - > CAN filter can be done outside the init mode
Normal Mode
CAN Bus start reception and transmission !!
1/ Clearing INRQ bit int the CAN_MCR --- > verify INAK bit is cleared in CAN_MSR
SLEEP MODE
1/ SET SLEEP bit in CAN_MCR
CLEAR SLEEP bit to go to INIT mode
IF CAN activity is detected -- - -> HArware performs the wakeup automatically by clearing the SLEEP
bit IF AWUM bit in CAN_MCR is set !!
TEST MODE
Test Mode must be selected when bxCAN is in INIT Mode :
Test Mode : 1/ Silent Mode
2/ Loop Back mode
3/ Loop Back combined with silent mode
Silent Mode
1/ Set SILM bit in CAN_BTR
In silent mode bxCAN is able to receive valid frames aand remote frames but it send only recessive
bits(1) on the CAN bus - -- - > it is used to analyze the traffic on can without affecting it
-- -- > if bxCAN has to send a dominant bit , the bit is rerouted internally