13-75
13
32180 Group User’s Manual (Rev.1.0)
CAN MODULE
13.4 Initializing the CAN Module
13.4 Initializing the CAN Module
13.4.1 Initializing the CAN Module
Before performing communication, set up the CAN module as described below.
(1) Selecting pin functions
The CAN transmit data output pin (CTX) and CAN data receive input pin (CRX) are shared with input/output
ports. Be sure to select the functions of these pins. (See Chapter 8, “Input/Output Ports and Pin Functions.”
(2) Setting the Interrupt Controller (ICU)
To use CAN module interrupts, set their interrupt priority levels.
(3) Setting the CAN Error, CAN Single-Shot and CAN Slot Interrupt Request Enable Registers
To use CAN bus error, CAN error passive, CAN error bus off, CAN single-shot or CAN slot interrupts, set
each corresponding bit to "1" to enable the interrupt request.
(4) Setting the bit timing and the number of times sampled
Using the CAN Configuration Register and CAN Baud Rate Prescaler, set the bit timing and the number of
times the CAN bus is sampled.
1) Setting the bit timing
Determine the period Tq that is the base of bit timing, the configuration of Propagation Segment, Phase
Segment1 and Phase Segment2, and reSynchronization Jump Width. The equation to calculate Tq is
given below.
Tq = (BRP + 1) / (CPU clock/2)
The baud rate is determined by the number of Tq’s that comprise one bit. The equation to calculate the
baud rate is given below.
Baud rate (bps) =
1
Tq period
×
number of Tq’s in one bit
Number of Tq’s in one bit = Synchronization S Propagation S Phase Segment 1
+ Phase Segment 2
2) Setting the number of times sampled
Select the number of times the CAN bus is sampled from “one time” and “three times.”
• If one-time sampling is selected, the value sampled at only the end of Phase Segment1 is assumed to
be the value of the bit.
• If three-time sampling is selected, the value of the bit is determined by majority from three sampled
values, one sampled at the end of Phase Segment1 and the other sampled 1 Tq before and 2 Tq’s
before that.
Содержание M32R/ECU Series
Страница 17: ...12 This page is blank for reasons of layout...
Страница 18: ...CHAPTER 1 OVERVIEW 1 1 Outline of the 32180 Group 1 2 Block Diagram 1 3 Pin Functions 1 4 Pin Assignments...
Страница 712: ...CHAPTER 18 OSCILLATOR CIRCUIT 18 1 Oscillator Circuit 18 2 Clock Generator Circuit...
Страница 794: ...CHAPTER 22 TYPICAL CHARACTERISTICS...
Страница 795: ...22 22 2 32180 Group User s Manual Rev 1 0 TYPICAL CHARACTERISTICS To be written at a later time...
Страница 796: ...APPENDIX 1 MECHANICAL SPECIFICAITONS Appendix 1 1 Dimensional Outline Drawing...
Страница 798: ...APPENDIX 2 INSTRUCTION PROCESSING TIME Appendix 2 1 32180 Instruction Processing Time...
Страница 802: ...APPENDIX 3 PROCESSING OF UNUSED PINS Appendix 3 1 Example Processing of Unused Pins...