MPC5554 CAN Baudrate init

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5554 CAN Baudrate init

2,425件の閲覧回数
A_Nagy
Contributor I

Hi,

 

I'm using an MPC5554 on a development board from phytec. On the development board is a crystal with 8MHz, fSYS is set to 128MHz.

 

I init my CAN interface with 166kBaud. The clock source is the crystal, the Bus is working. My register value is : 0x02DB0006 (CANA.CR).

 

This means:

 

PRESDIV = 2

RJW=3

PSEG2=3

PSEG1=3

CLK_src=0

PROPSEG=6

 

When I init my CAN interface with 1MBaud. The clock source couldn't be longer the crystal.

My register value is : 0x07DB2006 (CANA.CR).

 

This means:

 

PRESDIV = 7

RJW=3

PSEG2=3

PSEG1=3

CLK_src=1

PROPSEG=6

 

The Bus isn't working!

 

Could anybody see a mistake? 

0 件の賞賛
返信
2 返答(返信)

1,458件の閲覧回数
T_Ks
Contributor I

Hallo      A Nagy

 

I hope you see this mail I am interested in your project spezial this MPC 5554 CAN connection

 

can you mail me ? I now it is an year agoo maybe you read it .

 

tks12xvodafone.nl

 

Best regards T.Kienhuis

0 件の賞賛
返信

1,458件の閲覧回数
A_Nagy
Contributor I

Hi there!

 

I found my problem, the two definitions of the CAN Pins were wrong. The value has to be:

 

  SIU.PCR[83].R  = 0x060F; // FlexCAN_A_CNTX -> primary function
  SIU.PCR[84].R  = 0x050F; // FlexCAN_A_CNRX -> primary function

 

The value for the Config Register:

 

  CAN_A.CR.R = 0x0F122000

 

With this coniguration my CAN Interface works with 1MBaud!

 

//*******************************************

//  (fSYS = 128MHz, fOSC = 8MHz)

#define CAN_BAUD_1M      0x0F122000
#define CAN_BAUD_500k    0x00360000
#define CAN_BAUD_250k    0x01360000 

Message Edited by A.Nagy on 2009-09-02 10:56 AM
0 件の賞賛
返信