Example MPC5744P FlexCAN TX RXFIFO ISR GHS614

cancel
Showing results for 
Search instead for 
Did you mean: 

Example MPC5744P FlexCAN TX RXFIFO ISR GHS614

Example MPC5744P FlexCAN TX RXFIFO ISR GHS614

Detailed Description:


 Initializes the MCU including the FlexCAN peripherals.
 Configures the FlexCAN to transmit and receive a CAN message.

 In this config, CAN_0 transmits a message. CAN_1 receives the message.
 CAN_0 MB8 is configured to send data each 1sec.This interval is generated by PIT.
 CAN_1 RXFIFO is configured to receive a message and interrupt for MB5 is enabled.

 To connect FlexCAN0 module (MCU's PB0/PB1 pins) to the motherboard's transceiver
 with J5 CAN DB9 connector you have to:
 - connect J17 2-6 on daughter board
 - connect J17 5-3 on daughter board
 This should be done as default

 

 To connect FlexCAN1 module (MCU's PA14/PA15 pins) to the motherboard's transceiver
 with J6 CAN DB9 connector you have to:
 - connect J37 2-3 on motherboard
 - connect J38 2-3 on motherboard

 Connect CAN0-CANH on P15-1 to CAN1-CANH on P14-1
 Connect CAN0-CANL on P15-2 to CAN1-CANL on P14-2
 Terminate the CAN bus by connecting a 60 ohm resistor between CANH and CANL

 To see LED toggling connect P8.1 to USER LED (P7.x)
 ------------------------------------------------------------------------------
 Test HW:  MPC5744P EVB
 Maskset:  1N65H
 Target :  RAM, internal_FLASH
 Fsys:     200 MHz PLL with 40 MHz crystal reference

Labels (1)
Attachments
Comments

Hello, I want to use your example into S32DS, but some errors occurs. 

As is shown in the following picture:

error.JPG

after I put your INTC_Init.c file to the source, two errors occurs.

What should I do to solve the problem?

Hi,

check the header file to know how the INTC registers are defined.

But, if you create new project through the S32DS Project Wizzard, then is is enough to call xcptn_xmpl (); and add ISR routine into vector table of the intc_SW_mode_isr_vectors_MPC5744P.c file. The  xcptn_xmpl (); is defined in MPC57xx__Interrupt_Init.c.

BR, Petr

The error has not occured. Thank you.

I will check if the code will work normally.

Hello, I have some problems about the example.

The config of CAN0 and CAN1 seems to be different. 

for CAN0, the code shows:/* Configure for OSC (40 MHz), 0.5 MHz bit time */
                                            CAN_0.CTRL1.R = 0x04ED0002;

and for CAN1, CAN_1.CTRL1.R = 0x04E40004;

I wonder how does the code make the baud rate for CAN0 and CAN1 the same? from 40MHz XOSC to 500kHz baud rate?

Actually I wonder How to calculate the baud rate according to the CTRL1 register? Is it relevant to PSEG1, PSEG2 and PROPSEG?

Thank you.

Version history
Revision #:
1 of 1
Last update:
‎09-22-2017 01:27 AM
Updated by: