摘要
设计了一款体积小、成本低、可靠性高的具有普适性的高速CAN转USB适配器。以STM32F107系列微处理器作为核心,USB接口部分采用STM32内部USB控制器,CAN接口采用STM32内部的CAN控制器并且外接带隔离的CAN收发器CTM1050。开发过程中创建了数据传输协议,对需传输的数据有固定的传输格式,进行数据甄别后再传输数据,保证了数据传输的正确性和可靠性。设计中,ID并不是固定值,而是获取对方发送过来的ID。对CAN接收的数据进行打包成标准格式帧,以便传入上位机后了解传输数据特性。经过多次现场实验测试表明:该设备可以实现USB和CAN协议的数据转换,完成CAN侧数据收发,CAN侧具有不同的ID以及不同的帧类型都可进行传输。该系统能以500 Kb/s长时间稳定运行。
This paper studied the design of a general high-speed USB and CAN converter, which has small volume, low cost, high reliability. STM32F107 was used as the core of converter, the USB interface part adopted USB controller from internal of STM32, the CAN interface used CAN controller from internal of STM32 with external connection of CAN transceiver CTMI050. Data transfer protocol was created, the protocol needed a fixed transmission format and screen data before transmitting data. The ID unfixed was acquired from the other side of the ID. The data received by CAN were packaged into standard format of data frame, so that the data transmission characteristics could be easily found when data were transferred to a PC. A lot of tests showed that this equipment can realize the conversion between USB and CAN, the system runs stably for a long time with 500 Kb/s.
出处
《实验室研究与探索》
CAS
北大核心
2017年第3期129-132,共4页
Research and Exploration In Laboratory
基金
四川省卓越工程师教育培养计划(核工程与核技术)(11100-15Z006/064)
关键词
通用串行总线
控制器局域网
数据传输协议
universal serial bus (USB)
controller area network (CAN)
data transfer protocol