Brief Analysis of Infineon TC3XX MCAL CAN Module

Publisher:清新家园Latest update time:2023-05-04 Source: 汽车ECU开发 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Infineon 's chips are widely used in automotive electronics. I have used them before. I have been using the TC3 series CAN module recently, so I just wanted to write a simple article about it.


Taking TC387 as an example, there are three MCM CAN modules, namely CAN 0, CAN1, and CAN2. The following figure shows the basic parameters of the three CAN modules, among which CAN0 has the most comprehensive functions.

1679319760806901.png

As can be seen from the figure, each CAN module has 4 CAN Nodes. Each Node is implemented using Bosch's M_CAN method, supports CAN and CANFD, and has a maximum rate of 5Mbps. Each Node has a maximum of 64 Rx Buffers and supports a maximum of 2 Rx FIFOs. In addition, each Node has a maximum of 32 Tx Buffers and supports a maximum of 1 Tx FIFO/Tx Queue.


Compared with TC2XX, the difference lies in the replacement of the original Message Object with Message RAM, the addition of Pretended Networking features, and the addition of Range Filter functions.


Let’s talk about the details below.


01. Clock


First, let's look at the clock. For the CAN module, there are mainly Fsyn and Fasyn, as shown in the figure below. Fsyn provides the clock for access to CAN-related registers and Message RAM, and Fasyn provides the clock for CAN/CAN FD baud rate generation. In order for MCMCAN to have good performance, it is very important to ensure that Fsyn>=Fasyn.


1679319746876784.png


02. Data sending and receiving management


Data transmission and reception are divided into Dedicated Rx/Tx Buffer and RX FIFO, where Dedicated Rx Buffer means each ID corresponds to a buffer, that is, FULL CAN. All Dedicated Rx Buffer addresses must be continuous and the occupied Message RAM size must be the same.


After each Dedicated Rx Buffer is written with data, it will be locked and no new data will be written from the CAN Bus until the CPU completes accessing the Dedicated Rx Buffer and then unlocks it.


Rx Buffer is actually multiple Rx Buffers composed of Rx FIFO for management. Each CAN Node can set up to 2 Rx FIFOs, namely Rx FIFO 0 and Rx FIFO 1. Each Rx FIFO can contain up to 64 Rx Buffer data.


Both Dedicated Rx Buffer and Rx FIFO can set Filtering to determine which messages on the CAN Bus are received.


Message transmission is also divided into Dedicated Tx Buffer and Tx FIFO, but there is an additional Tx Queue. The meanings of the first two are the same as those mentioned in the receiving management. There are a few points to note in Tx management. Dedicated Tx Buffer and Tx FIFO or Tx Queue can exist at the same time, but there can be a maximum of 32 Tx Buffers.


For the coexistence of Dedicated Tx Buffer and Tx FIFO, they must be arranged in order. Each time arbitration is sent, all Dedicated Tx Buffers and the oldest Tx FIFO Tx Buffer are compared in priority, and the one with the smallest Message ID is sent first.


For the coexistence of Dedicated Tx Buffer and Tx Queue, they are also arranged in the order of Dedicated Tx Buffer and Tx Queue. Each time arbitration is sent, the priority of all Dedicated Tx Buffers and Tx Buffers in the Tx Queue is compared. The one with the smallest Message ID is sent first. If the Message IDs are the same, the Tx Buffer with the earlier order is sent first.


03. MCAL configuration


Regarding the MCU and CAN module, the first step is to set the clock frequency of the CAN module, as shown in the figure below.


1679319731956313.png


Below is the Port module, which is configured according to the hardware interface table. For example, P20.8 is configured as output, as shown in the figure below.


1679319716708204.png


The following is the configuration of the CAN module, configuring RXDB, as well as the sending and waking up methods. The following is the polling mode, and the following is the CAN clock source and the corresponding baud rate.


1679319705484731.png


The following is the setting of baud rate. In order to configure the sampling point at about 80%, it is necessary to configure the time parameters of each segment. This is usually required by the OEM, so just configure it accordingly.


1679319692644746.png


Next, configure the Hardware object, including the frame type, FIFO or other type, and the associated CAN module.


1679319678506286.png


You can also configure filters as shown in the following figure.


1679319667479792.png


Finally, configure the operation cycle of the main function of the CAN module, as shown in the following figure.


1679319655235506.png






Reference address:Brief Analysis of Infineon TC3XX MCAL CAN Module

Previous article:MIPI improves transmission performance of next-generation image data
Next article:Mercedes-Benz Actros series gateway CAN bus fault analysis

Popular Resources
Popular amplifiers
Latest Automotive Electronics Articles
MoreSelected Circuit Diagrams
Change More Related Popular Components
MorePopular Articles
MoreDaily News
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号