在和硬件模块打交道时,经常会用到USB-TTL模块,早些年刚玩这些东西时,我也买了好多USB-TTL模块。
但是淘宝的奸商你懂的,很多都是用的垃圾芯片,然后用没几天,这些垃圾模块无一例外的都烧掉了。
这还不是最惨的事情,最惨的是,其中一个模块烧掉时散发了大量的热量,我没注意这事,直接上手去拿,然后手指上烫出个巨大的水泡,疼了好多天。
其实我手头有好多Arduino UNO 以及Arduino NANO模块,完全可以拿来直接当作USB-TTL使用,所以根本没必要买USB-TTL模块的。
Arduino UNO的USB部分主控使用的是ATmega16u2/ATmega8U2,我个人觉得比神马CH340、CP2102、FT232都要稳定。当然了一些山寨的Arduino UNO可能会使用上述芯片,不过对我们这个帖子中讲述的技巧并无实质影响。
Arduino UNO上数字脚0、1分别是RX(0)以及TX(1),不过这个是从Arduino UNO上主控芯片ATMEL 328P的视角来看的。
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
举例说,如果一个模块要和328P通信,那么就需要交叉链接模块与UNO的TX、RX并共地。
但是如果想把Arduino UNO当作USB-TTL,那么这时候模块的UNO的链接应该:
TX<->TX
RX<->RX
GND<->GND
另外需要注意的是,如果Arduino UNO内装载有串口读写相关的程序,就会影响把Arduino UNO当作USB-TTL,这时候我们需要烧录一个空程序进去,以免UNO捣乱。
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
当然,如果愿意的话,还可以烧入一个blink的示例程序进去,因为看着小灯闪闪,就比较好玩。😀
Arduino环境的安装以及blink示例,可以参考文末链接。
相关链接
https://steemit.com/~witnesses type in
oflyhigh
and click VOTE
Vote @oflyhigh via Steemconnect
Thank you!
Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.22% upvote! Together, let’s change the world!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
cp2102其实挺不错😂
!shop
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
😂
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你好鸭,O哥!
@julian2013赠送1枚SHOP币给你!
目前你总共有: 15枚SHOP币
查看或者交易
无聊吗?跟我猜拳吧! **石头,剪刀,布~**SHOP币
请到 steem-engine.com.Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@tipu curate
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Upvoted 👌
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit