I have a problem about recieve can message in mpc 5634M

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

I have a problem about recieve can message in mpc 5634M

Jump to solution
1,211 Views
mootan
Contributor II

I got a few question to ask

 

Q1. How to initial  Can in this board . I'm not sure that this board have to initial to can C or not

 

 

Q2.

    I try to edit the code from the example that is in free scale community but it still  wont work.    I try to run the code with code warrior 10.6 and it stuck in       while (CAN_A.IFRL.B.BUF04I == 0) {};

I sent some can message using Can bus analyzer from micochip and the code still stuck at that line and didn't go on.

Could anyone help what i do wrong.

Original Attachment has been moved to: main.c.zip

Labels (1)
Tags (1)
1 Solution
833 Views
PetrS
NXP TechSupport
NXP TechSupport

it would be ideally if you can check the CAN_A RX pin with a scope if there is a frame available. if yes, then can suggest this...

- check if correct MB was prepared, also be sure the ID is the same. The example I pointed to prepares MB5 for receiving. Your Receive code check the MB4's flag.

  check the IFRL register if other flag is set

- look at ECR and ESR registers to know if there is any error

- try to use this bit timing setting CAN_A.CR.R = 0x07DB0000 /* Configure for 8MHz OSC, 100KHz bit time */

BR,

Petr

View solution in original post

3 Replies
833 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what kind of board do you use? TRK-MPC5634M or MPC5634M EVB? On the first one you have to initialize the SBC's CAN transceiver over SPI, CAN A is connected to PHY by default on the board; see example on Example TRK-MPC5634M Initialization of SBC chip MC33905 and FlexCAN

On the MPC5634M EVB you can select between two transceivers (high and low speed) with the help of jumpers and CAN A or CAN C can be used.

In both cases be sure the Bit timing is the same, on MCU as well as CAN bus analyzer side.

Regards,

Petr

0 Kudos
833 Views
mootan
Contributor II

Thx for reply   . I use TRK-MPC5634M .  It can sent CAN message but cannot receive can message. Bit timing is the same but  i not sure is there something wrong with receive CAN message code .

0 Kudos
834 Views
PetrS
NXP TechSupport
NXP TechSupport

it would be ideally if you can check the CAN_A RX pin with a scope if there is a frame available. if yes, then can suggest this...

- check if correct MB was prepared, also be sure the ID is the same. The example I pointed to prepares MB5 for receiving. Your Receive code check the MB4's flag.

  check the IFRL register if other flag is set

- look at ECR and ESR registers to know if there is any error

- try to use this bit timing setting CAN_A.CR.R = 0x07DB0000 /* Configure for 8MHz OSC, 100KHz bit time */

BR,

Petr