EasyManuals Logo

Renesas M32R/ECU Series User Manual

Renesas M32R/ECU Series
839 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 #622 background imageLoading...
Page #622 background image
13-75
13
32180 Group Users 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 Tqs that comprise one bit. The equation to calculate the
baud rate is given below.
Baud rate (bps) =
1
Tq period × number of Tqs in one bit
Number of Tqs in one bit = Synchronization Segment + Propagation Segment + 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.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas M32R/ECU Series and is the answer not in the manual?

Renesas M32R/ECU Series Specifications

General IconGeneral
BrandRenesas
ModelM32R/ECU Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals