CAN Configuration issue on MPC5744P

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

CAN Configuration issue on MPC5744P

2,377 Views
alimeraj
Contributor IV

Futhermore, I tried to make CAN working using Model based motor control toolbox and I failed to make it work.

 

I configured according to datasheet but still not CAN communication.

 

I want to configure both CAN channels:

1) 500 kbits

2) 1 Mbps

 

Can you please help me on how to configure the CAN configuratio block to make it work.

 

Thanks

Ali

Original Attachment has been moved to: can_model_pnt.mdl.zip

7 Replies

1,595 Views
Daniel_Popa
NXP Employee
NXP Employee

Hi alimeraj

CAN should work fine. Please check this thread: https://community.nxp.com/thread/454140 

Are you using the MPC5744P devkit (small board) or MPC5744P evaluation board (larger board) ?

Hint: Make sure you add a 120Ohm terminator resistor.

Best regards,
Daniel

0 Kudos
Reply

1,595 Views
alimeraj
Contributor IV

Hi,

I made the can work on CH2 @ 500kbits but I still couldn't make it work on CH 1 and I havent tried on CH 0.

Now I am trying to configure CH2 for 1Mbps but I cant work out the RJW,Seg1,Seg2, prop and pre div.

pastedImage_1.png

what I have in our base software is bit different.

Can you please provide me with a method to calculate the right values for any given baud rate.

Thanks,

Ali

0 Kudos
Reply

1,595 Views
constantinrazva
NXP Employee
NXP Employee

hi alimeraj‌,

Attached is a possible hotfix for you. 

You should update the following files,in the folders:

update flexcan_pnt_library.c from {Toolbox install dir}\mbdtbx_pnt\src\c_library\ folder

update mbdtargetmainlibpnt.tlc from {Toolbox install dir}\mbdtbx_pnt\mbdtbx_pnt\ folder

Can you try with these changes and tell us if everything is ok?

Hope this helps!

Kind regards,

Razvan.

0 Kudos
Reply

1,595 Views
alimeraj
Contributor IV

Hi Razvan,

thanks for the hot fix, i will try it and let you know.

Thanks,

Ali Meraj

0 Kudos
Reply

1,595 Views
constantinrazva
NXP Employee
NXP Employee

hi alimeraj‌,

cantiming.png

SYNC_SEG is 1 Time Quantum long -  it is used to synchronize the various bus nodes  -it's non-programmable.
PROP_SEG is programmable - it is used to compensate for signal delays across the network.
PHASE_SEG1 is programmable - it is used to compensate for edge phase errors and may be lengthened during resynchronization.
PHASE_SEG2 (Seg 2) is used to compensate edge phase errors and may be shortened during resynchronization. For this the minimum value of PHASE_SEG2 is the value of SJW.

SJW is the Synchronization Jump Width.

Here are configurations for 1Mbps and 500Kbps (for CLKSRC=0, meaning the CAN engine clock source is the oscillator clock) for devkit/eval board.

1Mbps:
PRESDIV - 1
RJW - 3
PSEG1 - 5
PSEG2 - 5
PROPSEG - 6

500kbps:
PRESDIV - 3
RJW - 3
PSEG1 - 5
PSEG2 - 5
PROPSEG - 6

Please let us know if it works. Hope this helps!

Kind regards,

Razvan.

1,596 Views
alimeraj
Contributor IV

Hi,

Unfortunatly I still can make CAN working.

I have attached the modfied example model specific to my hardware.

I am using CAN 1 and trying to configure it for 500kbps.

Kind regards,

Ali

0 Kudos
Reply

1,596 Views
alimeraj
Contributor IV

Hi Daniel,

I have 3 different boards

In house dev board

Eval kit

Actual hardware.

we have been using this processor in our product.

we are very keen to check the performance of the model based toolbox.

we have everything working on this processor but with different base software config.

I will check CAN again with your refence to example.

I have terminator resistor connected in the loop.

Thanks,

Ali Meraj

0 Kudos
Reply