当前位置:网站首页>I.MX6UL核心模块使用连载-CAN、蜂鸣器测试 (十一)
I.MX6UL核心模块使用连载-CAN、蜂鸣器测试 (十一)
2022-07-26 01:58:00 【szembed】
以下内容已经在Iot-6ULX/EVB-6ULX平台上验证通过,Iot-6ULX/EVB-6ULX介绍如下:


10. CAN测试
开发板上搭载了1路CAN接口。测试CAN接口,需要用到CAN测试设备,在开发板和测试设备之间实现数据通信。
测试过程我们使用CAN测试模块USBCAN-II进行测试。连接示意图如下:

CAN测试端口接线示意图
开始测试之前,确认开发板上对应跳线座已经正确短接。


CAN测试跳线短接示意图
打开CANTest测试工具,根据连接在USBCAN-II上的接口选择对应的通道,然后确定并启动CANTest。

CAN测试工具通道选择
在终端中通过指令设置CAN接口的波特率:
[email protected] ~# ip link set can0 down //关闭can0
[email protected] ~# ip link set can0 type can bitrate 50000 //设置can0波特率为50kbps
[email protected] ~# ip link set can0 up //打开can0
[email protected] ~# ifconfig //查看can0设备是否已打开

设置CAN接口波特率
设置好以后,通过指令发送数据到CANTest工具,查看数据是否可以正确接收:
for ((i = 1;$i <= 100; i++)) ;do cansend can0 01a#11223344AABBCCDD; cansend can0 1F334455#1122334455667788; done //循环发送帧ID为01a,数据为11223344AABBCCDD,帧ID为1F334455,数据为 1122334455667788,各100帧

终端测试指令

CANTest接收数据显示
通过指令设置can0接口接收数据,从CANTest发送数据到开发板,在终端查看can0是否正确接收数据:
[email protected] ~# candump can0 & //接收can0数据

终端测试指令
在终端输入好指令以后,在CANTest测试工具操作面板设置好要发送的数据后,点击发送,查看终端是否能够接收到数据。

CANTest发送数据

终端接收数据显示
11. 蜂鸣器测试
EVB-6ULX开发板上搭载了1个蜂鸣器,执行以下指令打开或者关闭蜂鸣器进行测试:
[email protected] ~# echo 129 > /sys/class/gpio/export //创建GPIO129节点
[email protected] ~# echo out > /sys/class/gpio/gpio129/direction //设置IO方向为输出
[email protected] ~# echo 1 > /sys/class/gpio/gpio129/value //IO输出为高,打开蜂鸣器
[email protected] ~# echo 0 > /sys/class/gpio/gpio129/value //IO输出为低,关闭蜂鸣器

终端测试指令
边栏推荐
- What is the difference between for... In... And for... Of
- When everything can be metauniverse, the development of metauniverse seems to have entered a new stage of development
- 推荐系统-协同过滤在Spark中的实现
- The import and Export button of Damon database table is gray, and the DMP file cannot be imported
- Leetcode/ numbers that appear only once
- The e-commerce project is written in the resume. How to answer it during the interview
- 学习笔记:原码, 反码, 补码
- MPLS knowledge points
- excel中怎么显示数字/英文时间
- leetcode/只出现一次的数字
猜你喜欢

Overview of database stress testing methods

Three modes of CPU

What is a test case? How to design?

【独立站建设】shopify卖家:学会这几点,网上商店销量翻倍!

Network layer 2 and layer 3 forwarding

Advantages of composition API

Characteristics and determination of neuraminidase from Clostridium perfringens in Worthington

DialogRPT-Dialog Ranking Pretrained Transformers

Zhinai buys melons (DP backpack)
![[leetcode] 32. Longest valid bracket](/img/5e/45bb0b1ca3d9e429c6c5cf5c4c93ae.png)
[leetcode] 32. Longest valid bracket
随机推荐
IP address of the network
FFT用于估计插值后的图像重采样因子
Leetcode/ numbers that appear only once
Create a future and enjoy extraordinary | gbase Nantah General Motors unveiled opengauss Developer Day 2022
Implementation of recommendation system collaborative filtering in spark
[Verilog digital system design (Xia Yuwen) 4 ----- basic concepts of Verilog syntax 2]
【2019】【论文笔记】基于超材料可调谐THz宽频吸收——
Make and makefile summary II
【Verilog数字系统设计(夏宇闻)4-----Verilog语法的基本概念2】
在Anaconda 中安装和使用R
Relationship between HTC mobile official solution, s-on/s-off and super CID
Shell summary (1)
【独立站建设】shopify卖家:学会这几点,网上商店销量翻倍!
【2021】【论文笔记】6G技术愿景——OTFS调制技术
DialogRPT-Dialog Ranking Pretrained Transformers
PHP Alipay transfer to Alipay account
[in simple terms, play with FPGA learning 11 --- testbench writing skills 1]
There is no setter method in grpc list under flutter. How to use related attributes
Programming basic environment variable setting of in-house SOC
Maximum side length of elements and squares less than or equal to the threshold (source: leetcode)