Example MPC5748G FlexCAN FD simple TX/RX GHS614

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Example MPC5748G FlexCAN FD simple TX/RX GHS614

Example MPC5748G FlexCAN FD simple TX/RX GHS614

********************************************************************************
* Detailed Description:
*
* Configures the FlexCANs to transmit and receive a CAN FD message with or without
* bit rate switching for data phase.
* Baudrate during arbitration phase is set to 500kbps, during data phase 2Mpbs.
*
* In this config, CAN_0 transmits a message. CAN_1 receives the message.
*
* EVB connection:
*
* CAN0-CANH on P15-1 to CAN1-CANH on P14-1
* CAN0-CANL on P15-2 to CAN1-CANL on P14-2
*
* NOTE! Termination resistor (120Ohm) have to be placed on transceivers output
*
* ------------------------------------------------------------------------------
* Test HW:  X-MPC574xG-324DS + X-MPC574XG-MB
* Maskset:  1N81M
* Target :  FLASH
* Fsys:     160 MHz PLL
*
********************************************************************************

Labels (1)
Attachments
Comments

HI!

Which CAN FD analyzer do you use?

Hi,

I did not use CAN analyzer, only scope and debugger.

Petr

Hi.

I want use MB[1] receive CAN FD.

I only modify "void FlexCAN1_Init(void)" this section:

CAN_1.MB[1].CS.B.IDE = 0; 
CAN_1.MB[1].ID.B.ID_STD = 0; 
CAN_1.MB[1].CS.B.CODE = 4; 

And modify "void ReceiveMsgFD(void)" this Section:

while (CAN_1.IFLAG1.B.BUF4TO1I != 1) {};  /* Wait for CAN 1 MB 1 flag */

but always stopped at  "while (CAN_1.IFLAG1.B.BUF4TO1I != 1) {};  "

Where i lost initialization CAN1 of MB[1] setting?

How can i do?

Jim Huang

Hi,

did you really sent message with std ID = 0, so it can be received into MB1? Mask register RXIMR[1] was set 0x1FFFFFFF so the received ID must equal. 

Also check the IFLAG1 register directly in the debugger if flag is set or not.

BR, Petr

Hi, 

I imported this project into my S32 Design Studio. Import method is File -> Import -> Project from Folder or Archive. But I can not build or debug this project anymore. Do you know why? I just started using this IDE, thank you!

Tianxiang

No ratings
Version history
Last update:
‎12-15-2016 06:06 AM
Updated by: