CAN 250kbps device returns bad

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CAN 250kbps device returns bad

跳至解决方案
3,418 次查看
nishantsood
Contributor III

Hi Guys,

I have this S32k developer EVB evaluation kit using which I'm trying to talk to a 250Kbps bit rate CAN device on the CAN bus.

Connection:

There are only 2 devices on the whole CANbus 1) The s32k EVB and, 2) The other CAN device which Im trying to read.

I'm skeptical on 2 things:

1) My bitrate calculation:

.bitrate = { // 80 /( [(1 + (4+1) + (1+1) + (7)] x (1+1)) = 80 / ([15] x 2) = 80/30 = 2.6Mhz
.propSeg = 126, // Fcanclk /( [(1 + (15+1) + (15+1) + (127)] x (1+1)) = 80/ [( 40+50+70) x 2]] = 80/320 = 
.phaseSeg1 = 15,
.phaseSeg2 = 15,
.preDivider = 1,
.rJumpwidth = 1
},

and,

2) The mailbox addresses:

#if defined(MASTER)
#define TX_MAILBOX (1UL)
#define TX_MSG_ID (0x01de0800UL)
#define RX_MAILBOX (2UL)
#define RX_MSG_ID (0x01df0900UL)

I'm reading, but I'm not getting the correct replys. As I have tested it before with an Arduino , on it I get all data correctly (extended identifier based call backs)

标记 (2)
1 解答
3,021 次查看
AnaAldescu
NXP Employee
NXP Employee

Hello,

You can see the graphical interface in "Component Inspector" view

pex_config.PNG

If you cannot see this view by default, please access Window > Show view > Other > Processor Expert > Component Inspector.

From this view you can generate the user configuration structure for the FlexCAN driver.

pex_user_config.PNG

For any other information regarding the FlexCAN example (how to enable/disable encryption, etc.), please read the example documentation.

Regards,

Ana

在原帖中查看解决方案

4 回复数
3,022 次查看
AnaAldescu
NXP Employee
NXP Employee

Hello,

You can see the graphical interface in "Component Inspector" view

pex_config.PNG

If you cannot see this view by default, please access Window > Show view > Other > Processor Expert > Component Inspector.

From this view you can generate the user configuration structure for the FlexCAN driver.

pex_user_config.PNG

For any other information regarding the FlexCAN example (how to enable/disable encryption, etc.), please read the example documentation.

Regards,

Ana

3,021 次查看
nishantsood
Contributor III

Thank you!, Ana.

Let me try the solution.

0 项奖励
回复
3,021 次查看
AnaAldescu
NXP Employee
NXP Employee

Hello,

Are you using the S32 SDK FlexCAN driver with S32 Design Studio? If so, you could use the bitrate calculator from the graphical interface.

Also, please provide the clock source for the Protocol Engine clock and its frequency.

Regards,

Ana

3,021 次查看
nishantsood
Contributor III

Hi Ana,

Yes, I'm using the S32 Design Studio. Please, let me know from where to access this graphical tool for bitrate calculation!?

Also, I'm using the flexcan_encrypted example as the basis for my project. (although, I'm not using any encryption!)

The clock settings are as follows:

pastedImage_1.png

0 项奖励
回复