|
本帖最后由 duxingkei 于 2021-10-8 00:32 编辑
- 用CH340N解决Arduino_Uno串口下载和通信出错问题即-USB转串口之CH340N-SOP8笔记
- 玩arduino UNO时发现用avrdude下载和用arduino IDE下载总是出现卡死下载失败
- echo "where avrdude"
- echo "d:\WinAVR-20100110\bin\avrdude.exe"
- avrdude -p m328p -c arduino -P COM18 -b 115200 -U flash:w:default\frser.hex
复制代码
即使下载成功,但是当做串口通信,数据量大时,就出现偶尔的通信异常导致卡死,
# 原因排查
- 某宝16.5块买的,无技术支持;给5V电源加上电解滤波电容,无效;
- 板arduino放冰箱低温几分钟下载测试,下载卡死概率增高;
- 用风筒吹加热,下载反而正常了;
- 发现USB转串口部分,晶振无任何标记,芯片苏任何丝印,电脑设备管理居然显示CH340;
- 刚开始还以为MEGA328芯片通信死机,后来排查,用一条PL2303线替换原机测试,通信正常。
# 开始改造
- 搜出元件盒子发现之前买的CH340N,SOP8封装,查找资料,
- CH340N芯片官网CH340N规格书
- [http://www.wch.cn/product/CH340.html](http://www.wch.cn/product/CH340.html)
- 驱动下载网址
[http://www.wch.cn/downloads/CH341SER_EXE.html](http://www.wch.cn/downloads/CH341SER_EXE.html)
- 拆晶振,拆无丝印的山寨CH340驱动的芯片,拆假的晶振负载电容C21;
- 根据CH340N对比分析走线布局和准备
- 改造后实物图
# 重新烧录成功
- avrdude -p m328p -c arduino -P COM18 -b 115200 -U flash:w:default\frser.hex
- avrdude: AVR device initialized and ready to accept instructions
- Reading | ################################################## | 100% 0.02s
- avrdude: Device signature = 0x1e950f
- avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
- To disable this feature, specify the -D option.
- avrdude: erasing chip
- avrdude: reading input file "default\frser.hex"
- avrdude: input file default\frser.hex auto detected as Intel Hex
- avrdude: writing flash (3334 bytes):
- Writing | ################################################## | 100% 0.93s
- avrdude: 3334 bytes of flash written
- avrdude: verifying flash memory against default\frser.hex:
- avrdude: load data flash data from input file default\frser.hex:
- avrdude: input file default\frser.hex auto detected as Intel Hex
- avrdude: input file default\frser.hex contains 3334 bytes
- avrdude: reading on-chip flash data:
- Reading | ################################################## | 100% 0.77s
- avrdude: verifying ...
- avrdude: 3334 bytes of flash verified
- avrdude: safemode: Fuses OK
- avrdude done. Thank you.
复制代码
# 后记
- 改造前还担心CH340N只有RTS脚,原版是DRT脚做复位脚,无法支撑RTS做复位脚的,后来查到是只支持的,需要修改avrdude的配置文件在安装目录,改造成功后,实验发现什么都不需要做,直接命令行烧录即可;
- D:\WinAVR-20100110\bin\avrdude.conf
复制代码
- 第一次改造,发现接WIN10,WIN7都显示设备但是驱动无法安装,强行指定驱动目录也不行,用手摸芯片微微发烫,万用表测量发现芯片4脚RTS对地短路,于是割板子后,驱动OK;
- 图便宜,没想到亏大了,亏了我一颗CH340N和一晚上的折腾,提醒大家,以后买arduinoUno必须买有丝印的CH340或原版的,不要被坑了;
附上完整排版的 Notion笔记链接
https://internal-pisces-590.noti ... b19b381b5004f7010b9
附上完整的notion导出pdf笔记(上传2次失败,全中文无反应,改英文卡在90%多,附图)
保存为草稿了,提示附件未使用
附PDF格式笔记
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|