Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

TLE987X问题:

请教下:

我用上位机(TCANLINPRO),基于demo的--LIN_SLAVE_EXAMPLE_TLE987X 程序与板子相连,发送数据,没找到程序里面 关于主从的ID和字节数 哪里可以调整,有谁能帮帮忙指导下嚒

哪些地方需要调整的,

谢谢了。

0 Likes
1 Solution
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

例程只做了俩个通信内容:

1.主机发送PID = 17+目标速度值(也就是adc采样计算结果)

从机收到这个结果,如果大于1000,点亮P0.4 LED

2.主机发送PID = 18,请求从机发送状态,

从机发送当前数据给到主机。

然后主机程序参考lin_driver_api.c,从机请参考lin_slave_task.c

另外,对于PID的定义:

LinGuohui_0-1699599857909.png

所以主机发送的ID 为17,PID = 17;主机发送ID为18,对应PID = 0x92

View solution in original post

0 Likes
9 Replies
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

你好,

关于LIN的数据长度,PID应该是在这里配置的:

LinGuohui_0-1699513566437.png

LinGuohui_1-1699513598619.png

LinGuohui_2-1699513637870.png

 

0 Likes
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

好的,非常谢谢了。我是小白了。

 这里面的结构体 代表的是什么数据,能否再帮忙指导下,谢谢了。

Samx_1-1699579813988.png

 

 

0 Likes
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

你好,

此处t_Lin_Frame_Ctrl是定义为union联合体,包含俩个元素reg[3]和frame共用内存。

reg[0]= frame.pid就是从机预设的ID,

reg[1] = frame.frame_type定义了一些标志位等。

reg[2] =frame. length 定义了帧长度。

0 Likes
lock attach
Attachments are accessible only for community members.
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

好的,谢谢了。

一般滴lin通讯有主从模式。再请教下,

 frame.pid,这个是从机的ID,那上位机主机发来的信息对应的 ID对应的在哪里设置。

这个程序对应的LDF文件打开是这样的:

Samx_0-1699593895695.png

谢谢。

 

0 Likes
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

例程只做了俩个通信内容:

1.主机发送PID = 17+目标速度值(也就是adc采样计算结果)

从机收到这个结果,如果大于1000,点亮P0.4 LED

2.主机发送PID = 18,请求从机发送状态,

从机发送当前数据给到主机。

然后主机程序参考lin_driver_api.c,从机请参考lin_slave_task.c

另外,对于PID的定义:

LinGuohui_0-1699599857909.png

所以主机发送的ID 为17,PID = 17;主机发送ID为18,对应PID = 0x92

0 Likes
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

好的,明白了,非常感谢!

0 Likes
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

您好,

麻烦了,再请教一个问题:

这个lin 返回来的速度值是0,不知道哪里的问题没设置好,谢谢!

Samx_1-1699868643947.png

 

Samx_0-1699868548863.png

 

0 Likes
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

LINLslave 例程中,从机发送的数据在这里定义的。例程中并没有修改值,所以从机发送的都是这个数据。

LinGuohui_0-1699955017225.png

 

0 Likes
Samx
Level 2
Level 2
10 sign-ins First solution authored 10 replies posted

好的,谢谢,明白了.

0 Likes