找回密码
 立即注册

QQ登录

只需一步,快速开始

打印 上一主题 下一主题
开启左侧

[M3334] Simulating LIN Bus Master Code Using UART

[复制链接]
跳转到指定楼层
楼主
admin 发表于 1 小时前 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Application
This example code implements LIN bus master transmission and reception using UART1 on the M3334 series microcontroller.
BSP Version
M3334_Series_BSP_CMSIS_V3.00.002
Hardware
NuMaker-M3334KI V2.0

The LIN bus is a UART/SCI-based low-cost interface with a single master and multiple slave
structure. The maximum rate is 20 kbps and 19,200 bps or 9,600 bps is commonly used. Its
frame structure starts at 13 bits of 0 followed by multiple bytes of standard UART
communication: 0x55 + ID + data + checksum. The numbers of data bytes are agreed upon by
both parties, up to 8 bytes. 13 bits 0 + 0x55 + ID is the frame header and can only be sent by
the master. The slave can only send data after receiving a frame header matching its own ID.
Therefore, the master must periodically send frame headers so that the slave can send data
promptly.

This example code implements LIN host functionality using UART. The code defines a list of
six messages sent in a loop at 20 ms intervals timed by a Timer. After a frame header is sent,
if the host should send data next, the host will continue to send data. If the host should receive
data next, it starts receiving data.

You can download the sample code at EC_M3334_UART_LIN_Master_V1.00.


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 顶顶 踩踩
牛卧堂
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

新唐MCU