CAN-Example does not work on MPC5634M

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

CAN-Example does not work on MPC5634M

1,817 Views
markust
Contributor I

Hallo guys,

 

i'm working with a Freescale TRK-MPC5634M Rev B for a project in our university. And important to say, I'm new in this topic.

 

I want to use the Flex-Can-Interface and found this example:

 

Example TRK-MPC5634M Initialization of SBC chip MC33905 and FlexCAN

 

I downloaded the zip, opened it with CodeWarrior and downloaded it into the RAM and also in the Flash-Memory of the board.

The Jumper J5 is set correctly, and also the CAN-Enable-Jumper are set. Also the Board is power by an external power supply.

 

I use Busmaster and an ETAS es581.2 to see, if the CAN-Interfaces works, but nothing happens. Also on the oscilloscope shows no activity on CAN-High or CAN-Low.

 

Is there anything else to do, or should it work and there is another failure?

 

I would be very happy if anybody could help me.

 

Regards Markus

Labels (1)
0 Kudos
7 Replies

940 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Please double check following:

- power the SBC externally, so connect 9 to 12V to J1 connector and place jumper to SBC_5V-5V position on POWER_SELECT header.

- put the SBC to debug mode with a J5 jumper (J4 not installed), for ease of use

With the mentioned example measure also the CAN TX/RX lines on CAN-Enable jumpers with the scope.

Finally you can check the FlexCAN’s ESR and ECR registers, to know the error status of the FlexCAN module.

Regards,

Petr

0 Kudos

940 Views
markust
Contributor I

Hi PetrS,

thanks for your fast response.

I checked the Jumpers setting again. J5 is set, J4 not, the two CAN-enable jumpers are also set. And J1 is set on SBC_5V and 5V.

Where do I find the ESR and ECR registers? I use the ICDPPCNEXUS Debugger.

The CPU Windows shows only MSR and CR registers, the values are: MSR: 02000000 and CR 80000000 or 20000000.

Could it be, that an other configuration (jumper setting) of the board causes the failure?

Regards Markus

0 Kudos

940 Views
PetrS
NXP TechSupport
NXP TechSupport

I meant FlexCAN ESR/ECR registers. You can display them once you select it via REG button, or you can add Registers details into Variable window, see below.

pastedImage_4.png

I have downloaded the example and test it on my TRK board, it works well. I see the Can message on JP3 port. Check jumpers from picture.

pastedImage_5.png pastedImage_6.png

 

Note: as the message is not acknowledged it is repeated still and you get the ACK error in ESR register. Also the TX error counter in the ECR register shows value 128, which means the FlexCAN is in error passive mode.

Regards,

Petr

0 Kudos

940 Views
markust
Contributor I

The Jumper are set completly like yours.

But I get these results in the ECR/ES:

Unbenannt.pngUnbenannt.png

What could it be?

0 Kudos

940 Views
PetrS
NXP TechSupport
NXP TechSupport

you got the Bit error and you are entering the Bus off state. This is most probably if you are not receiving what is transmitted. This could happen due to

- RX pin is not properly initialized

- SBC is not properly initialized

- if anything else is connected on the bus and baudrates do not match

In case nothing is connected to the bus, you should not get Bit errors, assuming RX/TX pins and SBC are initialized properly. In this case you get ACK error.

0 Kudos

940 Views
markust
Contributor I

I tried it with and without connected cable and the error is the same.

I changed nothing in the code, how could it be, that the RX-pin or the SBC is not initialized? Or do i have to change oder add something? And how do I do this?

And could it be, that the board is damaged, so the CAN doesn't work?

0 Kudos

940 Views
senthilcoramuta
Contributor II

Hello Markus,

For me also, I faced the problem in working with CAN, initially and the program and suggestions given by Petr worked. Thanks for his support.


I would add one more suggestion to you.

Why dont you test the example code in the examples folder of your freescale installation first.

c:\Program Files\Freescale\CW for MPC55xx and MPC56xx 2.10\(CodeWarrior_Examples)\563xM-CW\Flexcan

This code can be used to test your can pins (can tx, rx) from the controller end (and not the transceiver output). You need to short the tx and rx pins of the can tx, rx lines and connect a pullup resistor as shown in the below circuit. (the red circle drawn is a short point, in cookbook they have made a small mistake). This example code is a loopback test and you get more information in the cookbook.

FlexCAN circuit.PNG.png

with regards,

senthil

0 Kudos